本文整理汇总了Java中org.eclipse.draw2d.PositionConstants.BOTTOM属性的典型用法代码示例。如果您正苦于以下问题:Java PositionConstants.BOTTOM属性的具体用法?Java PositionConstants.BOTTOM怎么用?Java PositionConstants.BOTTOM使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.draw2d.PositionConstants
的用法示例。
在下文中一共展示了PositionConstants.BOTTOM属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doNormalAlignment
private void doNormalAlignment(Rectangle result, Rectangle reference) {
switch (alignment) {
case PositionConstants.LEFT:
result.x = reference.x;
break;
case PositionConstants.RIGHT:
result.x = reference.x + reference.width - result.width;
break;
case PositionConstants.TOP:
result.y = reference.y;
break;
case PositionConstants.BOTTOM:
result.y = reference.y + reference.height - result.height;
break;
case PositionConstants.CENTER:
result.x = reference.x + (reference.width / 2) - (result.width / 2);
break;
case PositionConstants.MIDDLE:
result.y = reference.y + (reference.height / 2)
- (result.height / 2);
break;
}
}
示例2: doNormalAlignment
private void doNormalAlignment(Rectangle result, Rectangle reference) {
switch (alignment) {
case PositionConstants.LEFT:
result.x = reference.x;
break;
case PositionConstants.RIGHT:
result.x = reference.x + reference.width - result.width;
break;
case PositionConstants.TOP:
result.y = reference.y;
break;
case PositionConstants.BOTTOM:
result.y = reference.y + reference.height - result.height;
break;
case PositionConstants.CENTER:
result.x = reference.x + (reference.width / 2) - (result.width / 2);
break;
case PositionConstants.MIDDLE:
result.y = reference.y + (reference.height / 2) - (result.height / 2);
break;
}
}
示例3: execute
@Override
public void execute() {
setPositionCommands = new ArrayList<SetValueCommand>();
JRDesignElement designElement = primary.getValue();
for(MGraphicElement element : selection){
if (element != primary){
JRDesignElement selected = element.getValue();
switch (alignement) {
case PositionConstants.LEFT:
createCommand(JRDesignElement.PROPERTY_X, element, designElement.getX());
break;
case PositionConstants.RIGHT:
int rightPost = designElement.getX() + designElement.getWidth() - selected.getWidth();
createCommand(JRDesignElement.PROPERTY_X, element, rightPost);
break;
case PositionConstants.TOP:
createCommand(JRDesignElement.PROPERTY_Y, element, designElement.getY());
break;
case PositionConstants.BOTTOM:
int bottomPos = designElement.getY() + designElement.getHeight() - selected.getHeight();
createCommand(JRDesignElement.PROPERTY_Y, element, bottomPos);
break;
case PositionConstants.CENTER:
int centerVert = designElement.getX() + Math.abs(designElement.getWidth() - selected.getWidth())/2;
createCommand(JRDesignElement.PROPERTY_X, element, centerVert);
break;
case PositionConstants.MIDDLE:
int middle = designElement.getY() + Math.abs(designElement.getHeight() - selected.getHeight())/2;
createCommand(JRDesignElement.PROPERTY_Y, element, middle);
break;
default:
break;
}
}
}
//Execute the subcommands
for(Command cmd : setPositionCommands){
cmd.execute();
}
}
示例4: execute
@Override
public void execute() {
oldX = jrElement.getX();
oldY = jrElement.getY();
int newX = oldX;
int newY = oldY;
switch (alignement) {
case PositionConstants.LEFT:
newX = 0;
break;
case PositionConstants.RIGHT:
newX = parent.width - jrElement.getWidth();
break;
case PositionConstants.TOP:
newY = 0;
break;
case PositionConstants.BOTTOM:
newY = parent.height - jrElement.getHeight();
break;
case PositionConstants.CENTER:
newX = parent.width / 2 - jrElement.getWidth() / 2;
break;
case PositionConstants.MIDDLE:
newY = parent.height / 2 - jrElement.getHeight() / 2;
break;
}
jrElement.setX(newX);
jrElement.setY(newY);
}
示例5: doPrecisionAlignment
private void doPrecisionAlignment(PrecisionRectangle result,
PrecisionRectangle reference) {
switch (alignment) {
case PositionConstants.LEFT:
result.setPreciseX(reference.preciseX());
break;
case PositionConstants.RIGHT:
result.setPreciseX(reference.preciseX() + reference.preciseWidth()
- result.preciseWidth());
break;
case PositionConstants.TOP:
result.setPreciseY(reference.preciseY());
break;
case PositionConstants.BOTTOM:
result.setPreciseY(reference.preciseY() + reference.preciseHeight()
- result.preciseHeight());
break;
case PositionConstants.CENTER:
result.setPreciseX(reference.preciseX()
+ (reference.preciseWidth() / 2)
- (result.preciseWidth() / 2));
break;
case PositionConstants.MIDDLE:
result.setPreciseY(reference.preciseY()
+ (reference.preciseHeight() / 2)
- (result.preciseHeight() / 2));
break;
}
}
示例6: doPrecisionAlignment
private void doPrecisionAlignment(
PrecisionRectangle result,
PrecisionRectangle reference) {
switch (alignment) {
case PositionConstants.LEFT:
result.setX(reference.preciseX);
break;
case PositionConstants.RIGHT:
result.setX(
reference.preciseX + reference.preciseWidth - result.preciseWidth);
break;
case PositionConstants.TOP:
result.setY(reference.preciseY);
break;
case PositionConstants.BOTTOM:
result.setY(
reference.preciseY + reference.preciseHeight - result.preciseHeight);
break;
case PositionConstants.CENTER:
result.setX(
reference.preciseX
+ (reference.preciseWidth / 2)
- (result.preciseWidth / 2));
break;
case PositionConstants.MIDDLE:
result.setY(
reference.preciseY
+ (reference.preciseHeight / 2)
- (result.preciseHeight / 2));
break;
}
}
示例7: convertPosition
public static int convertPosition ( final String position, final int defaultValue )
{
if ( "CENTER".equals ( position ) )
{
return PositionConstants.CENTER;
}
else if ( "LEFT".equals ( position ) )
{
return PositionConstants.LEFT;
}
else if ( "RIGHT".equals ( position ) )
{
return PositionConstants.RIGHT;
}
else if ( "TOP".equals ( position ) )
{
return PositionConstants.TOP;
}
else if ( "BOTTOM".equals ( position ) )
{
return PositionConstants.BOTTOM;
}
else if ( "EAST".equals ( position ) )
{
return PositionConstants.EAST;
}
else if ( "WEST".equals ( position ) )
{
return PositionConstants.WEST;
}
else if ( "NORTH".equals ( position ) )
{
return PositionConstants.NORTH;
}
else if ( "SOUTH".equals ( position ) )
{
return PositionConstants.SOUTH;
}
return defaultValue;
}
示例8: initUI
/**
* Initializes the actions UI presentation.
*/
protected void initUI() {
switch (alignment) {
case PositionConstants.LEFT:
setId(GEFActionConstants.ALIGN_LEFT);
setText(ALIGNMENT_ACTION_LEFT.getText());
setToolTipText(ALIGNMENT_ACTION_LEFT.getToolTipText());
setImageDescriptor(ERDiagramActivator.getImageDescriptor(ImageKey.ALIGN_LEFT));
// setDisabledImageDescriptor(ALIGNMENT_ACTION_LEFT
// .getDisabledImageDescriptor());
break;
case PositionConstants.RIGHT:
setId(GEFActionConstants.ALIGN_RIGHT);
setText(ALIGNMENT_ACTION_RIGHT.getText());
setToolTipText(ALIGNMENT_ACTION_RIGHT.getToolTipText());
setImageDescriptor(ERDiagramActivator.getImageDescriptor(ImageKey.ALIGN_RIGHT));
// setDisabledImageDescriptor(ALIGNMENT_ACTION_RIGHT
// .getDisabledImageDescriptor());
break;
case PositionConstants.TOP:
setId(GEFActionConstants.ALIGN_TOP);
setText(ALIGNMENT_ACTION_TOP.getText());
setToolTipText(ALIGNMENT_ACTION_TOP.getToolTipText());
setImageDescriptor(ERDiagramActivator.getImageDescriptor(ImageKey.ALIGN_TOP));
// setDisabledImageDescriptor(ALIGNMENT_ACTION_TOP
// .getDisabledImageDescriptor());
break;
case PositionConstants.BOTTOM:
setId(GEFActionConstants.ALIGN_BOTTOM);
setText(ALIGNMENT_ACTION_BOTTOM.getText());
setToolTipText(ALIGNMENT_ACTION_BOTTOM.getToolTipText());
setImageDescriptor(ERDiagramActivator.getImageDescriptor(ImageKey.ALIGN_BOTTOM));
// setDisabledImageDescriptor(ALIGNMENT_ACTION_BOTTOM
// .getDisabledImageDescriptor());
break;
case PositionConstants.CENTER:
setId(GEFActionConstants.ALIGN_CENTER);
setText(ALIGNMENT_ACTION_CENTER.getText());
setToolTipText(ALIGNMENT_ACTION_CENTER.getToolTipText());
setImageDescriptor(ERDiagramActivator.getImageDescriptor(ImageKey.ALIGN_CENTER));
// setDisabledImageDescriptor(ALIGNMENT_ACTION_CENTER
// .getDisabledImageDescriptor());
break;
case PositionConstants.MIDDLE:
setId(GEFActionConstants.ALIGN_MIDDLE);
setText(ALIGNMENT_ACTION_MIDDLE.getText());
setToolTipText(ALIGNMENT_ACTION_MIDDLE.getToolTipText());
setImageDescriptor(ERDiagramActivator.getImageDescriptor(ImageKey.ALIGN_MIDDLE));
// setDisabledImageDescriptor(ALIGNMENT_ACTION_MIDDLE
// .getDisabledImageDescriptor());
break;
}
}
示例9: initUI
/**
* Initializes the actions UI presentation.
*/
protected void initUI() {
switch (alignment) {
case PositionConstants.LEFT:
setId(GEFActionConstants.ALIGN_LEFT);
setText(ALIGNMENT_ACTION_LEFT.getText());
setToolTipText(ALIGNMENT_ACTION_LEFT.getToolTipText());
setImageDescriptor(ERDiagramActivator
.getImageDescriptor(ImageKey.ALIGN_LEFT));
// setDisabledImageDescriptor(ALIGNMENT_ACTION_LEFT
// .getDisabledImageDescriptor());
break;
case PositionConstants.RIGHT:
setId(GEFActionConstants.ALIGN_RIGHT);
setText(ALIGNMENT_ACTION_RIGHT.getText());
setToolTipText(ALIGNMENT_ACTION_RIGHT.getToolTipText());
setImageDescriptor(ERDiagramActivator
.getImageDescriptor(ImageKey.ALIGN_RIGHT));
// setDisabledImageDescriptor(ALIGNMENT_ACTION_RIGHT
// .getDisabledImageDescriptor());
break;
case PositionConstants.TOP:
setId(GEFActionConstants.ALIGN_TOP);
setText(ALIGNMENT_ACTION_TOP.getText());
setToolTipText(ALIGNMENT_ACTION_TOP.getToolTipText());
setImageDescriptor(ERDiagramActivator.getImageDescriptor(ImageKey.ALIGN_TOP));
// setDisabledImageDescriptor(ALIGNMENT_ACTION_TOP
// .getDisabledImageDescriptor());
break;
case PositionConstants.BOTTOM:
setId(GEFActionConstants.ALIGN_BOTTOM);
setText(ALIGNMENT_ACTION_BOTTOM.getText());
setToolTipText(ALIGNMENT_ACTION_BOTTOM.getToolTipText());
setImageDescriptor(ERDiagramActivator
.getImageDescriptor(ImageKey.ALIGN_BOTTOM));
// setDisabledImageDescriptor(ALIGNMENT_ACTION_BOTTOM
// .getDisabledImageDescriptor());
break;
case PositionConstants.CENTER:
setId(GEFActionConstants.ALIGN_CENTER);
setText(ALIGNMENT_ACTION_CENTER.getText());
setToolTipText(ALIGNMENT_ACTION_CENTER.getToolTipText());
setImageDescriptor(ERDiagramActivator
.getImageDescriptor(ImageKey.ALIGN_CENTER));
// setDisabledImageDescriptor(ALIGNMENT_ACTION_CENTER
// .getDisabledImageDescriptor());
break;
case PositionConstants.MIDDLE:
setId(GEFActionConstants.ALIGN_MIDDLE);
setText(ALIGNMENT_ACTION_MIDDLE.getText());
setToolTipText(ALIGNMENT_ACTION_MIDDLE.getToolTipText());
setImageDescriptor(ERDiagramActivator
.getImageDescriptor(ImageKey.ALIGN_MIDDLE));
// setDisabledImageDescriptor(ALIGNMENT_ACTION_MIDDLE
// .getDisabledImageDescriptor());
break;
}
}
示例10: initUI
/**
* Initializes the actions UI presentation.
*/
protected void initUI() {
switch (alignment) {
case PositionConstants.LEFT:
setId(ID_ALIGN_LEFT);
setText(Messages.Align2Element_Align_To_Left);
setToolTipText(Messages.Align2Element_Align_To_Left_tool_tip);
setImageDescriptor(
JaspersoftStudioPlugin.getInstance().getImageDescriptor("icons/resources/eclipse/align-left.gif")); //$NON-NLS-1$
setDisabledImageDescriptor(
JaspersoftStudioPlugin.getInstance().getImageDescriptor("icons/resources/eclipse/disabled/align-left.gif")); //$NON-NLS-1$
break;
case PositionConstants.RIGHT:
setId(ID_ALIGN_RIGHT);
setText(Messages.Align2Element_Align_To_Right);
setToolTipText(Messages.Align2Element_Align_To_Right_tool_tip);
setImageDescriptor(
JaspersoftStudioPlugin.getInstance().getImageDescriptor("icons/resources/eclipse/align-right.gif")); //$NON-NLS-1$
setDisabledImageDescriptor(
JaspersoftStudioPlugin.getInstance().getImageDescriptor("icons/resources/eclipse/disabled/align-right.gif")); //$NON-NLS-1$
break;
case PositionConstants.TOP:
setId(ID_ALIGN_TOP);
setText(Messages.Align2Element_Align_To_Top);
setToolTipText(Messages.Align2Element_Align_To_Top_tool_tip);
setImageDescriptor(
JaspersoftStudioPlugin.getInstance().getImageDescriptor("icons/resources/eclipse/align-top.gif")); //$NON-NLS-1$
setDisabledImageDescriptor(
JaspersoftStudioPlugin.getInstance().getImageDescriptor("icons/resources/eclipse/disabled/align-top.gif")); //$NON-NLS-1$
break;
case PositionConstants.BOTTOM:
setId(ID_ALIGN_BOTTOM);
setText(Messages.Align2Element_Align_To_Bottom);
setToolTipText(Messages.Align2Element_Align_To_Bottom_tool_tip);
setImageDescriptor(
JaspersoftStudioPlugin.getInstance().getImageDescriptor("icons/resources/eclipse/align-bottom.gif")); //$NON-NLS-1$
setDisabledImageDescriptor(
JaspersoftStudioPlugin.getInstance().getImageDescriptor("icons/resources/eclipse/disabled/align-bottom.gif")); //$NON-NLS-1$
break;
case PositionConstants.CENTER:
setId(ID_ALIGN_CENTER);
setText(Messages.Align2Element_Align_To_Center);
setToolTipText(Messages.Align2Element_Align_To_Center_tool_tip);
setImageDescriptor(
JaspersoftStudioPlugin.getInstance().getImageDescriptor("icons/resources/eclipse/align-center.gif")); //$NON-NLS-1$
setDisabledImageDescriptor(
JaspersoftStudioPlugin.getInstance().getImageDescriptor("icons/resources/eclipse/disabled/align-center.gif")); //$NON-NLS-1$
break;
case PositionConstants.MIDDLE:
setId(ID_ALIGN_MIDDLE);
setText(Messages.Align2Element_Align_To_Middle);
setToolTipText(Messages.Align2Element_Align_To_Middle_tooltip);
setImageDescriptor(
JaspersoftStudioPlugin.getInstance().getImageDescriptor("icons/resources/eclipse/align-middle.gif")); //$NON-NLS-1$
setDisabledImageDescriptor(
JaspersoftStudioPlugin.getInstance().getImageDescriptor("icons/resources/eclipse/disabled/align-middle.gif")); //$NON-NLS-1$
break;
}
}
示例11: initUI
/**
* Initializes the actions UI presentation.
*/
protected void initUI() {
switch (alignment) {
case PositionConstants.LEFT:
setId(ID_ALIGN_LEFT);
setText(Messages.Align2BorderAction_align_to_left);
setToolTipText(Messages.Align2BorderAction_align_to_left_tool_tip);
setImageDescriptor(JaspersoftStudioPlugin.getInstance().getImageDescriptor(
"icons/resources/eclipse/align-band-left.gif")); //$NON-NLS-1$
setDisabledImageDescriptor(JaspersoftStudioPlugin.getInstance().getImageDescriptor(
"icons/resources/eclipse/disabled/align-band-left.gif")); //$NON-NLS-1$
break;
case PositionConstants.RIGHT:
setId(ID_ALIGN_RIGHT);
setText(Messages.Align2BorderAction_align_to_right);
setToolTipText(Messages.Align2BorderAction_align_to_right_tool_tip);
setImageDescriptor(JaspersoftStudioPlugin.getInstance().getImageDescriptor(
"icons/resources/eclipse/align-band-right.gif")); //$NON-NLS-1$
setDisabledImageDescriptor(JaspersoftStudioPlugin.getInstance().getImageDescriptor(
"icons/resources/eclipse/disabled/align-band-right.gif")); //$NON-NLS-1$
break;
case PositionConstants.TOP:
setId(ID_ALIGN_TOP);
setText(Messages.Align2BorderAction_align_to_top);
setToolTipText(Messages.Align2BorderAction_align_to_top_tool_tip);
setImageDescriptor(JaspersoftStudioPlugin.getInstance().getImageDescriptor(
"icons/resources/eclipse/align-band-top.gif")); //$NON-NLS-1$
setDisabledImageDescriptor(JaspersoftStudioPlugin.getInstance().getImageDescriptor(
"icons/resources/eclipse/disabled/align-band-top.gif")); //$NON-NLS-1$
break;
case PositionConstants.BOTTOM:
setId(ID_ALIGN_BOTTOM);
setText(Messages.Align2BorderAction_align_to_bottom);
setToolTipText(Messages.Align2BorderAction_align_to_bottom_tool_tip);
setImageDescriptor(JaspersoftStudioPlugin.getInstance().getImageDescriptor(
"icons/resources/eclipse/align-band-bottom.gif")); //$NON-NLS-1$
setDisabledImageDescriptor(JaspersoftStudioPlugin.getInstance().getImageDescriptor(
"icons/resources/eclipse/disabled/align-band-bottom.gif")); //$NON-NLS-1$
break;
case PositionConstants.CENTER:
setId(ID_ALIGN_CENTER);
setText(Messages.Align2BorderAction_align_to_center);
setToolTipText(Messages.Align2BorderAction_align_to_center_tool_tip);
setImageDescriptor(JaspersoftStudioPlugin.getInstance().getImageDescriptor(
"icons/resources/eclipse/align-band-center.gif")); //$NON-NLS-1$
setDisabledImageDescriptor(JaspersoftStudioPlugin.getInstance().getImageDescriptor(
"icons/resources/eclipse/disabled/align-band-center.gif")); //$NON-NLS-1$
break;
case PositionConstants.MIDDLE:
setId(ID_ALIGN_MIDDLE);
setText(Messages.Align2BorderAction_align_to_middle);
setToolTipText(Messages.Align2BorderAction_align_to_middle_tool_tip);
setImageDescriptor(JaspersoftStudioPlugin.getInstance().getImageDescriptor(
"icons/resources/eclipse/align-band-middle.gif")); //$NON-NLS-1$
setDisabledImageDescriptor(JaspersoftStudioPlugin.getInstance().getImageDescriptor(
"icons/resources/eclipse/disabled/align-band-middle.gif")); //$NON-NLS-1$
break;
}
}
示例12: initUI
/**
* Initializes the actions UI presentation.
*/
protected void initUI() {
switch (alignment) {
case PositionConstants.LEFT:
setId(GEFActionConstants.ALIGN_LEFT);
setText(ALIGNMENT_ACTION_LEFT.getText());
setToolTipText(ALIGNMENT_ACTION_LEFT.getToolTipText());
setImageDescriptor(Activator.getImageDescriptor(ImageKey.ALIGN_LEFT));
break;
case PositionConstants.RIGHT:
setId(GEFActionConstants.ALIGN_RIGHT);
setText(ALIGNMENT_ACTION_RIGHT.getText());
setToolTipText(ALIGNMENT_ACTION_RIGHT.getToolTipText());
setImageDescriptor(Activator.getImageDescriptor(ImageKey.ALIGN_RIGHT));
break;
case PositionConstants.TOP:
setId(GEFActionConstants.ALIGN_TOP);
setText(ALIGNMENT_ACTION_TOP.getText());
setToolTipText(ALIGNMENT_ACTION_TOP.getToolTipText());
setImageDescriptor(Activator.getImageDescriptor(ImageKey.ALIGN_TOP));
break;
case PositionConstants.BOTTOM:
setId(GEFActionConstants.ALIGN_BOTTOM);
setText(ALIGNMENT_ACTION_BOTTOM.getText());
setToolTipText(ALIGNMENT_ACTION_BOTTOM.getToolTipText());
setImageDescriptor(Activator.getImageDescriptor(ImageKey.ALIGN_BOTTOM));
break;
case PositionConstants.CENTER:
setId(GEFActionConstants.ALIGN_CENTER);
setText(ALIGNMENT_ACTION_CENTER.getText());
setToolTipText(ALIGNMENT_ACTION_CENTER.getToolTipText());
setImageDescriptor(Activator.getImageDescriptor(ImageKey.ALIGN_CENTER));
break;
case PositionConstants.MIDDLE:
setId(GEFActionConstants.ALIGN_MIDDLE);
setText(ALIGNMENT_ACTION_MIDDLE.getText());
setToolTipText(ALIGNMENT_ACTION_MIDDLE.getToolTipText());
setImageDescriptor(Activator.getImageDescriptor(ImageKey.ALIGN_MIDDLE));
break;
}
}
示例13: initUI
/**
* Initializes the actions UI presentation.
*/
protected void initUI() {
switch (alignment) {
case PositionConstants.LEFT:
setId(GEFActionConstants.ALIGN_LEFT);
setText(GEFMessages.AlignLeftAction_Label);
setToolTipText(GEFMessages.AlignLeftAction_Tooltip);
setImageDescriptor(InternalImages.DESC_HORZ_ALIGN_LEFT);
setDisabledImageDescriptor(InternalImages.DESC_HORZ_ALIGN_LEFT_DIS);
break;
case PositionConstants.RIGHT:
setId(GEFActionConstants.ALIGN_RIGHT);
setText(GEFMessages.AlignRightAction_Label);
setToolTipText(GEFMessages.AlignRightAction_Tooltip);
setImageDescriptor(InternalImages.DESC_HORZ_ALIGN_RIGHT);
setDisabledImageDescriptor(InternalImages.DESC_HORZ_ALIGN_RIGHT_DIS);
break;
case PositionConstants.TOP:
setId(GEFActionConstants.ALIGN_TOP);
setText(GEFMessages.AlignTopAction_Label);
setToolTipText(GEFMessages.AlignTopAction_Tooltip);
setImageDescriptor(InternalImages.DESC_VERT_ALIGN_TOP);
setDisabledImageDescriptor(InternalImages.DESC_VERT_ALIGN_TOP_DIS);
break;
case PositionConstants.BOTTOM:
setId(GEFActionConstants.ALIGN_BOTTOM);
setText(GEFMessages.AlignBottomAction_Label);
setToolTipText(GEFMessages.AlignBottomAction_Tooltip);
setImageDescriptor(InternalImages.DESC_VERT_ALIGN_BOTTOM);
setDisabledImageDescriptor(InternalImages.DESC_VERT_ALIGN_BOTTOM_DIS);
break;
case PositionConstants.CENTER:
setId(GEFActionConstants.ALIGN_CENTER);
setText(GEFMessages.AlignCenterAction_Label);
setToolTipText(GEFMessages.AlignCenterAction_Tooltip);
setImageDescriptor(InternalImages.DESC_HORZ_ALIGN_CENTER);
setDisabledImageDescriptor(InternalImages.DESC_HORZ_ALIGN_CENTER_DIS);
break;
case PositionConstants.MIDDLE:
setId(GEFActionConstants.ALIGN_MIDDLE);
setText(GEFMessages.AlignMiddleAction_Label);
setToolTipText(GEFMessages.AlignMiddleAction_Tooltip);
setImageDescriptor(InternalImages.DESC_VERT_ALIGN_MIDDLE);
setDisabledImageDescriptor(InternalImages.DESC_VERT_ALIGN_MIDDLE_DIS);
break;
}
}
示例14: AlignmentRetargetAction
/**
* Constructs a new AlignmentRetargetAction with the default ID, label and
* image based on the given alignment constant. Possible values are
* {@link PositionConstants#BOTTOM}, {@link PositionConstants#CENTER},
* {@link PositionConstants#LEFT}, {@link PositionConstants#MIDDLE},
* {@link PositionConstants#RIGHT}, and {@link PositionConstants#TOP}.
*
* @param align
* the alignment.
*/
public AlignmentRetargetAction(int align) {
super(null, null);
switch (align) {
case PositionConstants.BOTTOM:
setId(GEFActionConstants.ALIGN_BOTTOM);
setText(GEFMessages.AlignBottomAction_Label);
setToolTipText(GEFMessages.AlignBottomAction_Tooltip);
setImageDescriptor(InternalImages.DESC_VERT_ALIGN_BOTTOM);
setDisabledImageDescriptor(InternalImages.DESC_VERT_ALIGN_BOTTOM_DIS);
break;
case PositionConstants.CENTER:
setId(GEFActionConstants.ALIGN_CENTER);
setText(GEFMessages.AlignCenterAction_Label);
setToolTipText(GEFMessages.AlignCenterAction_Tooltip);
setImageDescriptor(InternalImages.DESC_HORZ_ALIGN_CENTER);
setDisabledImageDescriptor(InternalImages.DESC_HORZ_ALIGN_CENTER_DIS);
break;
case PositionConstants.LEFT:
setId(GEFActionConstants.ALIGN_LEFT);
setText(GEFMessages.AlignLeftAction_Label);
setToolTipText(GEFMessages.AlignLeftAction_Tooltip);
setImageDescriptor(InternalImages.DESC_HORZ_ALIGN_LEFT);
setDisabledImageDescriptor(InternalImages.DESC_HORZ_ALIGN_LEFT_DIS);
break;
case PositionConstants.MIDDLE:
setId(GEFActionConstants.ALIGN_MIDDLE);
setText(GEFMessages.AlignMiddleAction_Label);
setToolTipText(GEFMessages.AlignMiddleAction_Tooltip);
setImageDescriptor(InternalImages.DESC_VERT_ALIGN_MIDDLE);
setDisabledImageDescriptor(InternalImages.DESC_VERT_ALIGN_MIDDLE_DIS);
break;
case PositionConstants.RIGHT:
setId(GEFActionConstants.ALIGN_RIGHT);
setText(GEFMessages.AlignRightAction_Label);
setToolTipText(GEFMessages.AlignRightAction_Tooltip);
setImageDescriptor(InternalImages.DESC_HORZ_ALIGN_RIGHT);
setDisabledImageDescriptor(InternalImages.DESC_HORZ_ALIGN_RIGHT_DIS);
break;
case PositionConstants.TOP:
setId(GEFActionConstants.ALIGN_TOP);
setText(GEFMessages.AlignTopAction_Label);
setToolTipText(GEFMessages.AlignTopAction_Tooltip);
setImageDescriptor(InternalImages.DESC_VERT_ALIGN_TOP);
setDisabledImageDescriptor(InternalImages.DESC_VERT_ALIGN_TOP_DIS);
break;
}
}