| java.lang.Object com.jidesoft.swing.Resizable
Resizable | public class Resizable (Code) | | Resizable is a class that support resizable feature.
To use it and make a component resizable, you just need to
create new Resizable() and pass in that component to the constructor.
|
Inner Class :public static class ResizeCorner extends JComponent | |
Method Summary | |
public void | beginResizing(int resizeCorner) This method is called when resizing opertion started. | protected MouseInputListener | createMouseInputListener() Creates the MouseInputListener for resizing. | public void | endResizing(int resizeCorner) The method is called when resizing ends. | public JComponent | getComponent() Gets the component which has this Resizable object. | public MouseInputListener | getMouseInputAdapter() Gets the mouse adapter for resizing. | public int | getResizableCorners() Gets the resizable corners. | public int | getResizeCornerSize() Gets resize corner size. | protected void | installListeners() Installs the listeners needed to perform resizing operations.
You do not need to call this method directly. | public boolean | isTopLevel() Checks if the Resizable is added to a top level component.
If it's top level component, it will use screen coordinates
to do all calculations during resizing. | public void | resizing(int resizeCorner, int newX, int newY, int newW, int newH) This method is called during the resizing of ResizablePanel. | public void | setResizableCorners(int resizableCorners) Sets resizable corners.
Parameters: resizableCorners - new resizable corners. | public void | setResizeCornerSize(int resizeCornerSize) Sets the resize corner size. | public void | setTopLevel(boolean topLevel) To indicates this Resizable is installed on a top level component
such as JWindow, JDialog and JFrame v.s. | public void | uninstallListeners() Uninstalls the listeners that created to perform resizing operations. |
ALL | final public static int ALL(Code) | | |
LEFT | final public static int LEFT(Code) | | |
LOWER | final public static int LOWER(Code) | | |
LOWER_LEFT | final public static int LOWER_LEFT(Code) | | |
LOWER_RIGHT | final public static int LOWER_RIGHT(Code) | | |
NONE | final public static int NONE(Code) | | |
PROPERTY_RESIZABLE_CORNERS | final public static String PROPERTY_RESIZABLE_CORNERS(Code) | | |
PROPERTY_RESIZE_CORNER_SIZE | final public static String PROPERTY_RESIZE_CORNER_SIZE(Code) | | |
RIGHT | final public static int RIGHT(Code) | | |
UPPER | final public static int UPPER(Code) | | |
UPPER_LEFT | final public static int UPPER_LEFT(Code) | | |
UPPER_RIGHT | final public static int UPPER_RIGHT(Code) | | |
Resizable | public Resizable(JComponent component)(Code) | | Creates a new Resizable . This call will make the component to be resizable.
|
beginResizing | public void beginResizing(int resizeCorner)(Code) | | This method is called when resizing opertion started.
Parameters: resizeCorner - the resize corner. |
createMouseInputListener | protected MouseInputListener createMouseInputListener()(Code) | | Creates the MouseInputListener for resizing. Subclass can override
this method to provide its own MouseInputListener to customize exsiting one.
the MouseInputListener for resizing. |
endResizing | public void endResizing(int resizeCorner)(Code) | | The method is called when resizing ends.
Parameters: resizeCorner - the resize corner. |
getComponent | public JComponent getComponent()(Code) | | Gets the component which has this Resizable object.
the component which has this Resizable object. |
getMouseInputAdapter | public MouseInputListener getMouseInputAdapter()(Code) | | Gets the mouse adapter for resizing.
the mouse adapter for resizing. |
getResizableCorners | public int getResizableCorners()(Code) | | Gets the resizable corners. The value is a bitwise OR of eight constants defined in
Resizable .
resizable corners. |
getResizeCornerSize | public int getResizeCornerSize()(Code) | | Gets resize corner size. This size is the corner's sensitive area which will trigger the resizing from both sides.
the resize corner size. |
installListeners | protected void installListeners()(Code) | | Installs the listeners needed to perform resizing operations.
You do not need to call this method directly. Construstor
will call this method automatically.
|
isTopLevel | public boolean isTopLevel()(Code) | | Checks if the Resizable is added to a top level component.
If it's top level component, it will use screen coordinates
to do all calculations during resizing. If resizing the resizable panel won't affect
any top level container's position, you can return false here.
Otherwise, return true. The default implementation always return false.
Subclasses can override to return different value. In the case of
ResizableWindow or ResizableDialog, this method is overridden and returns true.
false. |
resizing | public void resizing(int resizeCorner, int newX, int newY, int newW, int newH)(Code) | | This method is called during the resizing of ResizablePanel. In default implementation, it call
setPreferredSize(new Dimension(newW, newH));
getParent().doLayout();
in fact, depending on where you added this ResizablePanel, you may need to override this method
to do something else. For example,
ResizableWindow uses ResizablePanel to
implement resizable feature in JWindow. It overrides this method to call setBounds on JWindow itself.
Parameters: resizeCorner - the resize corner. Parameters: newX - the new x position. Parameters: newY - the new y position. Parameters: newW - the new width. Parameters: newH - the new height. |
setResizableCorners | public void setResizableCorners(int resizableCorners)(Code) | | Sets resizable corners.
Parameters: resizableCorners - new resizable corners. The value is a bitwise OR of eight constants defined in Resizable. |
setResizeCornerSize | public void setResizeCornerSize(int resizeCornerSize)(Code) | | Sets the resize corner size.
Parameters: resizeCornerSize - the resize corner size. |
setTopLevel | public void setTopLevel(boolean topLevel)(Code) | | To indicates this Resizable is installed on a top level component
such as JWindow, JDialog and JFrame v.s. a JPanel which is not a top level component
because a JPanel must be added to another top level component in order to be displayed.
Parameters: topLevel - true or false. |
uninstallListeners | public void uninstallListeners()(Code) | | Uninstalls the listeners that created to perform resizing operations.
After uninstallation, the component will not be resizable anymore.
|
|
|