|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
ilog.views.maps.beans.IlvJCompass
public class IlvJCompass
This class defines a swing component representing a compass. The needles can indicate:
IlvManagerView.
The geographic north is defined as the tangent to
a meridian line passing at the center of the manager view
that controls the compass Bean.
IlvManagerView view.
The cartographic north is defined as
the vertical when the map is displayed without rotation.
This component is packaged as a Java Bean and is designed to be used very easily in a JAVA development environment supporting visual programming with Beans.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
NEEDLE_STYLE_COMPASS
The type for bicolored diamond needles. |
static int |
NEEDLE_STYLE_COMPASS_ROSE
The type for compass-rose style. |
static int |
NEEDLE_STYLE_CROSS
The type for cross-style needles. |
static int |
NEEDLE_STYLE_SIMPLE
The type for simple arrow needles. |
| Fields inherited from class javax.swing.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 java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
IlvJCompass()
Creates an IlvCompass object. |
|
| Method Summary | |
|---|---|
protected void |
drawCartographicNorth(Graphics g)
Draws the elements of the compass that represent the cartographic north. |
protected void |
drawDecorations(Graphics g)
Draws the background of the compass. |
protected void |
drawGeographicNorth(Graphics g)
Draws the elements to represent the geographic north. |
protected void |
drawNeedle(int style,
double angle,
Color foreground,
Color background,
int xPosition,
int yPosition,
Graphics g)
Draws a needle at the specified angle. |
Color |
getCartographicBackground()
Returns the background color used to draw the needle that shows the direction of the cartographic north. |
Color |
getCartographicForeground()
Returns the foreground color used to draw the needle representing the cartographic north. |
int |
getCartographicNeedleStyle()
Returns the style used to draw the needle representing the cartographic north. |
double |
getCartographicNorth()
Returns the current cartographic north. |
Color |
getDecorationBackground()
Returns the background color used to draw the compass. |
Color |
getDecorationForeground()
Returns the foreground color used to draw the compass. |
Color |
getGeographicBackground()
Returns the background color used to draw the geographic needles. |
Color |
getGeographicForeground()
Returns the foreground color used to draw the geographic needles. |
int |
getGeographicNeedleStyle()
Returns the style used to draw the needle representing the geographic north. |
double |
getGeographicNorth()
Returns the current geographic north. |
Dimension |
getMinimumSize()
Returns the minimum size of the component. |
Dimension |
getPreferredSize()
Returns the preferred size of the component. |
IlvManagerView |
getView()
Returns the view for which the compass displays the north direction. |
void |
paint(Graphics g)
Redraws the compass. |
void |
setCartographicBackground(Color color)
Sets the background color for drawing cartographic needles. |
void |
setCartographicForeground(Color color)
Sets the foreground color used to draw the needle representing the cartographic north. |
void |
setCartographicNeedleStyle(int style)
Sets the style used to draw the needle representing the cartographic north. |
void |
setDecorationBackground(Color color)
Sets the background color used to draw the compass. |
void |
setDecorationForeground(Color color)
Sets the foreground color used to draw the compass. |
void |
setGeographicBackground(Color color)
Sets the background color used to draw the geographic needles. |
void |
setGeographicForeground(Color color)
Sets the foreground color used to draw the geographic north. |
void |
setGeographicNeedleStyle(int style)
Sets the style used to draw the needle representing the geographic north. |
void |
setView(IlvManagerView view)
Sets the IlvManagerView for which the compass will display
the north direction. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NEEDLE_STYLE_SIMPLE
IlvCompass.setCartographicNeedleStyle(int),
IlvCompass.setGeographicNeedleStyle(int),
Constant Field Valuespublic static final int NEEDLE_STYLE_COMPASS
IlvCompass.setCartographicNeedleStyle(int),
IlvCompass.setGeographicNeedleStyle(int),
Constant Field Valuespublic static final int NEEDLE_STYLE_CROSS
IlvCompass.setCartographicNeedleStyle(int),
IlvCompass.setGeographicNeedleStyle(int),
Constant Field Valuespublic static final int NEEDLE_STYLE_COMPASS_ROSE
IlvCompass.setCartographicNeedleStyle(int),
IlvCompass.setGeographicNeedleStyle(int),
Constant Field Values| Constructor Detail |
|---|
public IlvJCompass()
IlvCompass object. The created instance is not active until it is
associated with an IlvManagerView view.
IlvCompass.setView(ilog.views.IlvManagerView)| Method Detail |
|---|
public final void setView(IlvManagerView view)
IlvManagerView for which the compass will display
the north direction. To show the direction of the geographic north
in the manager view, the compass must know the projection used to display the
map. If the manager of the view has an IlvProjectionProperty, the
compass will use the property's projection, otherwise, it will assume that the
geographic north is in the same direction as the cartographic north.
view - The view. A null value can be used to deactivate the compass.IlvProjectionPropertypublic final IlvManagerView getView()
null if there is none.public void paint(Graphics g)
Redraw is performed by calling the following methods:
paint in class JComponentprotected void drawDecorations(Graphics g)
protected void drawCartographicNorth(Graphics g)
protected void drawGeographicNorth(Graphics g)
protected void drawNeedle(int style,
double angle,
Color foreground,
Color background,
int xPosition,
int yPosition,
Graphics g)
style - The needle style.angle - Orientation in radians.foreground - Foreground color of needle.background - Background color of needle.xPosition - Center position of needle.yPosition - Center position of needle.g - The graphics for drawing.public Dimension getMinimumSize()
getMinimumSize in class JComponentpublic Dimension getPreferredSize()
getPreferredSize in class JComponentpublic double getCartographicNorth()
public double getGeographicNorth()
public void setDecorationForeground(Color color)
public Color getDecorationForeground()
public void setDecorationBackground(Color color)
public Color getDecorationBackground()
public void setCartographicForeground(Color color)
public Color getCartographicForeground()
public void setCartographicBackground(Color color)
public Color getCartographicBackground()
public void setGeographicForeground(Color color)
public Color getGeographicForeground()
public void setGeographicBackground(Color color)
public Color getGeographicBackground()
public final void setCartographicNeedleStyle(int style)
IlvCompass.NEEDLE_STYLE_SIMPLE,
IlvCompass.NEEDLE_STYLE_COMPASS,
IlvCompass.NEEDLE_STYLE_CROSS,
IlvCompass.NEEDLE_STYLE_COMPASS_ROSEpublic final int getCartographicNeedleStyle()
IlvCompass.NEEDLE_STYLE_SIMPLE,
IlvCompass.NEEDLE_STYLE_COMPASS,
IlvCompass.NEEDLE_STYLE_CROSS,
IlvCompass.NEEDLE_STYLE_COMPASS_ROSEpublic final void setGeographicNeedleStyle(int style)
IlvCompass.NEEDLE_STYLE_SIMPLE,
IlvCompass.NEEDLE_STYLE_COMPASS,
IlvCompass.NEEDLE_STYLE_CROSS,
IlvCompass.NEEDLE_STYLE_COMPASS_ROSEpublic final int getGeographicNeedleStyle()
IlvCompass.NEEDLE_STYLE_SIMPLE,
IlvCompass.NEEDLE_STYLE_COMPASS,
IlvCompass.NEEDLE_STYLE_CROSS,
IlvCompass.NEEDLE_STYLE_COMPASS_ROSE
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||