protected final void createGap(int width) { width = (int)(width * width_multiplier ); // We create a label just so we can attach the menu to it. assertConstructing(); Label result = new Label(splash, SWT.NONE); result.setBackground(Colors.blues[Colors.BLUES_LIGHTEST]); result.setForeground(Colors.blues[Colors.BLUES_DARKEST]); result.setText(""); result.addMouseListener(this.mListener); result.addMouseMoveListener(this.mMoveListener); result.setLocation(this.xSize, 0); result.setSize(width, hSize); result.setMenu(this.menu); this.xSize += width; }
protected final Label createFixedLabel(int width) { assertConstructing(); Label result = new Label(splash, SWT.NONE); result.setBackground(Colors.white); result.setSize(width, SWT.DEFAULT ); result.setLocation(this.xSize, 0); result.addMouseListener(this.mListener); result.addMouseMoveListener(this.mMoveListener); result.setMenu(this.menu); if (this.hSize == -1) { int hSizeText = result.getSize().y; int hSizeImage = this.lDrag.getSize().y; this.hSize = hSizeText > hSizeImage ? hSizeText : hSizeImage; } this.xSize += width; return( result ); }
/** * Configure shell. */ void createContent(Composite parent) { canvas = new Canvas(parent, SWT.DOUBLE_BUFFERED | SWT.NONE | SWT.NO_REDRAW_RESIZE | SWT.V_SCROLL | SWT.H_SCROLL); canvas.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); origin = new org.eclipse.swt.graphics.Point(0, 0); size = START_SCREEN_SIZE; canvas.addPaintListener(this); canvas.addControlListener(this); this.layout(); timeLabel = new Label(canvas, SWT.NONE); timeLabel.setText("hello world"); timeLabel.pack(); timeLabel.setLocation(TIME_LABEL_LOC); timeLabel .setBackground(canvas.getDisplay().getSystemColor(SWT.COLOR_WHITE)); hBar = canvas.getHorizontalBar(); hBar.addSelectionListener(this); vBar = canvas.getVerticalBar(); vBar.addSelectionListener(this); }
caretLabel.setLocation(p); caretLabel.setVisible(true);
protected final Label createFixedTextLabel(String msg_key, boolean add_colon, boolean bold) { assertConstructing(); Label result = new Label(splash, SWT.NONE); result.setBackground(Colors.blues[Colors.BLUES_LIGHTEST]); result.setForeground(Colors.blues[Colors.BLUES_DARKEST]); result.setText(MessageText.getString(msg_key) + ((add_colon) ? ":" : "")); if (bold) { if (this.bold_font == null) { this.bold_font = createBoldFont(result.getFont()); } result.setFont(this.bold_font); } result.addMouseListener(this.mListener); result.addMouseMoveListener(this.mMoveListener); result.pack(); result.setLocation(this.xSize, 0); result.setMenu(this.menu); if (this.hSize == -1) { int hSizeText = result.getSize().y; int hSizeImage = this.lDrag.getSize().y; this.hSize = hSizeText > hSizeImage ? hSizeText : hSizeImage; } this.xSize += result.getSize().x + 3; return( result ); }
yPad = ( testTextHeight - lDragSize.y )/2; lDrag.setLocation(0, yPad);