Package PamView
Class PamAWTUtils
java.lang.Object
PamView.PamAWTUtils
Useful functions for swing.
- Author:
- Jamie Macaulay
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
colorToInt
(Color c) Convert a colour to an int.static Point2D
findClosestBoundry
(Shape area, Point2D point) Find the closest boundary of a shape to a point.static Color
intToColor
(int value) Convert an int encoded with a colour to a Color object.static void
setMoreDisabled
(Component component) static void
setMoreEnabled
(Component component) static void
setPanelEnabled
(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
-