public class IlvJScaleBar extends JComponent
IlvManagerView
.
This component works only if the manager of the target view has an
IlvCoordinateSystemProperty
or an
IlvProjectionProperty
(for backward compatibility with JViews
versions previous to 5.0).
IlvProjectionProperty
,
IlvCoordinateSystemProperty
,
Serialized FormJComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static int |
DASH_SCALE_EVEN
Displays alternate color filled rectangles, starting with a foreground colored rectangle.
|
static int |
DASH_SCALE_ODD
Displays graduations with filled rectangles, starting with an alternate colored rectangle.
|
static int |
DOUBLE_DASH_SCALE_EVEN
Displays alternate filled and non filled rectangles.
|
static int |
DOUBLE_DASH_SCALE_ODD
Displays two lines of filled and non filled rectangles, starting with an alternate color filled rectangle.
|
static int |
DOUBLE_SCALE_EMPTY
Displays two lines of empty rectangles.
|
static int |
SCALE_EMPTY
Displays graduations with empty rectangles.
|
static int |
SIMPLE_SCALE_BOTTOM
Displays graduations on a bottom line.
|
static int |
SIMPLE_SCALE_CENTER
Displays graduations on a centered line.
|
static int |
THREE_LABELS
Three labels are drawn on the top of the scale bar.
|
static int |
UNIQUE_LABEL
A unique label is drawn on the top of the scale bar.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IlvJScaleBar()
Creates a new instance of
IlvScaleBar . |
Modifier and Type | Method and Description |
---|---|
Color |
getAlternateScaleColor()
Gets the alternate scale color.
|
double |
getFarLimit()
Returns the switch limit between a text display of the scale in a small unit
(for instance, meters) and a text display in a large unit (for instance, kilometers).
|
IlvLinearUnit |
getFarUnit()
Returns the unit used to display the
length of the scale bar for small scales.
|
IlvGraphic |
getGraphic()
Returns the
IlvGraphic that represents the scale part of the IlvScaleBar . |
int |
getMarginHeight()
Returns the vertical margin that must be left between the scale
bar and the border of the component.
|
int |
getMarginWidth()
Returns the minimum margin that must be left between the scale
bar and the border of the component.
|
Dimension |
getMinimumSize()
Returns the minimum size of the component.
|
IlvLinearUnit |
getNearUnit()
Returns the unit used to display the
length of the scale bar for large scales.
|
Dimension |
getPreferredSize()
Returns the preferred size of the component.
|
IlvMapScaleComputation |
getScaleComputation()
Returns the instance that computes the current map scale.
|
int |
getScaleHeight()
Returns the height of the scale bar.
|
int |
getScaleStyle()
Returns the style used to draw the scale bar.
|
int |
getScaleTextMode()
Returns the text mode.
|
int |
getTextSpacing()
Returns the text spacing.
|
IlvManagerView |
getView()
Returns the view whose scale is displayed.
|
void |
paint(Graphics g)
Draws the component.
|
void |
setAlternateScaleColor(Color color)
Sets the alternate scale color.
|
void |
setBounds(int x,
int y,
int width,
int height)
Sets the bounds for this component and
updates the scale bar when component is resized.
|
void |
setFarLimit(double limit)
Sets the switch limit between a text display of the scale in a small unit
(for instance, meters) and a text display in a large unit (for instance, kilometers).
|
void |
setFarUnit(IlvLinearUnit unit)
Sets the unit used to display the
length of the scale bar for small scales.
|
void |
setGraphic(IlvGraphic graphic)
Sets the
IlvGraphic that represents the scale part of the IlvScaleBar . |
void |
setMarginHeight(int margin)
Specifies the vertical margin that must be left between the scale
bar and the border of the component.
|
void |
setMarginWidth(int margin)
Specifies the minimum horizontal margin that must be left between the scale
bar and the border of the component.
|
void |
setNearUnit(IlvLinearUnit unit)
Sets the unit used to display the
length of the scale bar for large scales.
|
void |
setScaleComputation(IlvMapScaleComputation scaleComputation)
Allows changing the way scale computation is done.
|
void |
setScaleHeight(int scaleHeight)
Sets the height of the scale bar.
|
void |
setScaleStyle(int style)
Sets the style used to draw the scale bar.
|
void |
setScaleTextMode(int mode)
Sets the label displaying mode.
|
void |
setSize(int width,
int height)
Sets the size for this component.
|
void |
setTextSpacing(int spacing)
Specifies the text spacing.
|
void |
setView(IlvManagerView view)
Specifies the view that controls this component.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int SIMPLE_SCALE_CENTER
public static final int DASH_SCALE_EVEN
public static final int DOUBLE_DASH_SCALE_EVEN
public static final int DASH_SCALE_ODD
public static final int DOUBLE_DASH_SCALE_ODD
public static final int SIMPLE_SCALE_BOTTOM
public static final int SCALE_EMPTY
public static final int DOUBLE_SCALE_EMPTY
public static final int UNIQUE_LABEL
public static final int THREE_LABELS
public IlvJScaleBar()
IlvScaleBar
. The scale bar is not
active until an IlvManagerView
is set. The manager of the view should have an
IlvCoordinateSystemProperty
.public void setView(IlvManagerView view)
view
- The view.public IlvManagerView getView()
null
if the bean has no
attached view.public void setScaleStyle(int style)
style
- The scale style.IlvScaleBar.SIMPLE_SCALE_CENTER
,
IlvScaleBar.DASH_SCALE_EVEN
,
IlvScaleBar.DOUBLE_DASH_SCALE_EVEN
,
IlvScaleBar.DASH_SCALE_ODD
,
IlvScaleBar.DOUBLE_DASH_SCALE_ODD
,
IlvScaleBar.SIMPLE_SCALE_BOTTOM
,
IlvScaleBar.SCALE_EMPTY
,
IlvScaleBar.DOUBLE_SCALE_EMPTY
public int getScaleStyle()
public void setScaleTextMode(int mode)
mode
- The text displaying mode.IlvScaleBar.UNIQUE_LABEL
,
IlvScaleBar.THREE_LABELS
public int getScaleTextMode()
public void setMarginWidth(int margin)
0
.
The default value is 2 pixels.margin
- The margin width.public int getMarginWidth()
public void setMarginHeight(int margin)
0
.
The default value is 4 pixels.margin
- The margin height.public int getMarginHeight()
public void setTextSpacing(int spacing)
spacing
- The text spacing.public int getTextSpacing()
public void setScaleHeight(int scaleHeight)
1
.scaleHeight
- The height.public int getScaleHeight()
public void setAlternateScaleColor(Color color)
color
- The color.public Color getAlternateScaleColor()
public void setFarLimit(double limit)
limit
- The upper limit.IlvScaleBar.setNearUnit(ilog.views.maps.IlvLinearUnit)
,
IlvScaleBar.setFarUnit(ilog.views.maps.IlvLinearUnit)
public double getFarLimit()
public void setNearUnit(IlvLinearUnit unit)
unit
- The near unit converter.IlvScaleBar.setFarLimit(double)
,
getNearUnit()
public IlvLinearUnit getNearUnit()
null
if there is no unit.public void setFarUnit(IlvLinearUnit unit)
unit
- The far unit.IlvScaleBar.setFarLimit(double)
,
getFarUnit()
public IlvLinearUnit getFarUnit()
null
if there is no unit.public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public Dimension getMinimumSize()
getMinimumSize
in class JComponent
public void setGraphic(IlvGraphic graphic)
IlvGraphic
that represents the scale part of the IlvScaleBar
.
If an IlvGraphic
is set, then the predefined scales drawings are not used.graphic
- The IlvGraphic
that represents the scale part of the IlvScaleBar
.public IlvGraphic getGraphic()
IlvGraphic
that represents the scale part of the IlvScaleBar
.setGraphic(ilog.views.IlvGraphic)
public void paint(Graphics g)
paint
in class JComponent
public void setSize(int width, int height)
public void setBounds(int x, int y, int width, int height)
public IlvMapScaleComputation getScaleComputation()
public void setScaleComputation(IlvMapScaleComputation scaleComputation)
scaleComputation
- the scale computation instance to use.IlvMapScaleComputation
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.