|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectverinec.gui.GuiUtil
public class GuiUtil
Contains utility methods for GUI operations.
| Nested Class Summary | |
|---|---|
static class |
GuiUtil.ColorChooseAction
Action class for the color chooser button. |
(package private) static class |
GuiUtil.InvertFilter
Invert filter for RGB images. |
static class |
GuiUtil.SpringUtilities
A helper class that provides utility methods for creating form- or grid-style layouts with SpringLayout. |
| Field Summary | |
|---|---|
static String |
DECONNECT_ICON
Icon location for deconnect symbol. |
static String |
DELETE_ICON
Icon location for delete symbol. |
static String |
IMPORT_ICON
Icon location for import symbol. |
static String |
IPOK_ICON
Icon location for ip ok symbol. |
static String |
MOVEDOWN_ICON
Icon location for move interface down symbol. |
static String |
MOVELEFT_ICON
Icon location for move interface left symbol. |
static String |
MOVERIGHT_ICON
Icon location for move interface right symbol. |
static String |
MOVEUP_ICON
Icon location for move interface up symbol. |
static String |
OK_ICON
Icon location for ok symbol. |
static String |
PROPERTIES_ICON
Icon location for properties symbol. |
static String |
SEND_ICON
Icon location for send symbol. |
| Constructor Summary | |
|---|---|
private |
GuiUtil()
Never instantiate GuiUtil, it contains only static methods. |
| Method Summary | |
|---|---|
static Element |
Color2Xml(Color c,
Element e)
Convert a color object to an XML element. |
private static NwHub |
connectBinding(VerinecStudio studio,
NwBinding src,
NwBinding bind)
Connect two bindings, creating a hub in between. |
private static void |
connectHub(VerinecStudio studio,
NwComponent c,
NwHub hub)
Connect a binding or interface with an existing hub. |
private static NwHub |
connectInterface(VerinecStudio studio,
NwInterface src,
NwInterface bi)
Connect two interfaces, creating a hub in between. |
static NwHub |
connectNetwork(VerinecStudio studio,
NwComponent start,
NwComponent dest)
Connect two interfaces / bindings together. |
static void |
deepEnable(Container c,
boolean enable)
Recursively change setEnabled for a container and all its components. |
static void |
drawStringCentered(Graphics2D g2,
String text,
int x,
int y)
String will be horizontally centered around x. |
static ImageProducer |
getInversePicture(Image image)
Calculates the inverse picture of a image. |
static Rectangle2D |
getStringCenteredLocation(Graphics2D g2,
String text,
int x,
int y)
Get the location of a string as it would be used by drawStringCentered. |
static String |
isCompatible(NwComponent c1,
NwComponent c2)
Test if two components might be connected. |
static ImageIcon |
loadIcon(Object context,
String name)
Loads an image either using getResource() or from the file system. |
static void |
removeAllMouseListeners(Component c)
Removes all mouse listeners from a component. |
static void |
removeAllMouseMotionListeners(Component c)
Removes all mouse motion listeners from a component. |
static Color |
Xml2Color(Element e)
Convert an XML element to a java.awt.Color. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String OK_ICON
public static final String DELETE_ICON
public static final String PROPERTIES_ICON
public static final String DECONNECT_ICON
public static final String SEND_ICON
public static final String IPOK_ICON
public static final String IMPORT_ICON
public static final String MOVERIGHT_ICON
public static final String MOVEDOWN_ICON
public static final String MOVELEFT_ICON
public static final String MOVEUP_ICON
| Constructor Detail |
|---|
private GuiUtil()
| Method Detail |
|---|
public static ImageIcon loadIcon(Object context,
String name)
throws VerinecException
context - The calling class, usually 'this'.name - The image path to load.
VerinecException - If the icon can not be found or is no valid image.
NullPointerException - If either parameter is null.public static ImageProducer getInversePicture(Image image)
image - the image to be inversed.
public static NwHub connectNetwork(VerinecStudio studio,
NwComponent start,
NwComponent dest)
throws IllegalArgumentException
isCompatible(NwComponent, NwComponent)
studio - Main application used to create hubs and wires.start - Start componentdest - Destination component
IllegalArgumentException - If the parameters are not compatible.
private static void connectHub(VerinecStudio studio,
NwComponent c,
NwHub hub)
studio - Main app to create wirec - The binding or interfacehub - The hub to connect to
private static NwHub connectBinding(VerinecStudio studio,
NwBinding src,
NwBinding bind)
studio - Main app to create wires and hubsrc - The first bindingbind - The second binding
private static NwHub connectInterface(VerinecStudio studio,
NwInterface src,
NwInterface bi)
studio - Main app to create wires and hubsrc - The first interfacebi - The second interface
public static String isCompatible(NwComponent c1,
NwComponent c2)
c1 - First component to test.c2 - Target component to test.
public static void removeAllMouseListeners(Component c)
c - The component to remove mouse listeners from.public static void removeAllMouseMotionListeners(Component c)
c - The component to remove mouse listeners from.
public static void deepEnable(Container c,
boolean enable)
c - A container to set enabled on.enable - Whether everything is to enable or not.
public static void drawStringCentered(Graphics2D g2,
String text,
int x,
int y)
g2 - The graphics contexttext - Text to drawx - Coordinate to center horizontallyy - Vertical top line
public static Rectangle2D getStringCenteredLocation(Graphics2D g2,
String text,
int x,
int y)
g2 - The graphics contexttext - Text to drawx - Coordinate to center horizontallyy - Vertical top line
public static Color Xml2Color(Element e)
e - The element with attributes r, g and b, denoting integer values from 0-255.
public static Element Color2Xml(Color c,
Element e)
c - The color to use.e - An XML element to set the attributes r, g and b to the integer values from 0-255 of color c.
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||