public class PanelDesignerControl extends Object
Modifier and Type | Field and Description |
---|---|
static int |
BUTTONDBLCLK |
static int |
BUTTONDOWN |
static int |
BUTTONUP |
static int |
CAPTURECHANGED |
static int |
DO_CAPTURE |
static int |
DO_COLUMN |
static int |
DO_EDIT_DIALOG |
static int |
DO_HEADER |
static int |
DO_NOTHING
Return codes from mouse operation, invoking operations in turn, in LOBYTE.
|
static int |
DO_PASS_MOUSE |
static int |
DO_RELEASE |
static int |
DO_TURN_PAGE |
static int |
EDIT_REQUEST
Mouse values.
|
static int |
MOUSEMOVE |
static int |
PTR_ARROW
Pointers used with setMousePointer method.
|
static int |
PTR_HAND |
static int |
PTR_MOVE |
static int |
PTR_SIZENESW |
static int |
PTR_SIZENS |
static int |
PTR_SIZENWSE |
static int |
PTR_SIZEWE |
static int |
PTR_TEXT |
static int |
PTR_WAIT |
Modifier and Type | Method and Description |
---|---|
JLabel |
createErrorComponent(String msg)
Creates an error component.
|
Object |
getAttachment()
Gets the custom attachment.
|
Color |
getBackground(int clr)
Gets the background color of a control, if not set, the panel background.
|
Color |
getBackground(int clr,
int defClr)
Gets the background color of a control, if not set, the defClr.
|
JComponent |
getComponent()
Gets the component.
|
protected int |
getControlSBSize(int cx,
int cy)
Gets the size of the scroll-bar enabled part of the control.
|
int |
getCurrentNotebookPage()
Gets the current notebook page index.
|
byte[] |
getData()
Gets the original data.
|
Font |
getFont(int font)
Gets the font of a control, if not set, the panel font.
|
static FontManager |
getFontManager()
Gets the font manager.
|
static int |
getFontMetrics(int font,
String text)
JNI method to get the font metrics.
|
Color |
getForeground(int clr,
int defColor)
Gets the foreground color of a control, if not set, the second color.
|
static ImageIcon |
getImage(String fileName)
Loads an image from the runtime image path.
|
static IImageManager |
getImageManager()
Gets the Image Manager.
|
static ImageIcon |
getImageOrNull(String fileName)
Loads an image from the runtime image path.
|
static double |
getImageScale()
Gets the current image scaling factor.
|
Color |
getPanelBackground()
Gets the panel background.
|
Font |
getPanelFont()
Gets the panel font.
|
protected int |
getPreferredSize()
Gets the preferred size of the component.
|
static double |
getSynthScale()
Gets the synthetic scale for system images or sizes, used to scale checkbox/radio button images
and set the combobox and spin button widths of buttons.
|
protected String |
getText()
Gets the text of the component as possible.
|
int |
getType()
Gets the type of control.
|
protected void |
invalidateWindow(long hwnd)
Invalidates the window.
|
boolean |
isComponentImageValid()
Checks if the component is valid or if it is in creation, resize or repaint state.
|
boolean |
isNewStyle()
Check if it's a new-styled panel.
|
static boolean |
isSupported(int type,
byte[] data)
Checks if the type is supported in by a Java IDesignerControl implementor.
|
protected void |
onBitmapInvalidated()
Called when the Win32 bitmap is invalidated and needs to be replaced, e.g.
|
protected static Object |
onCreate(long hwnd,
int type,
byte[] data,
int cx,
int cy,
int panelFont,
int panelBackground,
boolean isNewStyle)
Called from JNI to create the Java part of a control.
|
protected void |
onDestroy()
Called when window is destroyed.
|
protected void |
onDisplayChanged()
Called when the display has been changed (resolution, scaling, font).
|
static int |
onImage(long hwnd,
int cx,
int cy,
int[] data,
boolean needsResize)
JNI method to update the HWND with new image data.
|
protected int |
onMouse(int operation,
int x,
int y)
The method called from JNI when the implementation wants mouse messages.
|
protected void |
onRecreate(byte[] data)
Called to recreate the control with new data without destroying the window.
|
protected void |
onSetNewStyle(boolean on)
Sets the new style for a panel control.
|
protected boolean |
onSize(int cx,
int cy,
int panelFont,
int panelBackground,
boolean forceNewBitmap)
New size for the HWND, requires new image, trigger AWT event.
|
protected boolean |
onTurnPage(int page)
Called when the JNI notebook turns page.
|
protected int[] |
onWindowPositionChanging(int x,
int y,
int cx,
int cy)
Called by Win32 to adjust the window position before it is changed.
|
int |
pixelHeightToDialog(int cy)
Converts a pixel height into dialog coordinates.
|
int |
pixelWidthToDialog(int cx)
Converts a pixel width into dialog coordinates.
|
protected void |
recreate(long hwnd,
String oper,
byte[] data)
Recreate the component with the specified data.
|
void |
recreateRepaint()
Causes the Java component to be recreated and redrawn.
|
void |
repaint()
Causes repaint of a window, including the bitmaps in the Win32 thread later...
|
void |
requestRecreate(String oper,
byte[] data)
Requests recreation of the component with new data.
|
void |
setAttachment(Object o)
Sets a custom attachment.
|
void |
setInsets(Insets insets)
Sets the component insets in e.g.
|
void |
setMousePointer(int pointer)
Sets the mouse pointer.
|
void |
setNimbusStandardInsets()
Assigns the standard Nimbus insets (+2 in all directions), only if Nimbus Look-and-Feel.
|
protected boolean |
setText(String text)
Called from Win32 to set the text.
|
void |
setViewport(int x,
int y,
int cx,
int cy)
Assigns the view port for children components when this component can contain children,
e.g.
|
protected void |
setViewport(long hwnd,
int x,
int y,
int cx,
int cy)
Assigns the view port for children components when this component can contain children,
e.g.
|
protected void |
setWantMouseMessages(long hwnd,
boolean on)
Method call by the framework to check if the implementor wishes mouse messages or not.
|
public static final int EDIT_REQUEST
public static final int MOUSEMOVE
public static final int BUTTONDOWN
public static final int BUTTONUP
public static final int BUTTONDBLCLK
public static final int CAPTURECHANGED
public static final int DO_NOTHING
public static final int DO_CAPTURE
public static final int DO_RELEASE
public static final int DO_EDIT_DIALOG
public static final int DO_TURN_PAGE
public static final int DO_COLUMN
public static final int DO_HEADER
public static final int DO_PASS_MOUSE
public static final int PTR_ARROW
public static final int PTR_TEXT
public static final int PTR_WAIT
public static final int PTR_MOVE
public static final int PTR_SIZENWSE
public static final int PTR_SIZENESW
public static final int PTR_SIZEWE
public static final int PTR_SIZENS
public static final int PTR_HAND
public static FontManager getFontManager()
public static IImageManager getImageManager()
public static double getImageScale()
public static ImageIcon getImage(String fileName)
fileName
- The file name.public static ImageIcon getImageOrNull(String fileName)
fileName
- The file name.public static double getSynthScale()
public static int getFontMetrics(int font, String text)
font
- The font.text
- The text to measure, or null for character font metrics.public static boolean isSupported(int type, byte[] data)
type
- The type.data
- The data (null in first call).protected static Object onCreate(long hwnd, int type, byte[] data, int cx, int cy, int panelFont, int panelBackground, boolean isNewStyle)
public static int onImage(long hwnd, int cx, int cy, int[] data, boolean needsResize)
protected void onSetNewStyle(boolean on)
public byte[] getData()
public int getType()
public void setAttachment(Object o)
public Object getAttachment()
public Font getPanelFont()
public Font getFont(int font)
public Color getPanelBackground()
public Color getForeground(int clr, int defColor)
public Color getBackground(int clr)
public Color getBackground(int clr, int defClr)
protected boolean onSize(int cx, int cy, int panelFont, int panelBackground, boolean forceNewBitmap)
protected void onDestroy()
public void setInsets(Insets insets)
insets
- The insets for the component.public void setNimbusStandardInsets()
public boolean isComponentImageValid()
public JComponent getComponent()
public boolean isNewStyle()
protected void setWantMouseMessages(long hwnd, boolean on)
public void setMousePointer(int pointer)
pointer
- One of a PTR_* value.protected void setViewport(long hwnd, int x, int y, int cx, int cy)
protected void recreate(long hwnd, String oper, byte[] data)
protected void invalidateWindow(long hwnd)
public void repaint()
public void recreateRepaint()
protected void onDisplayChanged()
public void setViewport(int x, int y, int cx, int cy)
protected int onMouse(int operation, int x, int y)
operation
- Mouse operation: MOUSEMOVE, BUTTONDOWN, BUTTONUP, BUTTONDBLCLK or CAPTURECHANGED.x
- Mouse position X relative the window.y
- Mouse position Y relative the window.protected int getControlSBSize(int cx, int cy)
cx
- The current width.cy
- The current height.protected int[] onWindowPositionChanging(int x, int y, int cx, int cy)
public int pixelWidthToDialog(int cx)
public int pixelHeightToDialog(int cy)
protected String getText()
protected int getPreferredSize()
protected boolean onTurnPage(int page)
public int getCurrentNotebookPage()
public void requestRecreate(String oper, byte[] data)
oper
- The operation for Undo.data
- The data.protected void onRecreate(byte[] data)
protected void onBitmapInvalidated()
protected boolean setText(String text)
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.