Package PamView
Class PamAWTUtils
java.lang.Object
PamView.PamAWTUtils
Useful functions for swing.
- Author:
- Jamie Macaulay
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcolorToInt(Color c) Convert a colour to an int.static Point2DfindClosestBoundry(Shape area, Point2D point) Find the closest boundary of a shape to a point.static ColorintToColor(int value) Convert an int encoded with a colour to a Color object.static voidsetMoreDisabled(Component component) static voidsetMoreEnabled(Component component) static voidsetPanelEnabled(JComponent jComponent, Boolean isEnabled) Disable an entire swing panel including all child components.
-
Constructor Details
-
PamAWTUtils
public PamAWTUtils()
-
-
Method Details
-
setPanelEnabled
Disable an entire swing panel including all child components.- Parameters:
jComponent- - the panel to disableisEnabled- true if enabled.
-
setMoreEnabled
-
setMoreDisabled
-
findClosestBoundry
Find the closest boundary of a shape to a point. http://stackoverflow.com/questions/8103451/point-outside-of-area-which-is-closest-to-point-inside- Parameters:
area- - the shapepoint- - the point from which to find the closest the boundary point- Returns:
- the closest boundary point.
-
colorToInt
Convert a colour to an int.- Parameters:
c- - the colour to change.- Returns:
- the int representation of the colour
-
intToColor
Convert an int encoded with a colour to a Color object.- Parameters:
value- - the int to convert to colour- Returns:
- the Color object for the int
-