public abstract class RadComponent extends PropertiesContainer
Modifier and Type | Field and Description |
---|---|
protected MetaModel |
myMetaModel |
Constructor and Description |
---|
RadComponent() |
Modifier and Type | Method and Description |
---|---|
void |
accept(RadComponentVisitor visitor,
boolean forward) |
void |
acceptChildren(RadComponentVisitor visitor,
boolean forward) |
void |
add(RadComponent component,
RadComponent insertBefore) |
static void |
addError(RadComponent component,
ErrorInfo errorInfo) |
void |
addSelectionActions(DesignerEditorPanel designer,
DefaultActionGroup actionGroup,
javax.swing.JComponent shortcuts,
java.util.List<RadComponent> selection) |
void |
addStaticDecorators(java.util.List<StaticDecorator> decorators,
java.util.List<RadComponent> selection) |
boolean |
canDelete() |
static void |
clearErrors(RadComponent component) |
java.awt.Point |
convertPoint(java.awt.Component relativeFrom,
int x,
int y)
Returns the point in the model coordinate space (see
getBounds() ) given
a coordinate x, y in the given Swing component. |
void |
copyTo(Element parentElement) |
void |
delete() |
<T> T |
extractClientProperty(java.lang.String key) |
java.awt.Dimension |
fromModel(java.awt.Component target,
java.awt.Dimension size)
Converts the given rectangle (in model coordinates) to coordinates in the given
target component's coordinate system.
|
java.awt.Point |
fromModel(java.awt.Component target,
java.awt.Point point)
Converts the given point (in model coordinates) to coordinates in the given
target component's coordinate system.
|
java.awt.Rectangle |
fromModel(java.awt.Component target,
java.awt.Rectangle rectangle)
Converts the given rectangle (in model coordinates) to coordinates in the given
target component's coordinate system.
|
java.awt.Rectangle |
getBounds()
Returns the bounds of this RadComponent in the model.
|
java.awt.Rectangle |
getBounds(java.awt.Component relativeTo)
Returns the bounds of this RadComponent in the coordinate system of
the given Swing component.
|
ICaption |
getCaption() |
java.util.List<RadComponent> |
getChildren() |
protected java.util.List<RadComponent> |
getChildrenForAccept(RadComponentVisitor visitor) |
<T> T |
getClientProperty(java.lang.String key) |
InputTool |
getDragTracker(java.awt.Point location,
java.awt.event.InputEvent event,
boolean isTree) |
static java.util.List<ErrorInfo> |
getError(RadComponent component) |
java.util.List<Property> |
getInplaceProperties() |
RadLayout |
getLayout() |
RadLayoutData |
getLayoutData() |
MetaModel |
getMetaModel() |
MetaModel |
getMetaModelForProperties() |
RadComponent |
getParent() |
<T extends RadComponent> |
getParent(java.lang.Class<T> clazz) |
static java.util.Set<RadComponent> |
getParents(java.util.List<? extends RadComponent> components) |
java.util.List<Property> |
getProperties() |
java.util.List<Property> |
getProperties(java.lang.String key) |
java.lang.String |
getPropertyValue(java.lang.String name) |
static java.util.List<RadComponent> |
getPureSelection(java.util.List<RadComponent> selection) |
RadComponent |
getRoot() |
java.lang.Object[] |
getTreeChildren() |
static java.util.Map<RadComponent,java.util.List<RadComponent>> |
groupSiblings(java.util.List<? extends RadComponent> components)
Partitions the given list of components into a map where each value is a list of siblings,
in the same order as in the original list, and where the keys are the parents (or null
for the components that do not have a parent).
|
boolean |
isAncestorFor(RadComponent component,
boolean strict) |
boolean |
isBackground()
Whether this view is considered to be the background.
|
static boolean |
isParentsContainedIn(java.util.List<RadComponent> components,
RadComponent component) |
boolean |
isSameType(RadComponent other)
Returns true if this component is of the same logical type as the given other component.
|
RadComponent |
morphingTo(MetaModel target) |
void |
processDropOperation(OperationContext context) |
void |
remove(RadComponent component) |
void |
removeFromParent() |
void |
setClientProperty(java.lang.Object key,
java.lang.Object value) |
void |
setLayout(RadLayout layout) |
void |
setMetaModel(MetaModel metaModel) |
void |
setParent(RadComponent parent) |
java.awt.Dimension |
toModel(java.awt.Component source,
java.awt.Dimension size)
Converts the given size (in coordinates relative to the given component)
into the equivalent size in model coordinates.
|
java.awt.Point |
toModel(java.awt.Component source,
java.awt.Point point)
Converts the given point (in coordinates relative to the given component)
into the equivalent point in model coordinates.
|
java.awt.Rectangle |
toModel(java.awt.Component source,
java.awt.Rectangle rectangle)
Converts the given rectangle (in coordinates relative to the given component)
into the equivalent rectangle in model coordinates.
|
RadComponent |
wrapIn(MetaModel target) |
protected MetaModel myMetaModel
public MetaModel getMetaModel()
public MetaModel getMetaModelForProperties() throws java.lang.Exception
java.lang.Exception
public void setMetaModel(MetaModel metaModel)
public RadComponent getRoot()
public final RadComponent getParent()
public final <T extends RadComponent> T getParent(java.lang.Class<T> clazz)
public final void setParent(RadComponent parent)
public java.util.List<RadComponent> getChildren()
public java.lang.Object[] getTreeChildren()
public void add(RadComponent component, RadComponent insertBefore)
public void remove(RadComponent component)
public void removeFromParent()
public boolean isBackground()
public boolean isSameType(RadComponent other)
public java.awt.Rectangle getBounds()
public java.awt.Rectangle getBounds(java.awt.Component relativeTo)
DesignerEditorPanel.zoom(com.intellij.designer.designSurface.ZoomType)
)
and will apply any relative position offsets of views in the hierarchy between the
two components.
Returns a new Rectangle
, so callers are free to modify the result.relativeTo
- the component whose coordinate system the model bounds should
be shifted and scaled intopublic java.awt.Rectangle fromModel(java.awt.Component target, java.awt.Rectangle rectangle)
getBounds()
.
This means that calling getBounds(java.awt.Component)
is equivalent
to calling this method and passing in getBounds()
.
Returns a new Rectangle
, so callers are free to modify the result.target
- the component whose coordinate system the rectangle should be
translated intorectangle
- the model rectangle to convertpublic java.awt.Rectangle toModel(java.awt.Component source, java.awt.Rectangle rectangle)
Rectangle
, so callers are free to modify the result.source
- the component which defines the coordinate system of the rectanglerectangle
- the rectangle to be converted into model coordinatespublic java.awt.Point fromModel(java.awt.Component target, java.awt.Point point)
getBounds()
.
Returns a new Point
, so callers are free to modify the result.target
- the component whose coordinate system the point should be
translated intopoint
- the model point to convertpublic java.awt.Point toModel(java.awt.Component source, java.awt.Point point)
Point
, so callers are free to modify the result.source
- the component which defines the coordinate system of the pointpoint
- the point to be converted into model coordinatespublic java.awt.Dimension fromModel(java.awt.Component target, java.awt.Dimension size)
getBounds()
.
Returns a new Dimension
, so callers are free to modify the result.target
- the component whose coordinate system the dimension should be
translated intosize
- the model dimension to convertpublic java.awt.Dimension toModel(java.awt.Component source, java.awt.Dimension size)
Dimension
, so callers are free to modify the result.source
- the component which defines the coordinate system of the sizesize
- the dimension to be converted into model coordinatespublic java.awt.Point convertPoint(java.awt.Component relativeFrom, int x, int y)
getBounds()
) given
a coordinate x, y
in the given Swing component.
Returns a new Point
, so callers are free to modify the result.relativeFrom
- the component whose coordinate system defines the rectanglex
- the x coordinate of the pointy
- the y coordinate of the pointPoint
in the model coordinate systempublic InputTool getDragTracker(java.awt.Point location, java.awt.event.InputEvent event, boolean isTree)
public void processDropOperation(OperationContext context)
public void addStaticDecorators(java.util.List<StaticDecorator> decorators, java.util.List<RadComponent> selection)
public void addSelectionActions(DesignerEditorPanel designer, DefaultActionGroup actionGroup, javax.swing.JComponent shortcuts, java.util.List<RadComponent> selection)
public ICaption getCaption()
public RadLayout getLayout()
public void setLayout(RadLayout layout)
public RadLayoutData getLayoutData()
public java.util.List<Property> getProperties()
getProperties
in class PropertiesContainer
public java.util.List<Property> getProperties(java.lang.String key)
public java.lang.String getPropertyValue(java.lang.String name)
public java.util.List<Property> getInplaceProperties() throws java.lang.Exception
java.lang.Exception
public final <T> T getClientProperty(java.lang.String key)
public final <T> T extractClientProperty(java.lang.String key)
public final void setClientProperty(java.lang.Object key, java.lang.Object value)
public void accept(RadComponentVisitor visitor, boolean forward)
public void acceptChildren(RadComponentVisitor visitor, boolean forward)
protected java.util.List<RadComponent> getChildrenForAccept(RadComponentVisitor visitor)
public boolean canDelete()
public void delete() throws java.lang.Exception
java.lang.Exception
public void copyTo(Element parentElement) throws java.lang.Exception
java.lang.Exception
public RadComponent morphingTo(MetaModel target) throws java.lang.Exception
java.lang.Exception
public RadComponent wrapIn(MetaModel target) throws java.lang.Exception
java.lang.Exception
public static java.util.List<ErrorInfo> getError(RadComponent component)
public static void addError(RadComponent component, ErrorInfo errorInfo)
public static void clearErrors(RadComponent component)
public static java.util.Map<RadComponent,java.util.List<RadComponent>> groupSiblings(java.util.List<? extends RadComponent> components)
components
- the components to be groupedpublic static java.util.Set<RadComponent> getParents(java.util.List<? extends RadComponent> components)
public static boolean isParentsContainedIn(java.util.List<RadComponent> components, RadComponent component)
public static java.util.List<RadComponent> getPureSelection(java.util.List<RadComponent> selection)
public boolean isAncestorFor(RadComponent component, boolean strict)