乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      模仿qq消息提示框,可以完美定位到rcp系統(tǒng)的右下角

       LibraryPKU 2015-03-12

      代碼片段(5) [全屏查看所有代碼]

      1. [代碼][Java]代碼    

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      53
      54
      55
      56
      57
      58
      59
      60
      61
      62
      63
      64
      65
      66
      67
      68
      69
      70
      71
      72
      73
      74
      75
      76
      77
      78
      79
      80
      81
      82
      83
      84
      85
      86
      87
      88
      89
      90
      91
      92
      93
      94
      95
      96
      97
      98
      99
      100
      101
      102
      103
      104
      105
      106
      107
      108
      109
      110
      111
      112
      113
      114
      115
      116
      117
      118
      119
      120
      121
      122
      123
      124
      125
      126
      127
      128
      129
      130
      131
      132
      133
      134
      135
      136
      137
      138
      139
      140
      141
      142
      143
      144
      145
      146
      147
      148
      149
      150
      151
      152
      153
      154
      155
      156
      157
      158
      159
      160
      161
      162
      163
      164
      165
      166
      167
      168
      169
      170
      171
      172
      173
      174
      175
      176
      177
      略全局對象,一一創(chuàng)建即可。。。
          /**
           * Create the dialog.
           *
           * @param parent
           * @param style
           */
          public demo2(Shell parent, int style) {
              super(parent, style);
              this.parent = parent;
              setText("SWT Dialog");
          }
       
          /**
           * Open the dialog.
           *
           * @return the result
           */
          public Object open() {
              createContents();
              LayoutUtil.bottomrightShell(parent.getDisplay(), shell);
              shell.setLayout(new FormLayout());
       
              Composite composite = new Composite(shell, SWT.BORDER);
              composite.setBackground(SWTResourceManager.getColor(127, 255, 212));
              FormData fd_composite = new FormData();
              fd_composite.right = new FormAttachment(0, 340);
              fd_composite.top = new FormAttachment(0);
              fd_composite.left = new FormAttachment(0);
              fd_composite.bottom = new FormAttachment(0, 27);
              composite.setLayoutData(fd_composite);
       
              text = new Text(composite, SWT.BORDER | SWT.CENTER);
              text.setEnabled(false);
              text.setText("通知欄");
              text.setBounds(5, 1, 73, 23);
       
              Button button_1 = new Button(composite, SWT.TOGGLE | SWT.CENTER);
              button_1.addSelectionListener(new SelectionAdapter() {
                  @Override
                  public void widgetSelected(SelectionEvent e) {
                      shell.close();
                  }
              });
              button_1.setText("×");
              button_1.setBounds(309, 0, 27, 27);
       
              final Button button_2 = new Button(composite, SWT.ARROW | SWT.DOWN);
              button_2.addSelectionListener(new SelectionAdapter() {
                  @Override
                  public void widgetSelected(SelectionEvent e) {
                      makeList();
                  }
              });
              button_2.setBounds(276, 0, 27, 27);
       
              list_1 = new List(shell, SWT.BORDER);
              list_1.setLocation(184, 27);
              list_1.setItems(new String[] { "不再通知", "實時提醒", "最小化" });
              FormData fd_list_1 = new FormData();
              fd_list_1.bottom = new FormAttachment(composite, 55, SWT.BOTTOM);
              fd_list_1.top = new FormAttachment(composite);
              fd_list_1.right = new FormAttachment(100, -38);
              fd_list_1.left = new FormAttachment(100, -157);
              list_1.setLayoutData(fd_list_1);
              list_1.setVisible(false);
              parent.getDisplay().addFilter(SWT.MouseMove,new  Listener() {
                   
                  @Override
                  public void handleEvent(Event e) {
                      // TODO Auto-generated method stub
                      if(list_1!=null&&!list_1.isDisposed()){
                          int x = e.x;
                          int y = e.y;
                          Rectangle r = list_1.getBounds();
                          int xbegin = r.x;
                          int xend = r.x + r.width;
                          int ybegin = r.y;
                          int yend = r.y + r.height;
                          if ((x+xbegin) >= xbegin && (x+xbegin)<= xend && (y+ybegin) >= ybegin &&(y+ybegin) <= yend) {
                               
                          } else {
                              if (list_1.isVisible()) {
                                  list_1.setVisible(false);
                              }
                          }
                      }
                  }
              });
              ScrolledComposite scrolledComposite = new ScrolledComposite(shell,
                      SWT.BORDER | SWT.V_SCROLL);
              FormData fd_scrolledComposite = new FormData();
              fd_scrolledComposite.bottom = new FormAttachment(100, -30);
              fd_scrolledComposite.right = new FormAttachment(100);
              fd_scrolledComposite.top = new FormAttachment(composite);
              fd_scrolledComposite.left = new FormAttachment(0);
              scrolledComposite.setLayoutData(fd_scrolledComposite);
              scrolledComposite.setExpandHorizontal(true);
              scrolledComposite.setExpandVertical(true);
       
              table = new Table(scrolledComposite, SWT.BORDER | SWT.FULL_SELECTION
                      | SWT.H_SCROLL);
              table.setLinesVisible(true);
              tableColumn = new TableColumn(table, SWT.NONE);
              tableColumn.setWidth(310);
              showDate();
       
              scrolledComposite.setContent(table);
              scrolledComposite.setMinSize(table
                      .computeSize(SWT.DEFAULT, SWT.DEFAULT));
       
              lblNewLabel = new CLabel(shell, SWT.NONE);
              lblNewLabel.setForeground(SWTResourceManager.getColor(SWT.COLOR_BLUE));
              lblNewLabel.setFont(SWTResourceManager.getFont("微軟雅黑", 9, SWT.BOLD));
              lblNewLabel.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
              FormData fd_lblNewLabel = new FormData();
              fd_lblNewLabel.bottom = new FormAttachment(100, -1);
              fd_lblNewLabel.left = new FormAttachment(composite, 0, SWT.LEFT);
              lblNewLabel.setLayoutData(fd_lblNewLabel);
              lblNewLabel.setText("查看全部");
       
              label = new CLabel(shell, SWT.NONE);
              label.setForeground(SWTResourceManager.getColor(SWT.COLOR_BLUE));
              label.setFont(SWTResourceManager.getFont("微軟雅黑", 9, SWT.BOLD));
              label.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
              label.setText("忽略全部");
              FormData fd_label = new FormData();
              fd_label.top = new FormAttachment(lblNewLabel, -23);
              fd_label.left = new FormAttachment(100, -54);
              fd_label.bottom = new FormAttachment(lblNewLabel, 0, SWT.BOTTOM);
              fd_label.right = new FormAttachment(100);
              label.setLayoutData(fd_label);
              shell.open();
              shell.layout();
              Display display = getParent().getDisplay();
              while (!shell.isDisposed()) {
                  if (!display.readAndDispatch()) {
                      display.sleep();
                  }
              }
              return result;
          }
       
          private void showDate() {
              // TODO Auto-generated method stub
       
              tableItem = new TableItem(table, SWT.NONE);
              tableItem.setText("待處理的財務申請");
       
              tableItem_1 = new TableItem(table, SWT.NONE);
              tableItem_1.setText("待處理的未讀郵件");
              for (int i = 0; i < 20; i++) {
                  tableItem_1 = new TableItem(table, SWT.NONE);
                  tableItem_1.setText("待處理的未讀郵件");
              }
          }
       
          protected void makeList() {
              // TODO Auto-generated method stub
              if (list_1 != null && !list_1.isVisible()) {
                  list_1.setVisible(true);
              } else if (list_1 != null && list_1.isVisible()) {
                  list_1.setVisible(false);
              }
       
          }
       
          /**
           * Create contents of the dialog.
           */
          private void createContents() {
              shell = new Shell(getParent(), SWT.NO_TRIM | SWT.BORDER);
              shell.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
              shell.setSize(340, 243);
              shell.setText(getText());
          }
      }

      2. [圖片] QQ截圖20141121171903.png    

      3. [圖片] QQ截圖20141121171931.png    

      4. [圖片] QQ截圖20141121171941.png    

      5. [代碼][Java]代碼    

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      緩慢打開和關閉窗口
       
          private void createContents() {
              shell = new Shell(getParent(), SWT.NO_TRIM | SWT.BORDER);
              shell.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
              shell.setSize(340, 243);
              shell.setText(getText());
              AnimationRunner runner = new AnimationRunner();
              runner.runEffect(new AlphaEffect(shell, 0, 255, 4000, new ExpoOut(),
                      null, null));
              AlphaEffect.fadeOnClose(shell, 4000, new ExpoOut(), runner);
          }

        本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內容,請點擊一鍵舉報。
        轉藏 分享 獻花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多