Examples of Canvas


Examples of org.eclipse.swt.widgets.Canvas

    Messages.setLanguageText(gDownSpeed,"SpeedView.downloadSpeed.title");
    gridData = new GridData(GridData.FILL_BOTH);
    gDownSpeed.setLayoutData(gridData);   
    gDownSpeed.setLayout(new GridLayout());
   
    downSpeedCanvas = new Canvas(gDownSpeed,SWT.NO_BACKGROUND);
    gridData = new GridData(GridData.FILL_BOTH);
    downSpeedCanvas.setLayoutData(gridData);
    downSpeedGraphic = SpeedGraphic.getInstance();
    downSpeedGraphic.initialize(downSpeedCanvas);
    Color[] colors = downSpeedGraphic.colors;
   
    Group gUpSpeed = new Group(panel,SWT.NULL);
    Messages.setLanguageText(gUpSpeed,"SpeedView.uploadSpeed.title");
    gridData = new GridData(GridData.FILL_BOTH);
    gUpSpeed.setLayoutData(gridData);
    gUpSpeed.setLayout(new GridLayout());
   
    upSpeedCanvas = new Canvas(gUpSpeed,SWT.NO_BACKGROUND);
    gridData = new GridData(GridData.FILL_BOTH);
    upSpeedCanvas.setLayoutData(gridData);
    upSpeedGraphic = SpeedGraphic.getInstance();
    upSpeedGraphic.initialize(upSpeedCanvas);
   
View Full Code Here

Examples of org.eclipse.swt.widgets.Canvas

    data = new GridData();
    data.horizontalSpan = 3;
    label.setLayoutData(data);
   
   
    in = new Canvas(gTransport,SWT.NO_BACKGROUND);
    data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 3;
    in.setLayoutData(data);
    inGraph = SpeedGraphic.getInstance();
    inGraph.initialize(in);
   
    label = new Label(gTransport,SWT.NONE);
    Messages.setLanguageText(label,"DHTView.transport.out");
    data = new GridData();
    data.horizontalSpan = 3;
    label.setLayoutData(data);
   
    out = new Canvas(gTransport,SWT.NO_BACKGROUND);
    data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 3;
    out.setLayoutData(data);
    outGraph = SpeedGraphic.getInstance();
    outGraph.initialize(out);
View Full Code Here

