Search in sources :

Example 6 with LineBorder

use of org.eclipse.draw2d.LineBorder in project cubrid-manager by CUBRID.

the class TablePart method setFocus.

@Override
public void setFocus(boolean hasFocus) {
    TableFigure tableFigure = (TableFigure) getFigure();
    LineBorder lineBorder = (LineBorder) tableFigure.getBorder();
    if (hasFocus) {
        lineBorder.setWidth(2);
    } else {
        lineBorder.setWidth(1);
    }
}
Also used : TableFigure(com.cubrid.common.ui.er.figures.TableFigure) LineBorder(org.eclipse.draw2d.LineBorder)

Example 7 with LineBorder

use of org.eclipse.draw2d.LineBorder in project yamcs-studio by yamcs.

the class ScrollbarFigure method initializeParts.

/**
 * Initilization of the ScrollBar. Sets the Scrollbar to have a ScrollBarLayout with vertical orientation. Creates
 * the Figures that make up the components of the ScrollBar.
 *
 * @since 2.0
 */
protected void initializeParts() {
    setLayoutManager(new ScrollBarFigureLayout(transposer));
    setUpClickable(createDefaultUpButton());
    setDownClickable(createDefaultDownButton());
    setPageUp(createPageUp());
    setPageDown(createPageDown());
    setThumb(createDefaultThumb());
    label = new Label();
    label.setBackgroundColor(LABEL_COLOR);
    label.setBorder(new LineBorder(GRAY_COLOR));
    label.setVisible(false);
    // $NON-NLS-1$
    add(label, "Label");
}
Also used : LineBorder(org.eclipse.draw2d.LineBorder) Label(org.eclipse.draw2d.Label)

Example 8 with LineBorder

use of org.eclipse.draw2d.LineBorder in project yamcs-studio by yamcs.

the class TabFigure method createTabLabel.

private Label createTabLabel(String title, final int index) {
    final Label tabLabel = new Label(title) {

        @Override
        protected void paintFigure(Graphics graphics) {
            graphics.pushState();
            graphics.setForegroundColor(TAB_3D_COLOR);
            graphics.fillGradient(getClientArea(), horizontal);
            graphics.popState();
            super.paintFigure(graphics);
        }
    };
    tabLabel.setLabelAlignment(PositionConstants.CENTER);
    tabLabel.setOpaque(false);
    tabLabel.setBorder(new LineBorder(BORDER_COLOR));
    tabLabel.setBackgroundColor(getDarkColor(DEFAULT_TABCOLOR));
    // tabLabel.setCursor(Cursors.HAND);
    tabLabel.addMouseListener(new MouseListener.Stub() {

        @Override
        public void mousePressed(MouseEvent me) {
            if (me.button != 1)
                return;
            setActiveTabIndex(tabLabelList.indexOf(tabLabel));
        }
    });
    return tabLabel;
}
Also used : Graphics(org.eclipse.draw2d.Graphics) MouseListener(org.eclipse.draw2d.MouseListener) MouseEvent(org.eclipse.draw2d.MouseEvent) LineBorder(org.eclipse.draw2d.LineBorder) Label(org.eclipse.draw2d.Label)

Example 9 with LineBorder

use of org.eclipse.draw2d.LineBorder in project cogtool by cogtool.

the class DesignEditorFrame method addSpeakerBox.

