Revision 37298 branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/ViewPort.java
ViewPort.java | ||
---|---|---|
52 | 52 |
import org.cresques.cts.GeoCalc; |
53 | 53 |
import org.cresques.cts.IProjection; |
54 | 54 |
import org.cresques.cts.UTM; |
55 |
import org.slf4j.Logger; |
|
56 |
import org.slf4j.LoggerFactory; |
|
57 |
|
|
55 | 58 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
56 | 59 |
import org.gvsig.fmap.geom.Geometry; |
57 | 60 |
import org.gvsig.fmap.geom.GeometryLocator; |
... | ... | |
64 | 67 |
import org.gvsig.fmap.mapcontext.events.ExtentEvent; |
65 | 68 |
import org.gvsig.fmap.mapcontext.events.ProjectionEvent; |
66 | 69 |
import org.gvsig.fmap.mapcontext.events.listeners.ViewPortListener; |
70 |
import org.gvsig.timesupport.Time; |
|
67 | 71 |
import org.gvsig.tools.ToolsLocator; |
68 | 72 |
import org.gvsig.tools.dynobject.DynStruct; |
69 | 73 |
import org.gvsig.tools.lang.Cloneable; |
... | ... | |
72 | 76 |
import org.gvsig.tools.persistence.PersistentState; |
73 | 77 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
74 | 78 |
import org.gvsig.tools.util.Callable; |
75 |
import org.slf4j.Logger; |
|
76 |
import org.slf4j.LoggerFactory; |
|
77 | 79 |
|
78 | 80 |
/** |
79 | 81 |
* <p> |
... | ... | |
178 | 180 |
* @see #setEnvelope(Envelope) |
179 | 181 |
*/ |
180 | 182 |
protected Rectangle2D extent; |
183 |
|
|
184 |
protected Time time; |
|
181 | 185 |
|
182 | 186 |
/** |
183 | 187 |
* <p> |
... | ... | |
1016 | 1020 |
listener.extentChanged(ev); |
1017 | 1021 |
} |
1018 | 1022 |
} |
1023 |
|
|
1024 |
/** |
|
1025 |
* <p> |
|
1026 |
* Notifies to all view port listeners registered, that the time |
|
1027 |
* of this view port has changed. |
|
1028 |
* </p> |
|
1029 |
* |
|
1030 |
* @param newTime |
|
1031 |
* the new time |
|
1032 |
* |
|
1033 |
* @see #refreshExtent() |
|
1034 |
* @see #setTime(Time) |
|
1035 |
* @see ExtentEvent |
|
1036 |
* @see ViewPortListener |
|
1037 |
*/ |
|
1038 |
protected void callTimeChanged(Time newTime) { |
|
1039 |
ExtentEvent viewPortEvent = new ExtentEvent(newTime); |
|
1019 | 1040 |
|
1041 |
for (int i = 0; i < listeners.size(); i++) { |
|
1042 |
ViewPortListener listener = (ViewPortListener) listeners.get(i); |
|
1043 |
listener.extentChanged(viewPortEvent); |
|
1044 |
} |
|
1045 |
} |
|
1046 |
|
|
1020 | 1047 |
/** |
1021 | 1048 |
* <p> |
1022 | 1049 |
* Notifies to all view port listeners registered, that the background color |
... | ... | |
1882 | 1909 |
this.drawVersion++; |
1883 | 1910 |
} |
1884 | 1911 |
|
1885 |
// /** |
|
1886 |
// * Obtiene la representaci?n de un color como String |
|
1887 |
// * |
|
1888 |
// * @param c |
|
1889 |
// * Color |
|
1890 |
// * |
|
1891 |
// * @return String |
|
1892 |
// */ |
|
1893 |
// public static String color2String(Color c) { |
|
1894 |
// if (c == null) |
|
1895 |
// return null; |
|
1896 |
// return c.getRed() + "," + c.getGreen() + "," + c.getBlue() + "," |
|
1897 |
// + c.getAlpha(); |
|
1898 |
// } |
|
1899 |
// |
|
1900 |
// /** |
|
1901 |
// * Obtiene el color de un string generado con color2String |
|
1902 |
// * |
|
1903 |
// * @param stringColor |
|
1904 |
// * string |
|
1905 |
// * |
|
1906 |
// * @return Color |
|
1907 |
// */ |
|
1908 |
// public static Color string2Color(String stringColor) { |
|
1909 |
// if (stringColor == null || stringColor.equals("null")) |
|
1910 |
// return null; |
|
1911 |
// String[] ints = new String[4]; |
|
1912 |
// |
|
1913 |
// ints = CompatLocator.getStringUtils().split(stringColor, ","); |
|
1914 |
// |
|
1915 |
// int[] ret = new int[4]; |
|
1916 |
// |
|
1917 |
// for (int i = 0; i < ret.length; i++) { |
|
1918 |
// ret[i] = new Integer(ints[i]).intValue(); |
|
1919 |
// } |
|
1920 |
// |
|
1921 |
// return new Color(ret[0], ret[1], ret[2], ret[3]); |
|
1922 |
// } |
|
1923 |
|
|
1912 |
public Time getTime() { |
|
1913 |
return time; |
|
1914 |
} |
|
1915 |
|
|
1916 |
public void setTime(Time time) { |
|
1917 |
this.time = time; |
|
1918 |
this.updateDrawVersion(); |
|
1919 |
callTimeChanged(time); |
|
1920 |
} |
|
1924 | 1921 |
} |
Also available in: Unified diff