|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.collab.SharableImpl
ucar.unidata.idv.control.DisplayControlBase
ucar.unidata.idv.control.DisplayControlImpl
ucar.unidata.idv.control.DrawingControl
public class DrawingControl
A MetApps Display Control for drawing lines on a navigated display.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ucar.unidata.idv.control.DisplayControlImpl |
|---|
DisplayControlImpl.SideLegendLabel |
| Field Summary | |
|---|---|
static String |
ATTR_EDITABLE
Xml attribute for the editable property |
static String |
ATTR_FRONTDISPLAY
xgrf attribute |
static String |
ATTR_TITLE
Xml attribute for the title property |
static String |
ATTR_USETIMESINANIMATION
xgrf xml attribute |
static DrawingCommand |
CMD_MOVE
command |
static DrawingCommand |
CMD_SELECT
Select command |
static DrawingCommand |
CMD_STRETCH
command |
protected DrawingCommand |
currentCmd
Current command |
protected JCheckBox |
enabledCbx
Controls the disabled state |
static PatternFileFilter |
FILTER_XGRF
File filter used for the xgrf files |
static int |
FLAG_FILLED
Filled capable flag for the command object |
static int |
FLAG_FULLLATLON
Full lat/lon capable flag for the command object |
static int |
FLAG_STRAIGHT
flag for straight |
protected List |
glyphs
List of all glyphs |
protected List |
selectedGlyphs
List of selected glyphs |
static String |
SHARE_LINES
property for sharing lines |
protected JCheckBox |
straightCbx
Filled mode |
static String |
SUFFIX_XGRF
File suffix used for the xgrfg files |
static String |
TAG_EDITOR
Xml tag for the editor settings in the import/export format |
| Fields inherited from class ucar.unidata.idv.control.DisplayControlImpl |
|---|
categories, colorScaleInfo, colorScales, contourInfo, contourInfoParams, contourWidget, controlContext, ctw, dataSelection, defaultView, defaultViewManager, DISPLAY_LIST_NAME, displayListTable, displayListUsesColor, displayMasters, displayUnit, helpUrl, initNoteText, instantiatedWithNoData, noteTextArea, noteWrapper, paramName, requestProperties, selectRangeWidget, settingVisibility, sharables, showNoteText, skipSlider, version, viewManagers, ZFUDGE |
| Fields inherited from interface ucar.unidata.idv.DisplayControl |
|---|
BOTTOM_LEGEND, DEFAULT_PROBEFORMAT, PREF_PREFIX, PREF_PROBEFORMAT, PREF_REMOVEONWINDOWCLOSE, PREF_SAMPLING_MODE, PREF_STANDALONE_REMOVEONCLOSE, PREF_STANDALONE_REMOVEONCLOSE_ASK, PROP_LEGENDICON, RASTERMODE_SHOWALL, RASTERMODE_SHOWNONRASTER, RASTERMODE_SHOWRASTER, SIDE_LEGEND |
| Constructor Summary | |
|---|---|
DrawingControl()
Create a new Drawing Control; set attributes. |
|
| Method Summary | |
|---|---|
protected void |
addControlWidgets(List widgets)
Add the widgets into the controls panel |
protected void |
addFileMenuItems(List items,
boolean forMenuBar)
Add to the file menu |
protected boolean |
addGlyph(DrawingGlyph glyph)
Add the glyph into the list of glyphs |
void |
applyColorToAll()
Apply the current color to all glyphs |
void |
applyZPosition(List glyphs)
Apply the current z position to all glyphs |
protected boolean |
canHandleEvents()
Should we handle display events |
protected void |
checkZSliderEnabled()
Enable/disable the z slider |
void |
close()
Clear the selection when we minisze the window |
DrawingGlyph |
closestGlyph(DisplayEvent event)
Find the glyph that is closest to the x/y point of the given event |
DrawingGlyph |
closestGlyph(DisplayEvent event,
boolean forMove)
Find the glyph that is closest to the x/y point of the given event |
protected DrawingGlyph |
createGlyph(DisplayEvent event,
boolean mousePress)
Create a glyph |
protected void |
doCut()
Remove the glyphs in the selection set |
void |
doFlythrough()
Do the flythrough |
protected Container |
doMakeContents()
Make the gui |
protected JComponent |
doMakeControlsPanel()
Make the main tabbed pane |
static JComboBox |
doMakeLineWidthBox(int lineWidth)
Make a component to change the width of the lines. |
protected JComponent |
doMakeShapesPanel()
Make the shapes panel |
protected JComponent |
doMakeStylePanel()
Make the style panel |
protected JComponent |
doMakeTablePanel()
Make the jtable panel |
protected void |
doneMovingGlyph(DrawingGlyph glyph)
Done moving glyph |
void |
doProperties(List glyphs)
Show the properties dialog for the glyphs in the list |
void |
doRemove()
Remove this DisplayControl from the system. |
void |
evaluateGlyphJython(DrawingGlyph glyph,
String jython)
Evalue the given jython for the glyph |
String |
formatDistance(Real distance)
Utility |
DateTime[] |
getAllTimes()
Get an array of all the current times in the display |
Set |
getAnimationSet()
Get the animation set |
protected long |
getControlChangeSleepTime()
How long do we sleep until we act on the control changed event |
int |
getCoordType()
Get the coord type (e.g., LATLON, XYZ) |
Real |
getCurrentTime()
Get the current time in the animation |
Unit |
getDistanceUnit()
Get the distance unit |
boolean |
getEditable()
Get the Editable property. |
protected void |
getEditMenuItems(List items,
boolean forMenuBar)
Add the relevant edit menu items into the list |
String |
getEditorTitle()
Get the Editor Title property. |
boolean |
getEnabled()
Get the Enabled property. |
protected void |
getFileMenuItems(List items,
boolean forMenuBar)
Add to the file menu. |
boolean |
getFilled()
Get the Filled property. |
Font |
getFont()
Get the font from the ui widget |
boolean |
getFrontDisplay()
Get the FrontDisplay property. |
double |
getFrontScale()
Get the FrontScale property. |
boolean |
getFullLatLon()
Get the FullLatLon property. |
String |
getGlyphJython()
Get the GlyphJython property. |
protected String |
getGlyphNameDefault(DrawingGlyph glyph)
Get the default name to use |
List |
getGlyphs()
Get the Glyphs property. |
boolean |
getIgnoreTime()
Get the IgnoreTime property. |
protected double |
getInitialZPosition()
Get default z position to use |
String |
getJustification()
Get the text justification value |
protected void |
getLegendLabels(List labels,
int legendType)
Overwrite the legend labels method to use the editor title if there is one. |
int |
getLineWidth()
Get the line width |
ColorTable |
getRGBColorTable()
Get the color table to use for the image glyphs |
protected List |
getShapeCommands()
Get the lsit of shape commands the user can draw with. |
boolean |
getShowFronts()
Get the ShowFronts property. |
boolean |
getStraight()
Get the Straight property. |
Real |
getTimeForGlyph()
If we are not drawing in the current time then return null. |
boolean |
getUseTime()
Get the UseTime property. |
String |
getVerticalJustification()
Get the vert text justification value |
void |
glyphChanged(DrawingGlyph glyph)
The given glyph has changed somehow. |
void |
handleDisplayChanged(DisplayEvent event)
Listen for DisplayEvents |
protected void |
handleWindowClosing()
Handle the window closing. |
boolean |
init(DataChoice dataChoice)
Call to help make this kind of Display Control; also calls code to made the Displayable (empty of data thus far). |
protected void |
initDisplayUnit()
Initialize the display unit |
boolean |
isSelected(DrawingGlyph glyph)
Is the given glyph selected |
protected JPanel |
makeButtonPanel(List commands,
ButtonGroup bg)
Utility to make a panel holding the icon buttons. |
protected void |
makeModePanel(List widgets)
Makes the model panel. |
protected void |
processData(Data data)
Process the visad data object. |
void |
projectionChanged()
Respond to the projection changing event |
void |
receiveShareData(Sharable from,
Object dataId,
Object[] data)
Method called by other classes that share the the state. |
void |
removeAllGlyphs()
Remove em all. |
void |
removeGlyph(DrawingGlyph glyph)
Remove the glyph from the drawing |
protected void |
resetData()
respond to the reload data call |
protected void |
selectionChanged()
The selection set changed. |
void |
setActive(boolean b)
Deprecated. |
protected void |
setCoordType(int c)
Get the coord type (e.g., LATLON, XYZ) |
protected void |
setCurrentCommand(DrawingCommand command)
Set the current active command |
void |
setDisplayVisibility(boolean on)
TUrn on the visibility of this display |
void |
setEditable(boolean value)
Set the Editable property. |
void |
setEditorTitle(String value)
Set the editorTitle property. |
void |
setEnabled(boolean value)
Set the Enabled property. |
void |
setFilled(boolean value)
Set the Filled property. |
void |
setFrontDisplay(boolean value)
Set the FrontDisplay property. |
void |
setFrontScale(double value)
Set the FrontScale property. |
void |
setFullLatLon(boolean value)
Set the FullLatLon property. |
void |
setGlyphJython(String value)
Set the GlyphJython property. |
void |
setGlyphs(List value)
Set the DrawingGlyphs property. |
void |
setIgnoreTime(boolean value)
Set the IgnoreTime property. |
void |
setLines(UnionSet lines)
Deprecated. |
void |
setLineWidth(int width)
Set the width of the lines. |
void |
setSelection(DrawingGlyph glyph)
Clear the selection and add the given glyph to the selection |
void |
setSelection(List newSelection,
boolean addTo)
Set the selection. |
void |
setShowFronts(boolean value)
Set the ShowFronts property. |
void |
setStraight(boolean value)
Set the Straight property. |
void |
setUseTime(boolean value)
Set the UseTime property. |
protected boolean |
shouldAddControlListener()
Signal base class to add this as a control listener |
protected boolean |
shouldAddDisplayListener()
Signal base class to add this as a display listener |
boolean |
shouldBeVisible(DrawingGlyph tg)
Should this glyph be visible |
protected boolean |
showFilledCbx()
Should we show the filled cbx |
protected boolean |
showLocationWidgets()
Should we show the locatio widgets |
protected boolean |
showTimeWidgets()
Should we show the time widgets |
protected void |
timeChanged(Real time)
Respond to a timeChange event |
void |
toggleVisibilityForVectorGraphicsRendering(int rasterMode)
Toggle the visibility for vector graphics rendering |
void |
viewpointChanged()
Respond to control changed events from the view manager |
void |
zSliderChanged(double value)
Handle the z position slider changed |
| Methods inherited from class ucar.unidata.idv.control.DisplayControlBase |
|---|
boxToEarth, boxToEarth, boxToEarth, boxToEarth, boxToEarth, boxToScreen, calculateRectangle, createStationTfo, earthToBox, earthToBox, earthToBoxTuple, earthToScreen, formatLevels, getLabeledReal, getLevelReal, getScreenCenter, getSelectedStation, getTmpProperty, isLeftButtonDown, logException, logException, makeEarthLocation, putTmpProperty, removeTmpProperty, screenToBox, screenToBox, screenToEarth, setStations, setStations, toBox, toEarth, userErrorMessage, userMessage |
| Methods inherited from class ucar.unidata.collab.SharableImpl |
|---|
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ucar.unidata.idv.DisplayControl |
|---|
getTmpProperty, putTmpProperty, removeTmpProperty |
| Methods inherited from interface ucar.unidata.collab.Sharable |
|---|
getReceiveShareTime, getShareGroup, getSharing, getUniqueId, setReceiveShareTime |
| Field Detail |
|---|
public static final String ATTR_USETIMESINANIMATION
public static final String ATTR_FRONTDISPLAY
public static final String TAG_EDITOR
public static final String ATTR_EDITABLE
public static final String ATTR_TITLE
public static final PatternFileFilter FILTER_XGRF
public static final String SUFFIX_XGRF
public static final String SHARE_LINES
public static final int FLAG_FILLED
public static final int FLAG_FULLLATLON
public static final int FLAG_STRAIGHT
public static final DrawingCommand CMD_SELECT
public static final DrawingCommand CMD_MOVE
public static final DrawingCommand CMD_STRETCH
protected JCheckBox enabledCbx
protected JCheckBox straightCbx
protected List glyphs
protected List selectedGlyphs
protected DrawingCommand currentCmd
| Constructor Detail |
|---|
public DrawingControl()
| Method Detail |
|---|
protected long getControlChangeSleepTime()
getControlChangeSleepTime in class DisplayControlImpl
public String formatDistance(Real distance)
throws VisADException,
RemoteException
distance - The distance
RemoteException - On badness
VisADException - On badnesspublic Unit getDistanceUnit()
public boolean init(DataChoice dataChoice)
throws VisADException,
RemoteException
init in class DisplayControlImpldataChoice - the DataChoice of the moment.
RemoteException - When bad things happen
VisADException - When bad things happenprotected void initDisplayUnit()
protected boolean shouldAddDisplayListener()
shouldAddDisplayListener in class DisplayControlImplprotected void handleWindowClosing()
handleWindowClosing in class DisplayControlImplpublic void close()
close in class DisplayControlImplprotected boolean shouldAddControlListener()
shouldAddControlListener in class DisplayControlImplprotected void timeChanged(Real time)
timeChanged in class DisplayControlImpltime - new time
protected void processData(Data data)
throws VisADException,
RemoteException
data - The data object
RemoteException - When bad things happen
VisADException - When bad things happen
protected void resetData()
throws VisADException,
RemoteException
resetData in class DisplayControlImplRemoteException - On badness
VisADException - On badness
public void toggleVisibilityForVectorGraphicsRendering(int rasterMode)
throws Exception
toggleVisibilityForVectorGraphicsRendering in interface DisplayControltoggleVisibilityForVectorGraphicsRendering in class DisplayControlImplrasterMode - the toggle mode
Exception - problem togglingpublic boolean shouldBeVisible(DrawingGlyph tg)
tg - glyph
public void setDisplayVisibility(boolean on)
setDisplayVisibility in interface DisplayControlsetDisplayVisibility in class DisplayControlImplon - Visible?protected boolean addGlyph(DrawingGlyph glyph)
glyph - The glyph to add
public void glyphChanged(DrawingGlyph glyph)
glyph - The glyph that changed
public void doRemove()
throws VisADException,
RemoteException
doRemove in interface DisplayControldoRemove in class DisplayControlImplRemoteException - When bad things happen
VisADException - When bad things happen
protected void getLegendLabels(List labels,
int legendType)
getLegendLabels in class DisplayControlImpllabels - List of labelslegendType - Side or bottom
protected DrawingGlyph createGlyph(DisplayEvent event,
boolean mousePress)
throws VisADException,
RemoteException
event - The eventmousePress - Is mouse pressed or released
RemoteException - When bad things happen
VisADException - When bad things happenpublic void viewpointChanged()
viewpointChanged in class DisplayControlImplpublic void projectionChanged()
projectionChanged in interface DisplayControlprojectionChanged in class DisplayControlImplprotected boolean canHandleEvents()
public void doFlythrough()
throws VisADException,
RemoteException
RemoteException - Java RMI error
VisADException - VisAD problempublic void handleDisplayChanged(DisplayEvent event)
handleDisplayChanged in class DisplayControlImplevent - The eventprotected void doneMovingGlyph(DrawingGlyph glyph)
glyph - the glyphpublic DrawingGlyph closestGlyph(DisplayEvent event)
event - The event
public DrawingGlyph closestGlyph(DisplayEvent event,
boolean forMove)
event - The eventforMove - Are we looking for a glyph to move
public void removeGlyph(DrawingGlyph glyph)
glyph - The glyph to removeprotected void selectionChanged()
public void setSelection(DrawingGlyph glyph)
throws VisADException,
RemoteException
glyph - Glyph to add to the selection set
RemoteException - When bad things happen
VisADException - When bad things happen
public void setSelection(List newSelection,
boolean addTo)
throws VisADException,
RemoteException
newSelection - New set of glyphsaddTo - If true then don't clear the selection
RemoteException - When bad things happen
VisADException - When bad things happenpublic boolean isSelected(DrawingGlyph glyph)
glyph - The glyph
protected void doCut()
throws VisADException,
RemoteException
RemoteException - When bad things happen
VisADException - When bad things happen
public void doProperties(List glyphs)
throws VisADException,
RemoteException
glyphs - Glyphs to set properties on
RemoteException - When bad things happen
VisADException - When bad things happen
public void receiveShareData(Sharable from,
Object dataId,
Object[] data)
receiveShareData in interface SharablereceiveShareData in class DisplayControlImplfrom - other class.dataId - type of sharingdata - Array of data being shared. In this case, the first
(and only?) object in the array is the levelprotected void setCurrentCommand(DrawingCommand command)
command - The command
protected JPanel makeButtonPanel(List commands,
ButtonGroup bg)
commands - Command to make buttons for.bg - Button group to add buttons to
protected List getShapeCommands()
protected JComponent doMakeShapesPanel()
protected Container doMakeContents()
throws VisADException,
RemoteException
doMakeContents in class DisplayControlImplRemoteException - When bad things happen
VisADException - When bad things happenpublic void zSliderChanged(double value)
zSliderChanged in class DisplayControlImplvalue - the new z slider valueprotected JComponent doMakeControlsPanel()
protected void addControlWidgets(List widgets)
widgets - List to add to. Add in pairs (label, widget)protected double getInitialZPosition()
getInitialZPosition in class DisplayControlImplprotected void makeModePanel(List widgets)
widgets - List ot add label/widget pairsprotected JComponent doMakeTablePanel()
protected JComponent doMakeStylePanel()
protected void checkZSliderEnabled()
protected boolean showFilledCbx()
protected boolean showTimeWidgets()
protected boolean showLocationWidgets()
public ColorTable getRGBColorTable()
public static JComboBox doMakeLineWidthBox(int lineWidth)
lineWidth - The selected width
public int getCoordType()
protected void setCoordType(int c)
c - The coord type to use
protected void getEditMenuItems(List items,
boolean forMenuBar)
getEditMenuItems in class DisplayControlImplitems - List of menu itemsforMenuBar - Is this for the menu in the window's menu bar or
for a popup menu in the legend
protected void getFileMenuItems(List items,
boolean forMenuBar)
getFileMenuItems in class DisplayControlImplitems - Holds the menu itemsforMenuBar - Is it for the main window
protected void addFileMenuItems(List items,
boolean forMenuBar)
items - List to add toforMenuBar - for the menu barpublic void applyColorToAll()
public void applyZPosition(List glyphs)
throws VisADException,
RemoteException
glyphs - the list of glyphs
RemoteException - On badness
VisADException - On badnesspublic void removeAllGlyphs()
public void setLineWidth(int width)
setLineWidth in class DisplayControlImplwidth - width of lines.public int getLineWidth()
getLineWidth in class DisplayControlImpl
public DateTime[] getAllTimes()
throws VisADException,
RemoteException
RemoteException - When bad things happen
VisADException - When bad things happen
public Real getCurrentTime()
throws VisADException,
RemoteException
RemoteException - On Badness
VisADException - On Badness
public Set getAnimationSet()
throws VisADException,
RemoteException
RemoteException - On badness
VisADException - On badness
public Real getTimeForGlyph()
throws VisADException,
RemoteException
RemoteException - On Badness
VisADException - On Badnesspublic String getJustification()
public String getVerticalJustification()
public Font getFont()
public void setLines(UnionSet lines)
lines - set of lines to usepublic void setActive(boolean b)
b - true to enablepublic void setGlyphs(List value)
value - The new value for DrawingGlyphspublic List getGlyphs()
public void setIgnoreTime(boolean value)
value - The new value for IgnoreTimepublic boolean getIgnoreTime()
public void setUseTime(boolean value)
value - The new value for UseTimepublic boolean getUseTime()
public void setEditable(boolean value)
value - The new value for Editablepublic boolean getEditable()
public void setEnabled(boolean value)
value - The new value for Enabledpublic boolean getEnabled()
public void setEditorTitle(String value)
value - The new value for editorTitlepublic String getEditorTitle()
public void setFilled(boolean value)
value - The new value for Filledpublic boolean getFilled()
public void setStraight(boolean value)
value - The new value for Straightpublic boolean getStraight()
public void setFullLatLon(boolean value)
value - The new value for FullLatLonpublic boolean getFullLatLon()
public void evaluateGlyphJython(DrawingGlyph glyph,
String jython)
glyph - The glyphjython - The jythonpublic void setGlyphJython(String value)
value - The new value for GlyphJythonpublic String getGlyphJython()
protected String getGlyphNameDefault(DrawingGlyph glyph)
glyph - the glyph
public void setShowFronts(boolean value)
value - The new value for ShowFrontspublic boolean getShowFronts()
public void setFrontScale(double value)
value - The new value for FrontScalepublic double getFrontScale()
public void setFrontDisplay(boolean value)
value - The new value for FrontDisplaypublic boolean getFrontDisplay()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||