protected void addSpeakerBox() {
    speakerBox.setBorder(new LineBorder(ColorConstants.black, 1));
    speakerBox.setOpaque(true);
    Image speakerIconImg = getSpeakerIconImage();
    // TODO: handle getImage returning null
    org.eclipse.swt.graphics.Rectangle bds = speakerIconImg.getBounds();
    IFigure speakerImgFig = new ImageFigure(speakerIconImg);
    IFigure speakerImgToolTip = new Label(L10N.get("DEF.SpeakerText", "Speaker text"));
    speakerImgFig.setToolTip(speakerImgToolTip);
    speakerImgWidth = bds.width;
    speakerImgHeight = bds.height;
    speakerLayout.setConstraint(speakerImgFig, new Rectangle(0, 0, bds.width, bds.height));
    speakerBox.add(speakerImgFig);
    RectangleFigure speakerEastBorder = new RectangleFigure();
    speakerEastBorder.setBorder(new LineBorder(ColorConstants.black, 1));
    speakerLayout.setConstraint(speakerEastBorder, new Rectangle(speakerImgWidth, 0, SPEAKER_DIVIDER_WIDTH, speakerImgHeight));
    speakerBox.add(speakerEastBorder);
    timeWestBorder = new RectangleFigure();
    timeWestBorder.setBorder(new LineBorder(ColorConstants.black, 1));
    speakerBox.add(timeWestBorder);
    String text = frame.getSpeakerText();
    speakerText = new Label(text);
    speakerText.setLabelAlignment(PositionConstants.LEFT);
    speakerTextToolTip = new Label(text);
    if ((text != null) && !text.equals("")) {
        speakerText.setToolTip(speakerTextToolTip);
    }
    speakerBox.add(speakerText);
    divider = new RectangleFigure();
    divider.setBorder(new LineBorder(ColorConstants.black, 1));
    speakerBox.add(divider);
    double listenTimeInSecs = frame.getListenTimeInSecs();
    listenTime = new Label((listenTimeInSecs == Frame.NO_LISTEN_TIME) ? NO_LISTEN_TIME_LABEL : Double.toString(listenTimeInSecs));
    listenTime.setLabelAlignment(PositionConstants.RIGHT);
    speakerBox.add(listenTime);
    Label listenTimeToolTip = new Label(LISTEN_TIME_TOOLTIP);
    listenTime.setToolTip(listenTimeToolTip);
}
Also used : RectangleFigure(org.eclipse.draw2d.RectangleFigure) LineBorder(org.eclipse.draw2d.LineBorder) Label(org.eclipse.draw2d.Label) Rectangle(org.eclipse.draw2d.geometry.Rectangle) ImageFigure(org.eclipse.draw2d.ImageFigure) Image(org.eclipse.swt.graphics.Image) IFigure(org.eclipse.draw2d.IFigure)

Example 10 with LineBorder

use of org.eclipse.draw2d.LineBorder in project cubrid-manager by CUBRID.

the class TableFigure method setDisableState.

public void setDisableState() {
    LineBorder lineBorder = (LineBorder) this.getBorder();
    this.setBackgroundColor(disableBackgroundColor);
    lineBorder.setColor(disableBorderColor);
}
Also used : LineBorder(org.eclipse.draw2d.LineBorder)

Aggregations

LineBorder (org.eclipse.draw2d.LineBorder)18 Label (org.eclipse.draw2d.Label)6 Figure (org.eclipse.draw2d.Figure)3 IFigure (org.eclipse.draw2d.IFigure)3 MarginBorder (org.eclipse.draw2d.MarginBorder)3 ToolbarLayout (org.eclipse.draw2d.ToolbarLayout)3 Image (org.eclipse.swt.graphics.Image)3 ImageFigure (org.eclipse.draw2d.ImageFigure)2 RectangleFigure (org.eclipse.draw2d.RectangleFigure)2 ScrollPane (org.eclipse.draw2d.ScrollPane)2 Point (org.eclipse.draw2d.geometry.Point)2 ECoreImage (org.talend.commons.ui.runtime.image.ECoreImage)2 SimpleHtmlFigure (org.talend.commons.ui.utils.workbench.gef.SimpleHtmlFigure)2 TableFigure (com.cubrid.common.ui.er.figures.TableFigure)1 List (java.util.List)1 Graphics (org.eclipse.draw2d.Graphics)1 MouseEvent (org.eclipse.draw2d.MouseEvent)1 MouseListener (org.eclipse.draw2d.MouseListener)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1 Color (org.eclipse.swt.graphics.Color)1