|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.gui.layout.BaseXLayout
public final class BaseXLayout
This class provides static layout and paint helper methods which are used all over the GUI.
Nested Class Summary | |
---|---|
static interface |
BaseXLayout.DropHandler
Drag and drop handler. |
Method Summary | |
---|---|
static void |
addDrop(javax.swing.JComponent comp,
BaseXLayout.DropHandler dnd)
Adds drag and drop functionality. |
static java.lang.String |
addShortcut(java.lang.String str,
java.lang.String sc)
Adds human readable shortcuts to the specified string. |
static void |
chopString(java.awt.Graphics g,
byte[] s,
int x,
int y,
int w,
int fs)
Draws the specified string. |
static java.util.ArrayList<java.lang.Object> |
contents(java.awt.datatransfer.Transferable tr)
Returns the contents of the specified transferable. |
static void |
drawCell(java.awt.Graphics g,
int xs,
int xe,
int ys,
int ye,
boolean focus)
Draws a colored cell. |
static void |
drawCenter(java.awt.Graphics g,
java.lang.String text,
int w,
int y)
Draws a centered string to the panel. |
static void |
drawTooltip(java.awt.Graphics g,
java.lang.String tt,
int x,
int y,
int w,
int c)
Draws a visualization tooltip. |
static void |
fill(java.awt.Graphics gg,
java.awt.Color c1,
java.awt.Color c2,
int xs,
int ys,
int xe,
int ye)
Fills the specified area with a color gradient. |
static javax.swing.ImageIcon |
icon(java.lang.String name)
Returns the specified image as icon. |
static java.awt.Image |
image(java.lang.String name)
Returns the specified image. |
static void |
setHeight(java.awt.Component comp,
int h)
Sets the component height, adopting the original component width. |
static void |
setMnemonic(javax.swing.AbstractButton b,
java.lang.StringBuilder mnem)
Sets a mnemomic for the specified button. |
static void |
setWidth(java.awt.Component comp,
int w)
Sets the component width, adopting the original component height. |
static java.lang.String |
value(double val)
Returns the value of the specified pre value and attribute. |
static int |
width(java.awt.Graphics g,
byte[] s)
Returns the width of the specified text. |
static int |
width(java.awt.Graphics g,
int[] cw,
int c)
Returns the character width of the specified character. |
static int |
width(java.awt.Graphics g,
java.lang.String s)
Returns the width of the specified text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void setWidth(java.awt.Component comp, int w)
comp
- componentw
- widthpublic static void setHeight(java.awt.Component comp, int h)
comp
- componenth
- heightpublic static void addDrop(javax.swing.JComponent comp, BaseXLayout.DropHandler dnd)
comp
- componentdnd
- drag and drop handlerpublic static void setMnemonic(javax.swing.AbstractButton b, java.lang.StringBuilder mnem)
b
- buttonmnem
- mnemonics that have already been assignedpublic static java.util.ArrayList<java.lang.Object> contents(java.awt.datatransfer.Transferable tr)
tr
- transferable
public static java.lang.String addShortcut(java.lang.String str, java.lang.String sc)
str
- text of tooltipsc
- shortcut
public static javax.swing.ImageIcon icon(java.lang.String name)
name
- name of icon
public static java.awt.Image image(java.lang.String name)
name
- name of image
public static java.lang.String value(double val)
val
- value to be evaluated
public static void fill(java.awt.Graphics gg, java.awt.Color c1, java.awt.Color c2, int xs, int ys, int xe, int ye)
gg
- graphics referencec1
- first colorc2
- second colorxs
- horizontal start positionys
- vertical start positionxe
- horizontal end positionye
- vertical end positionpublic static void drawCell(java.awt.Graphics g, int xs, int xe, int ys, int ye, boolean focus)
g
- graphics referencexs
- horizontal start positionxe
- horizontal end positionys
- vertical start positionye
- vertical end positionfocus
- highlighting flagpublic static void drawCenter(java.awt.Graphics g, java.lang.String text, int w, int y)
g
- graphics referencetext
- text to be paintedw
- panel widthy
- vertical positionpublic static void drawTooltip(java.awt.Graphics g, java.lang.String tt, int x, int y, int w, int c)
g
- graphics referencett
- tooltip labelx
- horizontal positiony
- vertical positionw
- widthc
- color color depthpublic static int width(java.awt.Graphics g, java.lang.String s)
g
- graphics references
- string to be evaluated
public static void chopString(java.awt.Graphics g, byte[] s, int x, int y, int w, int fs)
g
- graphics references
- textx
- x coordinatey
- y coordinatew
- widthfs
- font sizepublic static int width(java.awt.Graphics g, byte[] s)
g
- graphics references
- string to be evaluated
public static int width(java.awt.Graphics g, int[] cw, int c)
g
- graphics referencecw
- array with character widthsc
- character
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |