Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.PaintListener


        // this.setBackgroundMode(SWT.INHERIT_DEFAULT);

        /*
         * Updates the rounded rectangle background.
         */
        this.addPaintListener(new PaintListener() {
            public void paintControl(PaintEvent e) {
                if (RoundedComposite.this.backgroundColor == null)
                    return;

                Rectangle bounds = RoundedComposite.this.getBounds();
View Full Code Here


        public void createControl(Composite parent) {
            final Composite composite = new Composite(parent, SWT.NONE);
            setControl(composite);

            if (this.contentImage != null) {
                composite.addPaintListener(new PaintListener() {
                    public void paintControl(PaintEvent e) {
                        Rectangle clientArea = composite.getClientArea();

                        int imgWidth = contentImage.getBounds().width;
                        int imgHeight = contentImage.getBounds().height;
View Full Code Here

      itemComposite.setLayout(itemCompositeLayout);

      final LegendItem item = items[i];
      final Label legendItemColor = new Label(itemComposite, SWT.NONE);
      legendItemColor.setText("AA");
      legendItemColor.addPaintListener(new PaintListener() {
        public void paintControl(final PaintEvent e) {
          final Point s = legendItemColor.getSize();
          e.gc.setBackground(item.color);
          e.gc.fillRectangle(0, 0, s.x, s.y);
        }
View Full Code Here

    final Point buildIdPoint = new Point(350, 200);
    final String bundleVersion = "v"
        + Activator.getDefault().getBundle().getHeaders().get("Bundle-Version");

    getContent().addPaintListener(new PaintListener()
    {
      public void paintControl(PaintEvent e)
      {
        e.gc.setForeground(getForeground());
        e.gc.drawText(bundleVersion, buildIdPoint.x, buildIdPoint.y, true);
View Full Code Here

      public void widgetDefaultSelected(SelectionEvent e) {
      }
    };

    PaintListener pl = new PaintListener() {
      public void paintControl(PaintEvent e) {
        int border = 4;
        String colorStr = Settings.getSettings().getOutputColors()
            .get(e.widget.getData());
        e.gc.setBackground(customs.colors.get(colorStr));
        e.gc.fillRectangle(border, border, e.width - 2 * border,
            e.height - 2 * border);
      }
    };

    for (Combo c : messageColorCombos) {
      c.add("white");
      c.add("black");
      c.add("dark blue");
      c.add("dark green");
      c.add("red");
      c.add("brown");
      c.add("purple");
      c.add("olive");
      c.add("yellow");
      c.add("green");
      c.add("teal");
      c.add("cyan");
      c.add("blue");
      c.add("magenta");
      c.add("dark gray");
      c.add("light gray");

      String colorStr = Settings.getSettings().getOutputColors()
          .get((Short) c.getData());
      c.setText(colorStr);
      c.addSelectionListener(IRCColorListener);
      c.addPaintListener(pl);
    }

    List<Button> statusColorButtons = new ArrayList<Button>();

    Group grpRoomStatusColors = new Group(this, SWT.NONE);
    grpRoomStatusColors.setText("Room Status Colors");
    grpRoomStatusColors.setBounds(218, 10, 202, 177);

    Label lblNormal = new Label(grpRoomStatusColors, SWT.NONE);
    lblNormal.setText("Normal");
    lblNormal.setBounds(10, 23, 85, 15);

    Button btnNormal = new Button(grpRoomStatusColors, SWT.NONE);
    btnNormal.setBounds(117, 18, 75, 25);
    btnNormal.setData(Room.NORMAL);
    statusColorButtons.add(btnNormal);

    Label lblNewIrcEvent = new Label(grpRoomStatusColors, SWT.NONE);
    lblNewIrcEvent.setText("New IRC Event");
    lblNewIrcEvent.setBounds(10, 56, 85, 15);

    Button btnIRCEvent = new Button(grpRoomStatusColors, SWT.NONE);
    btnIRCEvent.setBounds(117, 51, 75, 25);
    btnIRCEvent.setData(Room.NEW_IRC_EVENT);
    statusColorButtons.add(btnIRCEvent);

    Label lblNewMessage = new Label(grpRoomStatusColors, SWT.NONE);
    lblNewMessage.setText("New Message");
    lblNewMessage.setBounds(10, 87, 85, 15);

    Button btnNewMSG = new Button(grpRoomStatusColors, SWT.NONE);
    btnNewMSG.setBounds(117, 82, 75, 25);
    btnNewMSG.setData(Room.NEW_MESSAGE);
    statusColorButtons.add(btnNewMSG);

    Label lblNameCalled = new Label(grpRoomStatusColors, SWT.NONE);
    lblNameCalled.setText("Name Called");
    lblNameCalled.setBounds(10, 118, 85, 15);

    Button btnNameCall = new Button(grpRoomStatusColors, SWT.NONE);
    btnNameCall.setBounds(117, 113, 75, 25);
    btnNameCall.setData(Room.NAME_CALLED);
    statusColorButtons.add(btnNameCall);

    PaintListener colorPainter = new PaintListener() {
      public void paintControl(PaintEvent e) {
        int border = 6;
        RGB rgb = Settings.getSettings().getRoomStatusColors()
            .get(e.widget.getData());
        e.gc.setBackground(SWTResourceManager.getColor(rgb));
View Full Code Here

      public void focusLost(FocusEvent e) {
        popup.setAlpha(0);
      }
    });
   
    _explorer.getTree().addPaintListener(new PaintListener() {
      @SuppressWarnings("unused")
      public void paintControl(PaintEvent e) {
        popup.setAlpha(0);
      }
    }) ;
View Full Code Here

      if (Win32.getWin32Version() < Win32.VERSION(5, 0))
      {
        Windows.hideTitleBar(shell.handle);
      }

      shell.addPaintListener(new PaintListener()
      {
        public void paintControl(PaintEvent e)
        {
          refreshAllCommands(e.gc);
        }
View Full Code Here

  public CButton(Composite parent, int style, ThemeRender theme) {
    super(parent, style);
    setTheme(theme);
  
    addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent e) {
        onPaint(e);
      }
    });
    addMouseMoveListener(new MouseMoveListener() {
View Full Code Here

    addListener(SWT.MouseDown, listener);
    addListener(SWT.MouseUp, listener);
    addListener(SWT.KeyDown, listener);
    addListener(SWT.KeyUp, listener);
    addListener(SWT.Resize, listener);
    addPaintListener(new PaintListener() {

      public void paintControl(PaintEvent e) {
        if (drawable != null) {
          drawable.paint(e.gc, 0, 0);
        }
View Full Code Here

    normalState = new NormalButtonState();
    hoverState = new HoverButtonState();
    pressedState = new PressedButtonState();
    currentState = normalState;
   
    addPaintListener(new PaintListener(){
      public void paintControl(PaintEvent e) {
        e.gc.drawImage(currentState.getImage(),0,0);   
      }
    })
   
View Full Code Here

TOP

Related Classes of org.eclipse.swt.events.PaintListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.