public class TLcdAzimuthRangeController extends ALcdGXYSmartController implements MouseListener, MouseMotionListener
ILcdGXYController
interprets mouse events for displaying an
azimuth direction and an azimuth range. The azimuth direction is based on the initial azimuth of the geodesic line segment between two points on the screen. The length of the line segment determines the wideness of the azimuth range. The longer the line segment the smaller the azimuth range. Below a certain threshold (in pixels) the range is 360 degrees. Above a certain threshold (in pixels) the range is 0 degrees.
On each mouse release a PropertyChangeEvent
occurs. This event
object contains null values. One should call the methods getStartAzimuth()
and getAzimuthRange()
of the controller in order to get the
azimuth interval.
An event is thrown on each mouse drag if isEventOnMouseDrag
returns true.
Using this ILcdGXYController
method makes sense only when the
ILcdGXYView
it interacts with has a ILcdXYWorldReference
that is an instance of ILcdGridReference
.
Constructor and Description |
---|
TLcdAzimuthRangeController()
Creates a new TLcdAzimuthRangeController.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
Adds a feature to the PropertyChangeListener attribute of the
TLcdAzimuthRangeController object.
|
ILcdGraphicsSetup |
getArcLineStyle()
Gets the ArcLineStyle attribute of the TLcdAzimuthRangeController object.
|
double |
getAzimuthRange()
Gets the AzimuthRange attribute of the TLcdAzimuthRangeController object.
|
ILcdGraphicsSetup |
getCenterAzimuthLineStyle()
Gets the CenterAzimuthLineStyle attribute of the TLcdAzimuthRangeController
object.
|
ILcdGraphicsSetup |
getFillStyle()
Gets the FillStyle attribute of the TLcdAzimuthRangeController object.
|
Color |
getLabelBackgroundColor()
Gets the LabelBackgroundColor attribute of the TLcdAzimuthRangeController
object.
|
Color |
getLabelColor()
Gets the LabelColor attribute of the TLcdAzimuthRangeController object.
|
Font |
getLabelFont()
Gets the LabelFont attribute of the TLcdAzimuthRangeController object.
|
ILcdGraphicsSetup |
getOuterAzimuthLineStyle()
Gets the OuterAzimuthLineStyle attribute of the TLcdAzimuthRangeController
object.
|
int |
getPixelLengthForArcRadius()
Gets the PixelLengthForArcRadius attribute of the
TLcdAzimuthRangeController object.
|
int |
getPixelLengthForCompleteCircle()
Gets the PixelLengthForCompleteCircle attribute of the
TLcdAzimuthRangeController object.
|
int |
getPixelLengthForZeroAngle()
Gets the PixelLengthForZeroAngle attribute of the
TLcdAzimuthRangeController object.
|
double |
getStartAzimuth()
Gets the StartAzimuth attribute of the TLcdAzimuthRangeController object.
|
boolean |
isEventOnMouseDrag()
Gets the EventOnMouseDrag attribute of the TLcdAzimuthRangeController
object.
|
boolean |
isFilled()
Gets the Filled attribute of the TLcdAzimuthRangeController object.
|
boolean |
isLabeled()
Returns whether the current start azimuth and the range should be displayed
as a label.
|
boolean |
isLabelFilled()
Gets the LabelFilled attribute of the TLcdAzimuthRangeController object.
|
boolean |
isLabelFrame()
Gets the LabelFrame attribute of the TLcdAzimuthRangeController object.
|
boolean |
isStartFromCenter()
Gets the StartFromCenter attribute of the TLcdAzimuthRangeController
object.
|
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
mouseClicked(MouseEvent e) |
void |
mouseDragged(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e)
Will perform a pan depending on the values of isDragging,
isPanOnMouseDragExit and isPanOnMouseMoveExit properties
|
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
paint(Graphics aGraphics)
Enables the controller to give visual feedback on the current user interactions.
|
void |
removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
Removes the given PropertyChangeListener aPropertyChangeListener as listener.
|
void |
setArcLineStyle(ILcdGraphicsSetup aArcLineStyle)
Sets the ArcLineStyle attribute of the TLcdAzimuthRangeController object.
|
void |
setCenterAzimuthLineStyle(ILcdGraphicsSetup aCenterAzimuthLineStyle)
Sets the CenterAzimuthLineStyle attribute of the TLcdAzimuthRangeController
object.
|
void |
setEventOnMouseDrag(boolean aEventOnMouseDrag)
Sets the EventOnMouseDrag attribute of the TLcdAzimuthRangeController
object.
|
void |
setFilled(boolean aFilled)
Sets the Filled attribute of the TLcdAzimuthRangeController object.
|
void |
setFillStyle(ILcdGraphicsSetup aFillStyle)
Sets the FillStyle attribute of the TLcdAzimuthRangeController object.
|
void |
setLabelBackgroundColor(Color aLabelBackgroundColor)
Sets the LabelBackgroundColor attribute of the TLcdAzimuthRangeController
object.
|
void |
setLabelColor(Color aLabelColor)
Sets the LabelColor attribute of the TLcdAzimuthRangeController object.
|
void |
setLabeled(boolean aLabeled)
Sets the Labeled attribute of the TLcdAzimuthRangeController object.
|
void |
setLabelFilled(boolean aLabelFilled)
Sets the LabelFilled attribute of the TLcdAzimuthRangeController object.
|
void |
setLabelFont(Font aLabelFont)
Sets the LabelFont attribute of the TLcdAzimuthRangeController object.
|
void |
setLabelFrame(boolean aLabelFrame)
Sets the LabelFrame attribute of the TLcdAzimuthRangeController object.
|
void |
setOuterAzimuthLineStyle(ILcdGraphicsSetup aOuterAzimuthLineStyle)
Sets the OuterAzimuthLineStyle attribute of the TLcdAzimuthRangeController
object.
|
void |
setPixelLengthForArcRadius(int aPixelLengthForArcRadius)
Sets the PixelLengthForArcRadius attribute of the
TLcdAzimuthRangeController object.
|
void |
setPixelLengthForCompleteCircle(int aPixelLengthCompleteCircle)
Sets the PixelLengthForCompleteCircle attribute of the
TLcdAzimuthRangeController object.
|
void |
setPixelLengthForZeroAngle(int aPixelLengthForZeroAngle)
Sets the PixelLengthForZeroAngle attribute of the
TLcdAzimuthRangeController object.
|
void |
setStartFromCenter(boolean aStartFromCenter)
Sets the StartFromCenter attribute of the TLcdAzimuthRangeController
object.
|
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
protected void |
setupGraphicsForArcLineStyle(Graphics aGraphics)
Sets the line style to use for drawing the arc.
|
protected void |
setupGraphicsForCenterAzimuthLineStyle(Graphics aGraphics)
Sets the line style to use for drawing the center azimuth lines.
|
protected void |
setupGraphicsForFillStyle(Graphics aGraphics)
Sets the fill style to use for filling the arc segment.
|
protected void |
setupGraphicsForOuterAzimuthLineStyle(Graphics aGraphics)
Sets the line style to use for drawing the outer azimuth lines.
|
void |
startInteraction(ILcdGXYView aGXYView)
Sets up the controller to receive input through the view passed.
|
void |
terminateInteraction(ILcdGXYView aGXYView)
Releases a few items.
|
addUndoableListener, doPanGXYView, doZoomGXYView, fireUndoableEvent, getDownPanChars, getDownPanCodes, getLeftPanChars, getLeftPanCodes, getPanAbsDelta, getPanAbsDelta, getRightPanChars, getRightPanCodes, getUndoableListenerCount, getUpPanChars, getUpPanCodes, getZoomInChars, getZoomInCodes, getZoomOutChars, getZoomOutCodes, isDragging, isPanOnMouseDragExit, isPanOnMouseMoveExit, isPanUndoable, isRequestFocusOnMouseEntered, isRequestFocusOnMousePressed, isZoomUndoable, keyPressed, keyReleased, keyTyped, removeUndoableListener, setDownPanChars, setDownPanCodes, setIsDragging, setLeftPanChars, setLeftPanCodes, setPanAbsDelta, setPanOnMouseDragExit, setPanOnMouseMoveExit, setPanUndoable, setRequestFocusOnMouseEntered, setRequestFocusOnMousePressed, setRightPanChars, setRightPanCodes, setUpPanChars, setUpPanCodes, setZoomInChars, setZoomInCodes, setZoomOutChars, setZoomOutCodes, setZoomUndoable, updateViewLocationAfterZoomSFCT
addStatusListener, asGXYController, fireStatusEvent, getCursor, getGXYView, getIcon, getName, getShortDescription, registerInstance, removeStatusListener, retrieveGXYViewXYWorldTransformation, setClassTraceOn, setCursor, setGXYView, setIcon, setName, setShortDescription, viewRepaint
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLayered
public TLcdAzimuthRangeController()
public void setTraceOn(boolean aTraceOn)
true
or false
as argument automatically turns
off tracing for all other class instances for which
setTraceOn
has not been called.
If the argument is false
then only the informative, warning
and error log messages are recorded.setTraceOn
in class ALcdGXYSmartController
aTraceOn
- if true then all log messages are recorded for this
instance. If false, then only the informative, warning and
error log messages are recorded.public boolean isTraceOn()
true
if tracing is enabled for this class.isTraceOn
in class ALcdGXYSmartController
public void setStartFromCenter(boolean aStartFromCenter)
aStartFromCenter
- the new StartFromCenter value.isStartFromCenter()
public void setEventOnMouseDrag(boolean aEventOnMouseDrag)
aEventOnMouseDrag
- the new EventOnMouseDrag value.isEventOnMouseDrag()
public void setPixelLengthForZeroAngle(int aPixelLengthForZeroAngle)
aPixelLengthForZeroAngle
- the new PixelLengthForZeroAngle value.getPixelLengthForZeroAngle()
public void setPixelLengthForCompleteCircle(int aPixelLengthCompleteCircle)
aPixelLengthCompleteCircle
- the new PixelLengthForCompleteCircle value.getPixelLengthForCompleteCircle()
public void setPixelLengthForArcRadius(int aPixelLengthForArcRadius)
aPixelLengthForArcRadius
- the new PixelLengthForArcRadius value.getPixelLengthForArcRadius()
public void setCenterAzimuthLineStyle(ILcdGraphicsSetup aCenterAzimuthLineStyle)
aCenterAzimuthLineStyle
- the new CenterAzimuthLineStyle value.getCenterAzimuthLineStyle()
public void setOuterAzimuthLineStyle(ILcdGraphicsSetup aOuterAzimuthLineStyle)
aOuterAzimuthLineStyle
- the new OuterAzimuthLineStyle value.getOuterAzimuthLineStyle()
public void setArcLineStyle(ILcdGraphicsSetup aArcLineStyle)
aArcLineStyle
- the new ArcLineStyle value.getArcLineStyle()
public void setFillStyle(ILcdGraphicsSetup aFillStyle)
aFillStyle
- the new FillStyle value.getFillStyle()
public void setFilled(boolean aFilled)
aFilled
- the new Filled value.isFilled()
public void setLabeled(boolean aLabeled)
aLabeled
- the new Labeled value.isLabeled()
public void setLabelFont(Font aLabelFont)
aLabelFont
- the new LabelFont value.getLabelFont()
public void setLabelColor(Color aLabelColor)
aLabelColor
- the new LabelColor value.getLabelColor()
public void setLabelBackgroundColor(Color aLabelBackgroundColor)
aLabelBackgroundColor
- the new LabelBackgroundColor value.getLabelBackgroundColor()
public void setLabelFrame(boolean aLabelFrame)
aLabelFrame
- the new LabelFrame value.isLabelFrame()
public void setLabelFilled(boolean aLabelFilled)
aLabelFilled
- the new LabelFilled value.isLabelFilled()
public double getStartAzimuth()
public double getAzimuthRange()
public boolean isStartFromCenter()
ILcdGXYView
.setStartFromCenter(boolean)
public boolean isEventOnMouseDrag()
setEventOnMouseDrag(boolean)
public int getPixelLengthForZeroAngle()
aPixelLengthForZeroAngle
pixels from each other, the azimuth
range will be 0 .setPixelLengthForZeroAngle(int)
public int getPixelLengthForCompleteCircle()
aPixelLengthForCompleteCircle
pixels from each other, the
azimuth range will be 360 degrees.setPixelLengthForCompleteCircle(int)
public int getPixelLengthForArcRadius()
aPixelLengthForArcRadius
pixels.setPixelLengthForArcRadius(int)
public ILcdGraphicsSetup getCenterAzimuthLineStyle()
setCenterAzimuthLineStyle(com.luciad.gui.ILcdGraphicsSetup)
public ILcdGraphicsSetup getOuterAzimuthLineStyle()
setOuterAzimuthLineStyle(com.luciad.gui.ILcdGraphicsSetup)
public ILcdGraphicsSetup getArcLineStyle()
setArcLineStyle(com.luciad.gui.ILcdGraphicsSetup)
public ILcdGraphicsSetup getFillStyle()
setFillStyle(com.luciad.gui.ILcdGraphicsSetup)
public boolean isFilled()
setFilled(boolean)
public boolean isLabeled()
setLabeled(boolean)
public Font getLabelFont()
setLabelFont(java.awt.Font)
public Color getLabelColor()
setLabelColor(java.awt.Color)
public Color getLabelBackgroundColor()
setLabelBackgroundColor(java.awt.Color)
public boolean isLabelFrame()
setLabelFrame(boolean)
public boolean isLabelFilled()
setLabelFilled(boolean)
public void addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
aPropertyChangeListener
- The feature to be added to the
PropertyChangeListener attribute.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
aPropertyChangeListener
- the PropertyChangeListener to be removed as listener.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void startInteraction(ILcdGXYView aGXYView)
ALcdGXYController
All ILcdGXYView
implementations that support interaction call this method when the controller
has been made active with setGXYController
on the view,
so this method shouldn't normally be called directly.
Note that most view implementations add the controller as listener if appropriate before calling
this method.
Sets the cursor on the view and sets the view for which this controller is now active.
Sends out a status event based on the short description
.
startInteraction
in interface ILcdGXYController
startInteraction
in class ALcdGXYSmartController
aGXYView
- the ILcdGXYView
this ILcdGXYController
will interact with.ILcdGXYView.setGXYController(com.luciad.view.gxy.ILcdGXYController)
,
ILcdGXYController.terminateInteraction(com.luciad.view.gxy.ILcdGXYView)
public void terminateInteraction(ILcdGXYView aGXYView)
ALcdGXYController
terminateInteraction
in interface ILcdGXYController
terminateInteraction
in class ALcdGXYSmartController
aGXYView
- the ILcdGXYView
this ILcdGXYController
interacted with.ILcdGXYView.setGXYController(com.luciad.view.gxy.ILcdGXYController)
,
ILcdGXYController.startInteraction(com.luciad.view.gxy.ILcdGXYView)
public void paint(Graphics aGraphics)
ALcdGXYController
Empty implementation. Redefine this method to render on the Graphics on which the view is rendered.
paint
in interface ILcdGXYController
paint
in class ALcdGXYController
aGraphics
- the Graphics on which the view was rendered.public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
mouseClicked
in class ALcdGXYSmartController
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
mousePressed
in class ALcdGXYSmartController
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
mouseReleased
in class ALcdGXYSmartController
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
mouseEntered
in class ALcdGXYSmartController
public void mouseExited(MouseEvent e)
ALcdGXYSmartController
mouseExited
in interface MouseListener
mouseExited
in class ALcdGXYSmartController
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class ALcdGXYSmartController
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
mouseMoved
in class ALcdGXYSmartController
protected void setupGraphicsForFillStyle(Graphics aGraphics)
aGraphics
- the graphics on which to apply the style.protected void setupGraphicsForCenterAzimuthLineStyle(Graphics aGraphics)
aGraphics
- the graphics on which to apply the style.protected void setupGraphicsForOuterAzimuthLineStyle(Graphics aGraphics)
aGraphics
- the graphics on which to apply the style.protected void setupGraphicsForArcLineStyle(Graphics aGraphics)
aGraphics
- the graphics on which to apply the style.