Revision 13733 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/MapControl.java

View differences:

MapControl.java
89 89
	/** Cuando la vista est? desactualizada. */
90 90
	public static final int DESACTUALIZADO = 1;
91 91
    public static final int ONLY_GRAPHICS = 2;
92
    private static int drawFrameRate = 3;
93
    private static boolean drawAnimationEnabled = true;
94

  
92 95
    // public static final int FAST_PAINT = 3;
93 96
	//private static Logger logger = Logger.getLogger(MapControl.class.getName());
94 97
	private MapContext mapContext = null;
......
143 146

  
144 147
        this.drawer2 = new Drawer2();
145 148
		//Timer para mostrar el redibujado mientras se dibuja
146
		timer = new Timer(33,
149
		timer = new Timer(1000/drawFrameRate,
147 150
				new ActionListener() {
148 151
					public void actionPerformed(ActionEvent e) {
149
						MapControl.this.repaint();
152
						
153
						if (drawAnimationEnabled) {
154
							MapControl.this.repaint();
155
						}
150 156
					}
151 157
				});
152 158
	}
......
1058 1064
	public void setCurrentMapTool(Behavior mapTool ){
1059 1065
		currentMapTool = mapTool;
1060 1066
	}
1067
	
1068
	public void applyFrameRate() {
1069
		if (getDrawFrameRate()>0) {
1070
			timer.setDelay(1000/getDrawFrameRate());
1071
		}
1072
	}
1073

  
1074
	public static int getDrawFrameRate() {
1075
		return drawFrameRate;
1076
	}
1077

  
1078
	public static void setDrawFrameRate(int drawFrameRate) {
1079
		MapControl.drawFrameRate = drawFrameRate;
1080
	}
1081

  
1082
	public static boolean isDrawAnimationEnabled() {
1083
		return drawAnimationEnabled;
1084
	}
1085

  
1086
	public static void setDrawAnimationEnabled(boolean drawAnimationEnabled) {
1087
		MapControl.drawAnimationEnabled = drawAnimationEnabled;
1088
	}
1061 1089
}

Also available in: Unified diff