예제 #1
0
 public void run() {
   try {
     thread.sleep(1111);
   } catch (Exception e) {
     return;
   }
   Thread me = Thread.currentThread();
   while (thread == me) {
     for (int i = 0; i < ImageOps.imgName.length; i++) {
       imgCombo.setSelectedIndex(i);
       for (int j = 0; j < ImageOps.opsName.length; j++) {
         opsCombo.setSelectedIndex(j);
         if (j <= 1) {
           for (int k = 50; k <= 200; k += 10) {
             demo.slider1.setValue(k);
             try {
               thread.sleep(200);
             } catch (InterruptedException e) {
               return;
             }
           }
         }
         try {
           thread.sleep(4444);
         } catch (InterruptedException e) {
           return;
         }
       }
     }
   }
   thread = null;
 }
예제 #2
0
 private void initComboBox(JComboBox combo) {
   if (combo.getUI() instanceof WindowsComboBoxUI) {
     combo.setUI(new RightPopupWindowsComboBoxUI());
   } else {
     combo.setUI(new RightPopupBasicComboBoxUI());
   }
   combo.addPopupMenuListener(new RightPopupMenuListener());
 }
예제 #3
0
 @Override
 public void setSelectedIndex(int ind) {
   super.setSelectedIndex(ind);
   editor.setText(getItemAt(ind).toString());
   editor.setSelectionEnd(caretPos + editor.getText().length());
   editor.moveCaretPosition(caretPos);
 }
예제 #4
0
 public void actionPerformed(ActionEvent e) {
   if (e.getSource().equals(opsCombo)) {
     demo.opsIndex = opsCombo.getSelectedIndex();
     if (demo.opsIndex == 0) {
       demo.slider1.setValue(demo.low);
       demo.slider2.setValue(demo.high);
       demo.slider1.setEnabled(true);
       demo.slider2.setEnabled(true);
     } else if (demo.opsIndex == 1) {
       demo.slider1.setValue(demo.rescaleFactor);
       demo.slider2.setValue((int) demo.rescaleOffset);
       demo.slider1.setEnabled(true);
       demo.slider2.setEnabled(true);
     } else {
       demo.slider1.setEnabled(false);
       demo.slider2.setEnabled(false);
     }
   } else if (e.getSource().equals(imgCombo)) {
     demo.imgIndex = imgCombo.getSelectedIndex();
   }
   demo.repaint(10);
 }
예제 #5
0
 public DemoControls(ImageOps demo) {
   super(demo.name);
   this.demo = demo;
   setBackground(Color.gray);
   add(imgCombo = new JComboBox());
   imgCombo.setFont(font);
   for (int i = 0; i < ImageOps.imgName.length; i++) {
     imgCombo.addItem(ImageOps.imgName[i]);
   }
   imgCombo.addActionListener(this);
   add(opsCombo = new JComboBox());
   opsCombo.setFont(font);
   for (int i = 0; i < ImageOps.opsName.length; i++) {
     opsCombo.addItem(ImageOps.opsName[i]);
   }
   opsCombo.addActionListener(this);
 }
예제 #6
0
 public boolean isDirty() {
   String newFilename = (String) _txtFilename.getSelectedItem();
   return !_oldFilename.equals(newFilename);
 }
예제 #7
0
 public String getAbsolutePath() {
   return _txtPath.getText()
       + File.separatorChar
       + _txtFilename.getSelectedItem()
       + _txtFileExt.getText();
 }
예제 #8
0
 protected void updateFilename() {
   _oldFilename = (String) _txtFilename.getSelectedItem();
 }