Package org.tn5250j.tools
Class GUIGraphicsUtils
- java.lang.Object
-
- org.tn5250j.tools.GUIGraphicsUtils
-
public class GUIGraphicsUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static intINSETstatic intRAISEDstatic intWINDOW_GRAPHICstatic intWINDOW_NORMAL
-
Constructor Summary
Constructors Constructor Description GUIGraphicsUtils()
-
Method Summary
Modifier and Type Method Description static javax.swing.ImageIconcreateImageIcon(java.lang.String image)This routine will extract image resources from jar file and create an ImageIconstatic voiddraw3DLeft(java.awt.Graphics g, int which, int x, int y, int fmWidth, int fmHeight)static voiddraw3DMiddle(java.awt.Graphics g, int which, int x, int y, int fmWidth, int fmHeight)static voiddraw3DOne(java.awt.Graphics g, int which, int x, int y, int fmWidth, int fmHeight)static voiddraw3DRight(java.awt.Graphics g, int which, int x, int y, int fmWidth, int fmHeight)static voiddrawBezel(java.awt.Graphics g, int x, int y, int w, int h, boolean isPressed, boolean isDefault, java.awt.Color shadow, java.awt.Color darkShadow, java.awt.Color highlight, java.awt.Color lightHighlight)static voiddrawDashedRect(java.awt.Graphics g, int x, int y, int width, int height)static voiddrawEtchedRect(java.awt.Graphics g, int x, int y, int w, int h, java.awt.Color shadow, java.awt.Color darkShadow, java.awt.Color highlight, java.awt.Color lightHighlight)static voiddrawGroove(java.awt.Graphics g, int x, int y, int w, int h, java.awt.Color shadow, java.awt.Color highlight)static voiddrawLoweredBezel(java.awt.Graphics g, int x, int y, int w, int h, java.awt.Color shadow, java.awt.Color darkShadow, java.awt.Color highlight, java.awt.Color lightHighlight)static voiddrawScrollBar(java.awt.Graphics g, int which, int direction, int x, int y, int fmWidth, int fmHeight, java.awt.Color fg, java.awt.Color bg)static voiddrawString(java.awt.Graphics g, java.lang.String text, int underlinedChar, int x, int y)Draw a string with the graphics g at location (x,y) just like g.drawString() would.static voiddrawWinBottom(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)static voiddrawWinLeft(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)static voiddrawWinLowerLeft(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)static voiddrawWinLowerRight(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)static voiddrawWinRight(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)static voiddrawWinUpper(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)static voiddrawWinUpperLeft(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)static voiddrawWinUpperRight(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)static java.util.List<java.awt.Image>getApplicationIcons()static javax.swing.ImageIcongetClosedLockIcon()static java.lang.StringgetDefaultFont()static java.awt.FontgetDerivedFont(java.awt.Font font, int width, int height, int numRows, int numCols, float scaleHeight, float scaleWidth, float pointSize)static java.awt.InsetsgetEtchedInsets()Returns the amount of space taken up by a border drawn bydrawEtchedRect()static java.awt.InsetsgetGrooveInsets()Returns the amount of space taken up by a border drawn bydrawGroove()static javax.swing.ImageIcongetOpenLockIcon()static booleanisFontNameExists(java.lang.String fontString)Checks to see if the font name exists within our environmentstatic voidpositionPopup(java.awt.Component component, javax.swing.JPopupMenu jpm, int xCoord, int yCoord)
-
-
-
Field Detail
-
RAISED
public static final int RAISED
- See Also:
- Constant Field Values
-
INSET
public static final int INSET
- See Also:
- Constant Field Values
-
WINDOW_NORMAL
public static final int WINDOW_NORMAL
- See Also:
- Constant Field Values
-
WINDOW_GRAPHIC
public static final int WINDOW_GRAPHIC
- See Also:
- Constant Field Values
-
-
Method Detail
-
draw3DLeft
public static void draw3DLeft(java.awt.Graphics g, int which, int x, int y, int fmWidth, int fmHeight)
-
draw3DMiddle
public static void draw3DMiddle(java.awt.Graphics g, int which, int x, int y, int fmWidth, int fmHeight)
-
draw3DRight
public static void draw3DRight(java.awt.Graphics g, int which, int x, int y, int fmWidth, int fmHeight)
-
draw3DOne
public static void draw3DOne(java.awt.Graphics g, int which, int x, int y, int fmWidth, int fmHeight)
-
drawScrollBar
public static void drawScrollBar(java.awt.Graphics g, int which, int direction, int x, int y, int fmWidth, int fmHeight, java.awt.Color fg, java.awt.Color bg)
-
drawWinUpperLeft
public static void drawWinUpperLeft(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)
-
drawWinUpper
public static void drawWinUpper(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)
-
drawWinUpperRight
public static void drawWinUpperRight(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)
-
drawWinLeft
public static void drawWinLeft(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)
-
drawWinRight
public static void drawWinRight(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)
-
drawWinLowerLeft
public static void drawWinLowerLeft(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)
-
drawWinBottom
public static void drawWinBottom(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)
-
drawWinLowerRight
public static void drawWinLowerRight(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)
-
drawEtchedRect
public static void drawEtchedRect(java.awt.Graphics g, int x, int y, int w, int h, java.awt.Color shadow, java.awt.Color darkShadow, java.awt.Color highlight, java.awt.Color lightHighlight)
-
getEtchedInsets
public static java.awt.Insets getEtchedInsets()
Returns the amount of space taken up by a border drawn bydrawEtchedRect()- Returns:
- the inset of an etched rect
-
drawGroove
public static void drawGroove(java.awt.Graphics g, int x, int y, int w, int h, java.awt.Color shadow, java.awt.Color highlight)
-
getGrooveInsets
public static java.awt.Insets getGrooveInsets()
Returns the amount of space taken up by a border drawn bydrawGroove()- Returns:
- the inset of a groove border
-
drawBezel
public static void drawBezel(java.awt.Graphics g, int x, int y, int w, int h, boolean isPressed, boolean isDefault, java.awt.Color shadow, java.awt.Color darkShadow, java.awt.Color highlight, java.awt.Color lightHighlight)
-
drawLoweredBezel
public static void drawLoweredBezel(java.awt.Graphics g, int x, int y, int w, int h, java.awt.Color shadow, java.awt.Color darkShadow, java.awt.Color highlight, java.awt.Color lightHighlight)
-
drawString
public static void drawString(java.awt.Graphics g, java.lang.String text, int underlinedChar, int x, int y)Draw a string with the graphics g at location (x,y) just like g.drawString() would. The first occurence of underlineChar in text will be underlined. The matching is not case sensitive.- Parameters:
g- graphics objecttext- some text to drawunderlinedChar- number ov char to underlinex- xy- y
-
drawDashedRect
public static void drawDashedRect(java.awt.Graphics g, int x, int y, int width, int height)
-
getDerivedFont
public static java.awt.Font getDerivedFont(java.awt.Font font, int width, int height, int numRows, int numCols, float scaleHeight, float scaleWidth, float pointSize)
-
positionPopup
public static void positionPopup(java.awt.Component component, javax.swing.JPopupMenu jpm, int xCoord, int yCoord)
-
getDefaultFont
public static java.lang.String getDefaultFont()
-
isFontNameExists
public static boolean isFontNameExists(java.lang.String fontString)
Checks to see if the font name exists within our environment- Parameters:
fontString- font to use- Returns:
- whether the font passed exists or not.
-
createImageIcon
public static javax.swing.ImageIcon createImageIcon(java.lang.String image)
This routine will extract image resources from jar file and create an ImageIcon- Parameters:
image- image to use- Returns:
- an image icon
-
getOpenLockIcon
public static javax.swing.ImageIcon getOpenLockIcon()
- Returns:
- an image that lock like a opened lock
-
getClosedLockIcon
public static javax.swing.ImageIcon getClosedLockIcon()
- Returns:
- an image that lock like a closed lock
-
getApplicationIcons
public static final java.util.List<java.awt.Image> getApplicationIcons()
-
-