当前位置: 首页>>代码示例>>Java>>正文


Java PositionConstants.TOP属性代码示例

本文整理汇总了Java中org.eclipse.draw2d.PositionConstants.TOP属性的典型用法代码示例。如果您正苦于以下问题:Java PositionConstants.TOP属性的具体用法?Java PositionConstants.TOP怎么用?Java PositionConstants.TOP使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.draw2d.PositionConstants的用法示例。


在下文中一共展示了PositionConstants.TOP属性的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;
	}
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:23,代码来源:AlignmentRequest.java

示例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;
    }
}
 
开发者ID:henrikor2,项目名称:eclipsensis,代码行数:22,代码来源:DistributionRequest.java

示例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();
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:40,代码来源:Align2ElementCommand.java

示例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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:30,代码来源:AlignCommand.java

示例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;
	}

}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:30,代码来源:AlignmentRequest.java

示例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;
    }


}
 
开发者ID:henrikor2,项目名称:eclipsensis,代码行数:34,代码来源:DistributionRequest.java

示例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;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:41,代码来源:Helper.java

示例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;
        }
    }
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:60,代码来源:ERDiagramAlignmentAction.java

示例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;
		}
	}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:65,代码来源:ERDiagramAlignmentAction.java

示例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;
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:66,代码来源:Align2Element.java

示例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;
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:65,代码来源:Align2BorderAction.java

示例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;
    }
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:48,代码来源:ERDiagramAlignmentAction.java

示例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;
	}
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:54,代码来源:AlignmentAction.java

示例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;
	}
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:57,代码来源:AlignmentRetargetAction.java


注:本文中的org.eclipse.draw2d.PositionConstants.TOP属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。