コード例 #1
0
 private void updateBgImage() {
   Iterator iter = controls.iterator();
   while (iter.hasNext()) {
     Control control = (Control) iter.next();
     control.setBackgroundImage(showBgImage ? BG_PATTERN_IMAGE : null);
   }
 }
コード例 #2
0
 private void updateBgColor() {
   Iterator iter = controls.iterator();
   while (iter.hasNext()) {
     Control control = (Control) iter.next();
     control.setBackground(bgColors[bgIndex]);
   }
 }
コード例 #3
0
 private void updateFgColor() {
   Iterator iter = controls.iterator();
   while (iter.hasNext()) {
     Control control = (Control) iter.next();
     control.setForeground(fgColors[fgIndex]);
   }
 }
コード例 #4
0
 private void updateEnabled() {
   Iterator iter = controls.iterator();
   while (iter.hasNext()) {
     Control control = (Control) iter.next();
     control.setEnabled(enabled);
   }
 }
コード例 #5
0
 private void updateVisible() {
   Iterator iter = controls.iterator();
   while (iter.hasNext()) {
     Control control = (Control) iter.next();
     control.setVisible(visible);
   }
 }
コード例 #6
0
 private void updateFont() {
   Iterator iter = controls.iterator();
   while (iter.hasNext()) {
     Control control = (Control) iter.next();
     control.setFont(font);
   }
   // Force layout
   if (controls.size() > 0) {
     Composite parent = ((Control) controls.get(0)).getParent();
     parent.layout(true, true);
   }
 }
コード例 #7
0
 private void updateRoundedBorder(
     final int width,
     final Color color,
     final int topLeft,
     final int topRight,
     final int bottomRight,
     final int bottomLeft) {
   Iterator iter = controls.iterator();
   while (iter.hasNext()) {
     Control control = (Control) iter.next();
     Object adapter = control.getAdapter(IWidgetGraphicsAdapter.class);
     IWidgetGraphicsAdapter gfxAdapter = (IWidgetGraphicsAdapter) adapter;
     gfxAdapter.setRoundedBorder(width, color, topLeft, topRight, bottomRight, bottomLeft);
   }
 }
コード例 #8
0
 private void updateCursor(final String selection) {
   Cursor cursor = null;
   Class swtClass = SWT.class;
   if (selection != null) {
     try {
       Field field = swtClass.getField(selection);
       int cursorStyle = field.getInt(swtClass);
       cursor = Display.getCurrent().getSystemCursor(cursorStyle);
     } catch (Exception e) {
       e.printStackTrace();
     }
   }
   Iterator iter = controls.iterator();
   while (iter.hasNext()) {
     Control control = (Control) iter.next();
     control.setCursor(cursor);
   }
 }
コード例 #9
0
 private void updateBgGradient() {
   Iterator iter = controls.iterator();
   while (iter.hasNext()) {
     Control control = (Control) iter.next();
     Object adapter = control.getAdapter(IWidgetGraphicsAdapter.class);
     IWidgetGraphicsAdapter gfxAdapter = (IWidgetGraphicsAdapter) adapter;
     if (showBgGradient) {
       Color[] gradientColors =
           new Color[] {
             BGG_COLOR_BLUE, BGG_COLOR_GREEN, BGG_COLOR_BLUE, BGG_COLOR_GREEN, BGG_COLOR_BLUE
           };
       int[] percents = new int[] {0, 25, 50, 75, 100};
       gfxAdapter.setBackgroundGradient(gradientColors, percents);
     } else {
       gfxAdapter.setBackgroundGradient(null, null);
     }
   }
 }