Class DialogTools
java.lang.Object
org.openjump.core.apitools.ToolToMakeYourLifeEasier
org.openjump.core.ui.swing.DialogTools
- Since:
- 1.2: changed by Stefan Ostermann at 2005-04-26: added method to return localized
string of a double value.,
1.3 changed by Carsten Schulze at 2005-05-22: added a method to center a given AWT-Window (or subclasses) on the screen. - Version:
- $Rev: 1245 $
- Author:
- Ole Rahn, Stefan Ostermann, Carsten Schulze
FH Osnabrück - University of Applied Sciences Osnabrück
Project PIROL 2005
Daten- und Wissensmanagement
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcenterOnScreen(Window window) This method centers the window (or subclasses of it) on the screen.static voidcenterOnWindow(Component component) static voidcenterOnWindow(Component component2move, Component component2CenterOn) static JPanelgetPanelWithLabels(String text, int charsPerLine) This method creates a JPanel with several JLabels on it.static doubleThis method replaces the localized decimal seperator with a dot.static StringThis method replaces the dot with the localized decimal seperator.static StringnumberToLocalNumberString(double number) This method replaces the dot with the localized decimal seperator.static voidsetMaximumHeight(JComponent component, int height) static voidsetMaximumWidth(JComponent component, int width) static voidsetPreferedHeight(JComponent component, int height) Sets the prefered height of an JComponent and keeps it prefered height.static voidsetPreferedWidth(JComponent component, int width) Sets the prefered width of an JComponent and keeps it prefered height.
-
Constructor Details
-
DialogTools
public DialogTools()
-
-
Method Details
-
centerOnScreen
This method centers the window (or subclasses of it) on the screen.- Parameters:
window- the java.awt.Window (or a subclass of it) that should be displayed in the middle of the screen.
-
centerOnWindow
-
centerOnWindow
-
getPanelWithLabels
This method creates a JPanel with several JLabels on it. For another method to display multiline bold text, have a look at the {javax.swing.JTextArea} and theFontobject.- Parameters:
text- the text to split up into some JLabels.charsPerLine- the maximum number of characters per line text.- Returns:
- the panel with the labels on it.
-
localNumberStringToDouble
This method replaces the localized decimal seperator with a dot.- Parameters:
s- the String containing the double value.- Returns:
- the now dotted double value.
- See Also:
-
numberStringToLocalNumberString
-
numberToLocalNumberString
This method replaces the dot with the localized decimal seperator.- Parameters:
number- the double value.- Returns:
- the localized String containing the double value.
- See Also:
-
setPreferedWidth
Sets the prefered width of an JComponent and keeps it prefered height.- Parameters:
component- the component to alterwidth- the new prefered width
-
setPreferedHeight
Sets the prefered height of an JComponent and keeps it prefered height.- Parameters:
component- the component to alterheight- the new prefered width
-
setMaximumWidth
-
setMaximumHeight
-