|
||||||||||
| 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
javax.swing.JPanel
ilog.views.maps.beans.IlvJMapScaleControl
public class IlvJMapScaleControl
This class extends a JPanel and contains a JTextField to display and allow editing of the scale of the map.
By default, this text field is displayed using a 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.
The scale is displayed using a prefix, a formatted number and a suffix. For example, by default, this bean will display something like 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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| 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 |
|---|
| 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 | |
|---|---|
IlvJMapScaleControl()
Default constructor. |
|
IlvJMapScaleControl(IlvManagerView view)
Creates an IlvJMapScaleControl attached to a manager view. |
|
| Method Summary | |
|---|---|
boolean |
checkScale(double level)
Checks the level entered by the user. |
String |
getPrefix()
Returns the prefix. |
JTextField |
getScaleField()
Returns the scale text Field. |
DecimalFormat |
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 the specified boolean to indicate whether or not this IlvJMapScaleControl should be editable. |
void |
setPrefix(String prefix)
Sets the prefix displayed before the actual scale value. |
void |
setScaleFormat(DecimalFormat scaleFormat)
Defines the format to display the numerical scale value. |
void |
setSuffix(String suffix)
Sets the prefix 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. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IlvJMapScaleControl()
public IlvJMapScaleControl(IlvManagerView view)
IlvJMapScaleControl attached to a manager view.
view - The manager View that the bean controls.| Method Detail |
|---|
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 DecimalFormat getScaleFormat()
public void setScaleFormat(DecimalFormat 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.
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||