Examples of org.eclipse.swt.widgets.Canvas

    upload_label.setLayoutData(gridData);


      // connections
   
    Canvas connection_canvas = new Canvas(connectionPanel,SWT.NO_BACKGROUND);
    gridData = new GridData(GridData.FILL_BOTH);
    gridData.heightHint = 200;
    connection_canvas.setLayoutData(gridData);
    connection_graphic =
      SpeedGraphic.getInstance(
      new ValueFormater()
      {
          public String
          format(int value)
          {
               return( String.valueOf( value ));
          }
      });
   
    connection_graphic.initialize(connection_canvas);
    Color[] colors = connection_graphic.colors;

    connection_graphic.setLineColors( colors );
   
      // upload queued
   
    Canvas upload_canvas = new Canvas(connectionPanel,SWT.NO_BACKGROUND);
    gridData = new GridData(GridData.FILL_BOTH);
    upload_canvas.setLayoutData(gridData);
    upload_graphic =
      SpeedGraphic.getInstance(
      new ValueFormater()
      {
          public String
View Full Code Here

Examples of org.eclipse.swt.widgets.Canvas

    GridLayout layout = new GridLayout();
    layout.numColumns = 8;
    layout.makeColumnsEqualWidth = true;
    autoSpeedInfoPanel.setLayout(layout);
      
    Canvas pingCanvas = new Canvas(autoSpeedInfoPanel,SWT.NO_BACKGROUND);
    GridData gridData = new GridData(GridData.FILL_BOTH);
    gridData.horizontalSpan = 4;
    pingCanvas.setLayoutData(gridData);
   
    pingGraph = PingGraphic.getInstance();
    pingGraph.initialize(pingCanvas);
   
    TabFolder folder = new TabFolder(autoSpeedInfoPanel, SWT.LEFT);
    gridData = new GridData(GridData.FILL_BOTH);
    gridData.horizontalSpan = 4;
    folder.setLayoutData(gridData);
    folder.setBackground(Colors.background);
   
    ValueFormater speed_formatter =
      new ValueFormater()
      {
        public String
        format(
          int value)
        {
          return( DisplayFormatters.formatByteCountToKiBEtc( value ));
        }
      };
     
    ValueFormater time_formatter =
      new ValueFormater()
      {
        public String
        format(
          int value)
        {
          return( value + " ms" );
        }
      };
       
    ValueFormater[] formatters = new ValueFormater[]{ speed_formatter, speed_formatter, time_formatter };
   
    String[] labels = new String[]{ "up", "down", "ping" };
   
    SpeedManagerPingMapper[] mappers = speedManager.getMappers();
   
    plot_views  = new plotView[mappers.length];
    zone_views  = new zoneView[mappers.length];
   
    for (int i=0;i<mappers.length;i++){
   
      SpeedManagerPingMapper mapper = mappers[i];
     
      TabItem plot_item = new TabItem(folder, SWT.NULL);
     
      plot_item.setText( "Plot " + mapper.getName());
     
      Canvas plotCanvas = new Canvas(folder,SWT.NO_BACKGROUND);
      gridData = new GridData(GridData.FILL_BOTH);
      plotCanvas.setLayoutData(gridData);
     
      plot_views[i] = new plotView( mapper, plotCanvas, labels, formatters );
     
      plot_item.setControl( plotCanvas );
     
      TabItem zones_item = new TabItem(folder, SWT.NULL);
      zones_item.setText( "Zones " + mapper.getName() );
     
      Canvas zoneCanvas = new Canvas(folder,SWT.NO_BACKGROUND);
      gridData = new GridData(GridData.FILL_BOTH);
      zoneCanvas.setLayoutData(gridData);
 
      zone_views[i] = new zoneView( mapper, zoneCanvas, labels, formatters );
     
      zones_item.setControl( zoneCanvas );
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.Canvas

    layout.marginWidth = 0;
   
    shell.setLayout(layout);
   
    // Top gradient
    final Canvas window_top = new Canvas(shell,SWT.NONE);
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    layout_data.heightHint = TOP_GRADIENT_HEIGHT;
    window_top.setLayoutData(layout_data);
    window_top.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent arg0) {
        Rectangle rect = shell.getClientArea ();
        GC gc = arg0.gc;
        gc.setForeground (GRADIENT_COLOR_2);
        gc.setBackground (GRADIENT_COLOR_1);
View Full Code Here

Examples of org.eclipse.swt.widgets.Canvas

        ._("downloadinfowindow.tab.general.label.totalprogress")
        + " : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));

    total_progress = new Canvas(transfer_group, SWT.NONE);
    GridData grid_data = new GridData(GridData.FILL_HORIZONTAL);
    grid_data.heightHint = 20;
    total_progress.setLayoutData(grid_data);
    gap_list_painter = new GapListPainter(download_session.getGapList(),
        download_session.getFileSize());
View Full Code Here

Examples of org.eclipse.swt.widgets.Canvas

    gap_list_painter = new GapListPainter(gap_list,100);
    FillLayout layout = new FillLayout();
    layout.marginHeight = 10;
    layout.marginWidth  = 10;
    shell.setLayout(layout);
    final Canvas canvas = new Canvas(shell,SWT.NONE);
   
    canvas.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent arg0) {
        System.out.println(arg0.width+" : " + arg0.height);
        gap_list_painter.draw(arg0.gc, 0, 0, arg0.width, arg0.height);
      }
    });
View Full Code Here

Examples of org.eclipse.swt.widgets.Canvas

    // and some do not.
    int iStyle = SWT.NO_FOCUS | SWT.NO_BACKGROUND;
    if (orientation == SWT.FILL) {
      iStyle |= SWT.NO_REDRAW_RESIZE;
    }
    cBlockView = new Canvas(getTable(), iStyle);
    cBlockView.setBackground(null);
    cBlockView.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent event) {
        if (event.width == 0 || event.height == 0)
          return;
View Full Code Here

Examples of org.eclipse.swt.widgets.Canvas

    data.grabExcessHorizontalSpace = true;
    close.setLayoutData(data);
   
    // Common About Details Components

    Canvas canvas = new Canvas(commonAboutDetails, SWT.NONE);
    canvas.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent e) {
        e.gc.drawImage(image, 0, 0);
      }
    });
    data = new GridData(GridData.CENTER, GridData.CENTER, true, true);
    data.widthHint = 48;
    data.heightHint = 48;
    canvas.setLayoutData(data);

    Label messageLabel = new Label(commonAboutDetails, SWT.CENTER);
    messageLabel.setFont(SWTUtil.newFont(parent.getDisplay(), messageLabel.getFont(), 18, SWT.BOLD));
    messageLabel.setText(message);
View Full Code Here

Examples of org.eclipse.swt.widgets.Canvas

    GridLayout gridLayout = new GridLayout(1, false);
    shell.setLayout(gridLayout);

    // Common About Details Components
    if (image != null) {
      Canvas canvas = new Canvas(shell, SWT.NONE);
      canvas.addPaintListener(new PaintListener() {
        public void paintControl(PaintEvent e) {
          e.gc.drawImage(image, 0, 0);
        }
      });
      GridData data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true);
      data.widthHint = image.getBounds().width;
      data.heightHint = image.getBounds().height;
      canvas.setLayoutData(data);
    }

    // Text
    Label textLabel = new Label(shell, SWT.NONE | SWT.WRAP);
    String info = authenticator.getInformation();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.