home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / sun / print / ServiceDialog$SidesPanel.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  3.3 KB  |  100 lines

  1. package sun.print;
  2.  
  3. import java.awt.GridBagConstraints;
  4. import java.awt.GridBagLayout;
  5. import java.awt.event.ActionEvent;
  6. import java.awt.event.ActionListener;
  7. import javax.print.attribute.standard.Sides;
  8. import javax.swing.BorderFactory;
  9. import javax.swing.ButtonGroup;
  10. import javax.swing.JPanel;
  11.  
  12. class ServiceDialog$SidesPanel extends JPanel implements ActionListener {
  13.    private final String strTitle;
  14.    private ServiceDialog.IconRadioButton rbOneSide;
  15.    private ServiceDialog.IconRadioButton rbTumble;
  16.    private ServiceDialog.IconRadioButton rbDuplex;
  17.    // $FF: synthetic field
  18.    final ServiceDialog this$0;
  19.  
  20.    public ServiceDialog$SidesPanel(ServiceDialog var1) {
  21.       this.this$0 = var1;
  22.       this.strTitle = ServiceDialog.getMsg("border.sides");
  23.       GridBagLayout var2 = new GridBagLayout();
  24.       GridBagConstraints var3 = new GridBagConstraints();
  25.       this.setLayout(var2);
  26.       this.setBorder(BorderFactory.createTitledBorder(this.strTitle));
  27.       var3.fill = 1;
  28.       var3.insets = ServiceDialog.access$700();
  29.       var3.weighty = (double)1.0F;
  30.       var3.gridwidth = 0;
  31.       ButtonGroup var4 = new ButtonGroup();
  32.       this.rbOneSide = new ServiceDialog.IconRadioButton(var1, "radiobutton.oneside", "oneside.png", true, var4, this);
  33.       this.rbOneSide.addActionListener(this);
  34.       ServiceDialog.access$300(this.rbOneSide, this, var2, var3);
  35.       this.rbTumble = new ServiceDialog.IconRadioButton(var1, "radiobutton.tumble", "tumble.png", false, var4, this);
  36.       this.rbTumble.addActionListener(this);
  37.       ServiceDialog.access$300(this.rbTumble, this, var2, var3);
  38.       this.rbDuplex = new ServiceDialog.IconRadioButton(var1, "radiobutton.duplex", "duplex.png", false, var4, this);
  39.       this.rbDuplex.addActionListener(this);
  40.       var3.gridwidth = 0;
  41.       ServiceDialog.access$300(this.rbDuplex, this, var2, var3);
  42.    }
  43.  
  44.    public void actionPerformed(ActionEvent var1) {
  45.       Object var2 = var1.getSource();
  46.       if (this.rbOneSide.isSameAs(var2)) {
  47.          ServiceDialog.access$1200(this.this$0).add(Sides.ONE_SIDED);
  48.       } else if (this.rbTumble.isSameAs(var2)) {
  49.          ServiceDialog.access$1200(this.this$0).add(Sides.TUMBLE);
  50.       } else if (this.rbDuplex.isSameAs(var2)) {
  51.          ServiceDialog.access$1200(this.this$0).add(Sides.DUPLEX);
  52.       }
  53.  
  54.    }
  55.  
  56.    public void updateInfo() {
  57.       Class var1 = Sides.class;
  58.       boolean var2 = false;
  59.       boolean var3 = false;
  60.       boolean var4 = false;
  61.       if (ServiceDialog.access$400(this.this$0).isAttributeCategorySupported(var1)) {
  62.          Object var5 = ServiceDialog.access$400(this.this$0).getSupportedAttributeValues(var1, ServiceDialog.access$1600(this.this$0), ServiceDialog.access$1200(this.this$0));
  63.          if (var5 instanceof Sides[]) {
  64.             Sides[] var6 = (Sides[])var5;
  65.  
  66.             for(int var7 = 0; var7 < var6.length; ++var7) {
  67.                Sides var8 = var6[var7];
  68.                if (var8 == Sides.ONE_SIDED) {
  69.                   var2 = true;
  70.                } else if (var8 == Sides.TUMBLE) {
  71.                   var3 = true;
  72.                } else if (var8 == Sides.DUPLEX) {
  73.                   var4 = true;
  74.                }
  75.             }
  76.          }
  77.       }
  78.  
  79.       this.rbOneSide.setEnabled(var2);
  80.       this.rbTumble.setEnabled(var3);
  81.       this.rbDuplex.setEnabled(var4);
  82.       Sides var9 = (Sides)ServiceDialog.access$1200(this.this$0).get(var1);
  83.       if (var9 == null) {
  84.          var9 = (Sides)ServiceDialog.access$400(this.this$0).getDefaultAttributeValue(var1);
  85.          if (var9 == null) {
  86.             var9 = Sides.ONE_SIDED;
  87.          }
  88.       }
  89.  
  90.       if (var9 == Sides.ONE_SIDED) {
  91.          this.rbOneSide.setSelected(true);
  92.       } else if (var9 == Sides.TUMBLE) {
  93.          this.rbTumble.setSelected(true);
  94.       } else {
  95.          this.rbDuplex.setSelected(true);
  96.       }
  97.  
  98.    }
  99. }
  100.