public class IlvJMapScaleControl extends JPanel
JPanel
and contains a JTextField
to display and allow editing of the scale of the map.JLabel
border and font.
Double clicking on the text field (or clicking on the "set" button) makes it enter edit mode and allows the user to enter the scale.1/100,000
for a US locale.
This component is packaged as a Bean and is designed to be used very easily
in a JAVA development environment supporting visual programming with Beans.JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
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 |
---|
IlvJMapScaleControl()
Default constructor.
|
IlvJMapScaleControl(IlvManagerView view)
Creates an
IlvJMapScaleControl attached to a manager view. |
Modifier and Type | Method and Description |
---|---|
boolean |
checkScale(double level)
Checks the level entered by the user.
|
String |
getPrefix()
Returns the prefix.
|
JTextField |
getScaleField()
Returns the scale text Field.
|
NumberFormat |
getScaleFormat()
Returns the scale format.
|
JButton |
getSetButton()
Returns the "set" Button.
|
String |
getSuffix()
Returns the suffix.
|
IlvManagerView |
getView()
Returns the view.
|
boolean |
isAllowScaleEdition()
Indicates if double-clicking on the scale for editing is allowed.
|
boolean |
isEditable()
Indicates whether or not this
IlvJMapScaleControl is editable. |
void |
setAllowScaleEdition(boolean allowScaleEdition)
Determines whether or not the user is allowed to change the view scale with this bean.
|
void |
setEditable(boolean editable)
Sets whether or not this
IlvJMapScaleControl should be editable. |
void |
setPrefix(String prefix)
Sets the prefix displayed before the actual scale value.
|
void |
setScaleFormat(NumberFormat scaleFormat)
Defines the format to display the numerical scale value.
|
void |
setSuffix(String suffix)
Sets the suffix displayed after the formatted numerical scale value.
|
void |
setView(IlvManagerView view)
When setting the view, a listener will be added on the transformer of the view.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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
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, 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, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public IlvJMapScaleControl()
public IlvJMapScaleControl(IlvManagerView view)
IlvJMapScaleControl
attached to a manager view.view
- The manager View that the bean controls.public IlvManagerView getView()
public JTextField getScaleField()
public JButton getSetButton()
public void setView(IlvManagerView view)
view
- The manager View that the bean controls.public void setEditable(boolean editable)
IlvJMapScaleControl
should be editable.editable
- true
to set the control to its editable mode.public boolean isEditable()
IlvJMapScaleControl
is editable.public String getPrefix()
public void setPrefix(String prefix)
prefix
- The prefix to set or null
.public NumberFormat getScaleFormat()
public void setScaleFormat(NumberFormat scaleFormat)
DecimalFormat
with a 3 digit grouping.scaleFormat
- The scale format to set.public String getSuffix()
public void setSuffix(String suffix)
null
.suffix
- The suffix to set or null
.public boolean checkScale(double level)
false
, the (user entered) scale change would not be applied to the view.
Default implementation always returns true
.level
- New scale level to use for the map.true
.public boolean isAllowScaleEdition()
true
if double-clicking is allowed.public void setAllowScaleEdition(boolean allowScaleEdition)
allowScaleEdition
to false
will also set editable to false
, and reset the value displayed to the current view scale.allowScaleEdition
- true
to allow scale editing.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.