public final class BaseXLayout extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
BaseXLayout.DropHandler
Drag and drop handler.
|
Modifier and Type | Method and Description |
---|---|
static void |
addDrop(JComponent comp,
BaseXLayout.DropHandler dnd)
Adds drag and drop functionality.
|
static void |
addInteraction(Component comp,
Window win)
Adds default interactions to the specified component.
|
static String |
addShortcut(String str,
String sc)
Adds human readable shortcuts to the specified string.
|
static Graphics2D |
antiAlias(Graphics g)
Activates graphics anti-aliasing.
|
static EmptyBorder |
border(int t,
int l,
int b,
int r)
Returns a border with the specified insets.
|
static void |
chopString(Graphics g,
byte[] s,
int x,
int y,
int w,
int fs)
Draws the specified string.
|
static ArrayList<Object> |
contents(Transferable tr)
Returns the contents of the specified transferable.
|
static void |
copy(String text)
Copies the specified string to the clipboard.
|
static void |
drawCell(Graphics g,
int xs,
int xe,
int ys,
int ye,
boolean focus)
Draws a colored cell.
|
static void |
drawCenter(Graphics g,
String text,
int w,
int y)
Draws a centered string to the panel.
|
static void |
drawTooltip(Graphics g,
String tt,
int x,
int y,
int w,
int c)
Draws a visualization tooltip.
|
static void |
hints(Graphics g)
Set desktop hints (not supported by all platforms).
|
static KeyStroke |
keyStroke(GUICommand cmd)
Returns a keystroke for the specified string.
|
static void |
setHeight(Component comp,
int h)
Sets the scaled component height, adopting the original component width.
|
static void |
setMnemonic(AbstractButton b,
StringBuilder mnem)
Sets a mnemomic for the specified button.
|
static void |
setWidth(Component comp,
int w)
Sets the scaled component width, adopting the original component height.
|
static String |
value(double val)
Returns the value of the specified pre value and attribute.
|
static int |
width(Graphics g,
byte[] s)
Returns the width of the specified text.
|
static int |
width(Graphics g,
int[] cw,
int c)
Returns the character width of the specified character.
|
static int |
width(Graphics g,
String s)
Returns the width of the specified text.
|
public static void hints(Graphics g)
g
- graphics referencepublic static Graphics2D antiAlias(Graphics g)
g
- graphics referencepublic static void setWidth(Component comp, int w)
comp
- componentw
- widthpublic static void setHeight(Component comp, int h)
comp
- componenth
- heightpublic static EmptyBorder border(int t, int l, int b, int r)
t
- top distancel
- left distanceb
- bottom distancer
- right distancepublic static void addDrop(JComponent comp, BaseXLayout.DropHandler dnd)
comp
- componentdnd
- drag and drop handlerpublic static KeyStroke keyStroke(GUICommand cmd)
cmd
- commandpublic static void setMnemonic(AbstractButton b, StringBuilder mnem)
b
- buttonmnem
- mnemonics that have already been assignedpublic static ArrayList<Object> contents(Transferable tr)
tr
- transferablepublic static void copy(String text)
text
- textpublic static void addInteraction(Component comp, Window win)
comp
- componentwin
- parent windowpublic static String addShortcut(String str, String sc)
str
- text of tooltipsc
- shortcutpublic static String value(double val)
val
- value to be evaluatedpublic static void drawCell(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(Graphics g, String text, int w, int y)
g
- graphics referencetext
- text to be paintedw
- panel widthy
- vertical positionpublic static void drawTooltip(Graphics g, 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(Graphics g, String s)
g
- graphics references
- string to be evaluatedpublic static void chopString(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(Graphics g, byte[] s)
g
- graphics references
- string to be evaluatedpublic static int width(Graphics g, int[] cw, int c)
g
- graphics referencecw
- array with character widthsc
- characterCopyright © 2005–2015 BaseX Team. All rights reserved.