|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectComponent
Container
JComponent
JPanel
CoordinateChooser
public class CoordinateChooser
A pane of controls designed to allow a user to select spatio-temporal coordinates. Current implementation uses geographic coordinates (longitudes/latitudes) and dates according some locale calendar. Future version may allow the use of user-specified coordinate system. Latitudes are constrained in the range 90°S to 90°N inclusive. Longitudes are constrained in the range 180°W to 180°E inclusive. By default, dates are constrained in the range January 1st, 1970 up to the date at the time the widget was created.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
GEOGRAPHIC_AREA
An enumeration constant for showing or hidding the geographic area selector. |
static int |
RESOLUTION
An enumeration constant for showing or hidding the resolution selector. |
static int |
TIME_RANGE
An enumeration constant for showing or hidding the time range selector. |
Fields inherited from class JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
CoordinateChooser()
Constructs a default coordinate chooser. |
|
CoordinateChooser(Date minTime,
Date maxTime)
Constructs a coordinate chooser with date constrained in the specified range. |
Method Summary | |
---|---|
void |
addChangeListener(int selectors,
ChangeListener listener)
Adds a change listener to the listener list. |
void |
commitEdit()
Commits the currently edited values. |
JComponent |
getAccessory()
Returns the accessory component. |
Date |
getEndTime()
Returns the end time, or null if there is none. |
Rectangle2D |
getGeographicArea()
Gets the geographic area, in latitude and longitude degrees. |
Dimension2D |
getPreferredResolution()
Returns the preferred resolution. |
Date |
getStartTime()
Returns the start time, or null if there is none. |
TimeZone |
getTimeZone()
Returns the time zone used for displaying dates. |
boolean |
isSelectorVisible(int selector)
Tells if a selector is currently visible or not. |
static void |
main(String[] args)
Show the dialog box. |
void |
removeChangeListener(int selectors,
ChangeListener listener)
Removes a change listener from the listener list. |
void |
setAccessory(JComponent accessory)
Sets the accessory component. |
void |
setGeographicArea(Rectangle2D area)
Sets the geographic area, in latitude and longitude degrees. |
void |
setPreferredResolution(Dimension2D resolution)
Sets the preferred resolution. |
void |
setSelectorVisible(int selectors,
boolean visible)
Set the visible state of one or many selectors. |
void |
setTimeRange(Date startTime,
Date endTime)
Sets the time range. |
void |
setTimeZone(TimeZone timezone)
Sets the time zone. |
boolean |
showDialog(Component owner)
Shows a dialog box requesting input from the user. |
boolean |
showDialog(Component owner,
String title)
Shows a dialog box requesting input from the user. |
Methods inherited from class JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int GEOGRAPHIC_AREA
isSelectorVisible(int)
and setSelectorVisible(int, boolean)
.
TIME_RANGE
,
RESOLUTION
,
isSelectorVisible(int)
,
setSelectorVisible(int, boolean)
,
addChangeListener(int, javax.swing.event.ChangeListener)
,
removeChangeListener(int, javax.swing.event.ChangeListener)
,
Constant Field Valuespublic static final int TIME_RANGE
isSelectorVisible(int)
and setSelectorVisible(int, boolean)
.
GEOGRAPHIC_AREA
,
RESOLUTION
,
isSelectorVisible(int)
,
setSelectorVisible(int, boolean)
,
addChangeListener(int, javax.swing.event.ChangeListener)
,
removeChangeListener(int, javax.swing.event.ChangeListener)
,
Constant Field Valuespublic static final int RESOLUTION
isSelectorVisible(int)
and setSelectorVisible(int, boolean)
.
GEOGRAPHIC_AREA
,
TIME_RANGE
,
isSelectorVisible(int)
,
setSelectorVisible(int, boolean)
,
addChangeListener(int, javax.swing.event.ChangeListener)
,
removeChangeListener(int, javax.swing.event.ChangeListener)
,
Constant Field ValuesConstructor Detail |
---|
public CoordinateChooser()
public CoordinateChooser(Date minTime, Date maxTime)
[minTime..maxTime]
range is not the same than the
range given to setTimeRange(java.util.Date, java.util.Date)
. The later set only the time range shown
in the widget, while this constructor set also the minimum and maximum dates
allowed.
minTime
- The minimal date allowed.maxTime
- the maximal date allowed.Method Detail |
---|
public boolean isSelectorVisible(int selector)
CoordinateChooser
contains three selectors: one for geographic area, one for time range and one for the
preferred resolution.
selector
- One of the following constants:
GEOGRAPHIC_AREA
,
TIME_RANGE
or
RESOLUTION
.
true
if the specified selector is visible, or false
otherwise.
IllegalArgumentException
- if selector
is not legal.public void setSelectorVisible(int selectors, boolean visible)
selectors
- Any bitwise combinaisons of
GEOGRAPHIC_AREA
,
TIME_RANGE
and/or
RESOLUTION
.visible
- true
to show the selectors, or false
to hide them.
IllegalArgumentException
- if selectors
contains illegal bits.public Rectangle2D getGeographicArea()
public void setGeographicArea(Rectangle2D area)
public Dimension2D getPreferredResolution()
null
value means that the
best available resolution should be used.
public void setPreferredResolution(Dimension2D resolution)
null
value means that the best
available resolution should be used.
public TimeZone getTimeZone()
public void setTimeZone(TimeZone timezone)
setTimeRange(java.util.Date, java.util.Date)
.
public Date getStartTime()
null
if there is none.
public Date getEndTime()
null
if there is none.
public void setTimeRange(Date startTime, Date endTime)
startTime
- The start time.endTime
- The end time.getStartTime()
,
getEndTime()
public JComponent getAccessory()
null
if there is none.public void setAccessory(JComponent accessory)
Note: If there was a previous accessory, you should unregister any listeners that the accessory might have registered with the coordinate chooser.
accessory
- The accessory component, or null
to remove any previous accessory.public void commitEdit() throws ParseException
ParseException
- If at least one of currently edited value couldn't be commited.public void addChangeListener(int selectors, ChangeListener listener)
selectors
arguments:
GEOGRAPHIC_AREA
will watches for the bounding box (East, West, North and South
value); TIME_RANGE
watches for start time and end time; RESOLUTION
watches for the resolution along East-West and North-South axis. Bitwise combinaisons
are allowed. For example, GEOGRAPHIC_AREA | TIME_RANGE
will register a
listener for both geographic area and time range.
The source of ChangeEvent
s delivered to ChangeListener
s will be in most
case the SpinnerModel
for the edited field.
selectors
- Any bitwise combinaisons of
GEOGRAPHIC_AREA
,
TIME_RANGE
and/or
RESOLUTION
.listener
- The listener to add to the specified selectors.
IllegalArgumentException
- if selectors
contains illegal bits.public void removeChangeListener(int selectors, ChangeListener listener)
selectors
- Any bitwise combinaisons of
GEOGRAPHIC_AREA
,
TIME_RANGE
and/or
RESOLUTION
.listener
- The listener to remove from the specified selectors.
IllegalArgumentException
- if selectors
contains illegal bits.public boolean showDialog(Component owner)
owner
. If owner
is contained into a
JDesktopPane
, the dialog box will appears as an internal
frame. This method can be invoked from any thread (may or may not be the
Swing thread).
owner
- The parent component for the dialog box, or null
if there is no parent.
true
if user pressed the "Ok" button, or false
otherwise
(e.g. pressing "Cancel" or closing the dialog box from the title bar).public boolean showDialog(Component owner, String title)
owner
is contained into a
JDesktopPane
, the dialog box will appears as an internal frame. This
method can be invoked from any thread (may or may not be the Swing thread).
owner
- The parent component for the dialog box, or null
if there is no parent.title
- The dialog box title.
true
if user pressed the "Ok" button, or false
otherwise
(e.g. pressing "Cancel" or closing the dialog box from the title bar).public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |