|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jaxfront.swing.ui.tools.GUITools
public class GUITools
This class provides methodes which helps to draw or create some gui component
Field Summary | |
---|---|
static javax.swing.ImageIcon |
EMPTY_ICON
|
static byte[] |
NULL_IMAGE_DEF
|
static java.util.Random |
random
|
Method Summary | |
---|---|
static boolean |
acceptAsFocus(javax.swing.JComponent comp)
|
static void |
applyDialogGUIPersistency(java.awt.Component containerComp,
java.awt.Component contentComp)
|
static void |
applyDialogGUIPersistency(java.awt.Component containerComp,
java.awt.Component contentComp,
java.lang.String componentName)
|
static void |
applyDialogGUIPersistency(Type type,
java.awt.Component containerComp,
java.awt.Component contentComp,
java.lang.String componentName)
|
static void |
applySWTSwingModalDialog(Document dom,
javax.swing.JDialog dialog)
|
static void |
applySWTSwingModalDialog(javax.swing.JDialog dialog)
|
static void |
centerRelativeToParent(java.awt.Component parent,
java.awt.Component component)
|
static void |
centerRelativeToParentFrame(java.awt.Component frame,
java.awt.Component component)
Centers a component relative to its parent frame. |
static void |
centerRelativeToParentWindow(java.awt.Window window,
java.awt.Dialog dialog)
Centers a component relative to its parent frame. |
static void |
centerWindow(java.awt.Window w)
Centers a specified window on the screen. |
static java.lang.String |
convertToISODate(java.util.Calendar cal)
Converts a specified date (java.util.Calendar) into ISO date -> yyyy-mm-dd. |
static java.lang.String |
convertToISODate(java.util.Date date)
Converts a specified date (java.util.Calendar) into ISO date -> yyyy-mm-dd. |
static java.util.Date |
createDateFromIso(java.lang.String isoDate)
Converts a specified date (java.util.Calendar) into ISO date -> yyyy-mm-dd. |
static javax.swing.JDialog |
createDialogFor(java.awt.Component component)
|
static javax.swing.JDialog |
createDialogFor(java.awt.Component component,
boolean modal)
|
static JAXJDialog |
createDialogFor(java.awt.Component component,
boolean modal,
java.lang.String componentName)
|
static HeaderPanel |
createHeader(Type type,
java.lang.String text)
Creates a header with the specified text. |
static HeaderPanel |
createHeader(Type type,
java.lang.String text,
int height,
java.lang.String imageURL)
Creates a header with the specified text. |
static HeaderPanel |
createHeader(Type type,
java.lang.String text,
int height,
java.lang.String imageURL,
java.awt.Color textColor,
java.awt.Color startColor,
java.awt.Color endColor)
|
static HeaderPanel |
createHeader(Type type,
java.lang.String text,
java.lang.String imageURL)
Creates a header with the specified text. |
static javax.swing.JComponent |
createIndentedComponent(javax.swing.JComponent component,
int topIndent,
int bottomIndent,
int leftIndent,
int rightIndent)
|
static HeaderPanel |
createSeparatorClassic(Type type,
java.lang.String text)
Creates a classic seperator with the specified text. |
static HeaderPanel |
createSeparatorClassic(Type type,
java.lang.String text,
int height)
Creates a classic seperator with the specified text. |
static HeaderPanel |
createSeparatorModern(Type type,
java.lang.String text)
Creates a modern seperator with the specified text. |
static HeaderPanel |
createSeparatorModern(Type type,
java.lang.String text,
int height)
Creates a modern seperator with the specified text. |
static HeaderPanel |
createSeparatorVertical(Type type,
java.lang.String text)
Creates a modern seperator with the specified text. |
static void |
draw3dRect(java.awt.Graphics g,
int x,
int y,
int w,
int h,
boolean raised)
Draws a 3d rectangle on the specified graphics at the specified position and size . |
static void |
drawGradient(java.awt.Graphics graphics,
java.awt.Color color1,
java.awt.Color color2,
int x1,
int y1,
int x2,
int y2)
Draw a horizontal gradient on the specified graphics at the specified position and size. |
static void |
drawHorizontalGradient(java.awt.Graphics graphics,
java.awt.Color color1,
java.awt.Color color2,
int x,
int y,
int width,
int height)
Draw a horizontal gradient on the specified graphics at the specified position and size. |
static void |
drawImage(java.awt.Graphics graphics,
javax.swing.ImageIcon icon,
int x,
int y)
Draws a vertical gradient on the specified graphics at the specified position and size. |
static void |
drawLabel(java.awt.Graphics g,
java.lang.String caption,
int x,
int y,
java.awt.Color fg,
java.awt.Color bg)
Draw a text on the specified graphics at the specified position with the specified color. |
static void |
drawLight3dRect(java.awt.Graphics g,
int x,
int y,
int w,
int h,
boolean raised)
Draws a rectangle on the specified graphics at the specified position and size. |
static void |
drawVerticalGradient(java.awt.Graphics graphics,
java.awt.Color color1,
java.awt.Color color2,
int x,
int y,
int width,
int height)
Draws a vertical gradient on the specified graphics at the specified position and size. |
static java.util.Stack |
getAllParents(java.awt.Component c)
|
static java.util.Vector |
getAllParentsAsVector(java.awt.Component c)
|
static java.awt.Rectangle |
getComponentPositionRelativeToFrame(javax.swing.JComponent component)
Determine the relative x,y position to the Frame of a component |
static double |
getDefaultComponentHeight()
Returns the default height of a textField. |
static java.awt.Component |
getFirstListParent(java.awt.Component c)
|
static Visualizer |
getParentVisualizer(java.awt.Component c)
|
static java.awt.Color |
getRandomColor()
|
static java.awt.Color |
getRandomGrayColor()
|
static void |
resizeFullscreen(java.awt.Window w,
boolean removeBorder)
Resizes a specified window to full screen. |
static void |
scrollToTopComponent(javax.swing.JComponent component,
javax.swing.JScrollPane scrollPane,
javax.swing.JPanel innerPanel)
|
static void |
searchFocusableComponents(javax.swing.JComponent comp,
java.util.List result)
|
static void |
setBoundRelativeToParent(java.awt.Component component,
java.awt.Rectangle relativeBounds)
|
static void |
setToolTip(javax.swing.JComponent c,
java.lang.String text)
Sets the specified text to the specified component as tool tip. |
static void |
showAsModal(java.awt.Frame frame,
java.awt.Frame owner)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte[] NULL_IMAGE_DEF
public static final javax.swing.ImageIcon EMPTY_ICON
public static final java.util.Random random
Method Detail |
---|
public static void centerWindow(java.awt.Window w)
w
- a window to be centered on the screenpublic static void centerRelativeToParentFrame(java.awt.Component frame, java.awt.Component component)
frame
- a given framecomponent
- a given component that should be centered within the parent
framepublic static void centerRelativeToParent(java.awt.Component parent, java.awt.Component component)
public static void centerRelativeToParentWindow(java.awt.Window window, java.awt.Dialog dialog)
window
- a given framedialog
- a given dialog that should be centered within the parent framepublic static java.lang.String convertToISODate(java.util.Calendar cal)
cal
- a java.util.Calendar instance with the date
public static void setBoundRelativeToParent(java.awt.Component component, java.awt.Rectangle relativeBounds)
public static java.lang.String convertToISODate(java.util.Date date)
cal
- a java.util.Calendar instance with the date
public static java.util.Date createDateFromIso(java.lang.String isoDate)
cal
- a java.util.Calendar instance with the date
public static Visualizer getParentVisualizer(java.awt.Component c)
public static java.util.Stack getAllParents(java.awt.Component c)
public static java.awt.Color getRandomColor()
public static java.awt.Color getRandomGrayColor()
public static java.util.Vector getAllParentsAsVector(java.awt.Component c)
public static java.awt.Component getFirstListParent(java.awt.Component c)
public static HeaderPanel createHeader(Type type, java.lang.String text)
text
- the text that should be displayed
public static HeaderPanel createHeader(Type type, java.lang.String text, int height, java.lang.String imageURL, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor)
public static HeaderPanel createHeader(Type type, java.lang.String text, int height, java.lang.String imageURL)
text
- the text that should be displayed
public static JAXJDialog createDialogFor(java.awt.Component component, boolean modal, java.lang.String componentName)
public static void applyDialogGUIPersistency(java.awt.Component containerComp, java.awt.Component contentComp)
public static void applyDialogGUIPersistency(java.awt.Component containerComp, java.awt.Component contentComp, java.lang.String componentName)
public static void applyDialogGUIPersistency(Type type, java.awt.Component containerComp, java.awt.Component contentComp, java.lang.String componentName)
public static HeaderPanel createHeader(Type type, java.lang.String text, java.lang.String imageURL)
text
- the text that should be displayed
public static HeaderPanel createSeparatorClassic(Type type, java.lang.String text)
text
- the text that should be displayed
public static HeaderPanel createSeparatorClassic(Type type, java.lang.String text, int height)
text
- the text that should be displayed
public static HeaderPanel createSeparatorModern(Type type, java.lang.String text)
text
- the text that should be displayed
public static HeaderPanel createSeparatorModern(Type type, java.lang.String text, int height)
text
- the text that should be displayed
public static HeaderPanel createSeparatorVertical(Type type, java.lang.String text)
text
- the text that should be displayed
public static void draw3dRect(java.awt.Graphics g, int x, int y, int w, int h, boolean raised)
g
- the graphics object to draw the rectanglex
- the start position of the rectangle in pixely
- the start position of the rectangle in pixelw
- the width of the rectangle in pixelh
- the height of the rectangle in pixelpublic static void drawHorizontalGradient(java.awt.Graphics graphics, java.awt.Color color1, java.awt.Color color2, int x, int y, int width, int height)
graphics
- the graphics object to draw the gradientcolor1
- start colorcolor2
- end colorx
- the start position of the gradient in pixely
- the start position of the gradient in pixelwidth
- the width of the gradient in pixelheight
- the height of the gradient in pixelpublic static void drawGradient(java.awt.Graphics graphics, java.awt.Color color1, java.awt.Color color2, int x1, int y1, int x2, int y2)
graphics
- the graphics object to draw the gradientcolor1
- start colorcolor2
- end colorx
- the start position of the gradient in pixely
- the start position of the gradient in pixelwidth
- the width of the gradient in pixelheight
- the height of the gradient in pixelpublic static void drawImage(java.awt.Graphics graphics, javax.swing.ImageIcon icon, int x, int y)
graphics
- the graphics object to draw the gradientcolor1
- start colorcolor2
- end colorx
- the start position of the gradient in pixely
- the start position of the gradient in pixelwidth
- the width of the gradient in pixelheight
- the height of the gradient in pixelpublic static void drawLabel(java.awt.Graphics g, java.lang.String caption, int x, int y, java.awt.Color fg, java.awt.Color bg)
g
- the graphics object to draw the rectanglecaption
- the graphics object to draw the rectanglex
- the start position of the rectangle in pixely
- the start position of the rectangle in pixelfg
- the width of the rectangle in pixelbg
- the height of the rectangle in pixelpublic static void drawLight3dRect(java.awt.Graphics g, int x, int y, int w, int h, boolean raised)
g
- the graphics object to draw the rectanglex
- the start position of the rectangle in pixely
- the start position of the rectangle in pixelw
- the width of the rectangle in pixelh
- the height of the rectangle in pixelraised
- if true the ractangle is raisedpublic static void drawVerticalGradient(java.awt.Graphics graphics, java.awt.Color color1, java.awt.Color color2, int x, int y, int width, int height)
graphics
- the graphics object to draw the gradientcolor1
- start colorcolor2
- end colorx
- the start position of the gradient in pixely
- the start position of the gradient in pixelwidth
- the width of the gradient in pixelheight
- the height of the gradient in pixelpublic static void resizeFullscreen(java.awt.Window w, boolean removeBorder)
w
- the window to be resizedremoveBorder
- if true the border from specified window would be removedpublic static void setToolTip(javax.swing.JComponent c, java.lang.String text)
c
- the component with the new tool tiptext
- the text that schuld be displayedpublic static double getDefaultComponentHeight()
public static java.awt.Rectangle getComponentPositionRelativeToFrame(javax.swing.JComponent component)
component
- the component, which position should be determine
public static void scrollToTopComponent(javax.swing.JComponent component, javax.swing.JScrollPane scrollPane, javax.swing.JPanel innerPanel)
public static javax.swing.JComponent createIndentedComponent(javax.swing.JComponent component, int topIndent, int bottomIndent, int leftIndent, int rightIndent)
public static void showAsModal(java.awt.Frame frame, java.awt.Frame owner)
public static javax.swing.JDialog createDialogFor(java.awt.Component component, boolean modal)
public static javax.swing.JDialog createDialogFor(java.awt.Component component)
public static boolean acceptAsFocus(javax.swing.JComponent comp)
public static void searchFocusableComponents(javax.swing.JComponent comp, java.util.List result)
public static void applySWTSwingModalDialog(javax.swing.JDialog dialog)
public static void applySWTSwingModalDialog(Document dom, javax.swing.JDialog dialog)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |