home *** CD-ROM | disk | FTP | other *** search
Wrap
package sun.print; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.print.attribute.standard.OrientationRequested; import javax.swing.BorderFactory; import javax.swing.ButtonGroup; import javax.swing.JPanel; class ServiceDialog$OrientationPanel extends JPanel implements ActionListener { private final String strTitle; private ServiceDialog.IconRadioButton rbPortrait; private ServiceDialog.IconRadioButton rbLandscape; private ServiceDialog.IconRadioButton rbRevPortrait; private ServiceDialog.IconRadioButton rbRevLandscape; private ServiceDialog.MarginsPanel pnlMargins; // $FF: synthetic field final ServiceDialog this$0; public ServiceDialog$OrientationPanel(ServiceDialog var1) { this.this$0 = var1; this.strTitle = ServiceDialog.getMsg("border.orientation"); this.pnlMargins = null; GridBagLayout var2 = new GridBagLayout(); GridBagConstraints var3 = new GridBagConstraints(); this.setLayout(var2); this.setBorder(BorderFactory.createTitledBorder(this.strTitle)); var3.fill = 1; var3.insets = ServiceDialog.access$700(); var3.weighty = (double)1.0F; var3.gridwidth = 0; ButtonGroup var4 = new ButtonGroup(); this.rbPortrait = new ServiceDialog.IconRadioButton(var1, "radiobutton.portrait", "orientPortrait.png", true, var4, this); this.rbPortrait.addActionListener(this); ServiceDialog.access$300(this.rbPortrait, this, var2, var3); this.rbLandscape = new ServiceDialog.IconRadioButton(var1, "radiobutton.landscape", "orientLandscape.png", false, var4, this); this.rbLandscape.addActionListener(this); ServiceDialog.access$300(this.rbLandscape, this, var2, var3); this.rbRevPortrait = new ServiceDialog.IconRadioButton(var1, "radiobutton.revportrait", "orientRevPortrait.png", false, var4, this); this.rbRevPortrait.addActionListener(this); ServiceDialog.access$300(this.rbRevPortrait, this, var2, var3); this.rbRevLandscape = new ServiceDialog.IconRadioButton(var1, "radiobutton.revlandscape", "orientRevLandscape.png", false, var4, this); this.rbRevLandscape.addActionListener(this); ServiceDialog.access$300(this.rbRevLandscape, this, var2, var3); } public void actionPerformed(ActionEvent var1) { Object var2 = var1.getSource(); if (this.rbPortrait.isSameAs(var2)) { ServiceDialog.access$1200(this.this$0).add(OrientationRequested.PORTRAIT); } else if (this.rbLandscape.isSameAs(var2)) { ServiceDialog.access$1200(this.this$0).add(OrientationRequested.LANDSCAPE); } else if (this.rbRevPortrait.isSameAs(var2)) { ServiceDialog.access$1200(this.this$0).add(OrientationRequested.REVERSE_PORTRAIT); } else if (this.rbRevLandscape.isSameAs(var2)) { ServiceDialog.access$1200(this.this$0).add(OrientationRequested.REVERSE_LANDSCAPE); } if (this.pnlMargins != null) { this.pnlMargins.updateInfo(); } } void addOrientationListener(ServiceDialog.MarginsPanel var1) { this.pnlMargins = var1; } public void updateInfo() { Class var1 = OrientationRequested.class; boolean var2 = false; boolean var3 = false; boolean var4 = false; boolean var5 = false; if (ServiceDialog.access$1500(this.this$0)) { var2 = true; var3 = true; } else if (ServiceDialog.access$400(this.this$0).isAttributeCategorySupported(var1)) { Object var6 = ServiceDialog.access$400(this.this$0).getSupportedAttributeValues(var1, ServiceDialog.access$1600(this.this$0), ServiceDialog.access$1200(this.this$0)); if (var6 instanceof OrientationRequested[]) { OrientationRequested[] var7 = (OrientationRequested[])var6; for(int var8 = 0; var8 < var7.length; ++var8) { OrientationRequested var9 = var7[var8]; if (var9 == OrientationRequested.PORTRAIT) { var2 = true; } else if (var9 == OrientationRequested.LANDSCAPE) { var3 = true; } else if (var9 == OrientationRequested.REVERSE_PORTRAIT) { var4 = true; } else if (var9 == OrientationRequested.REVERSE_LANDSCAPE) { var5 = true; } } } } this.rbPortrait.setEnabled(var2); this.rbLandscape.setEnabled(var3); this.rbRevPortrait.setEnabled(var4); this.rbRevLandscape.setEnabled(var5); OrientationRequested var10 = (OrientationRequested)ServiceDialog.access$1200(this.this$0).get(var1); if (var10 == null || !ServiceDialog.access$400(this.this$0).isAttributeValueSupported(var10, ServiceDialog.access$1600(this.this$0), ServiceDialog.access$1200(this.this$0))) { var10 = (OrientationRequested)ServiceDialog.access$400(this.this$0).getDefaultAttributeValue(var1); if (!ServiceDialog.access$400(this.this$0).isAttributeValueSupported(var10, ServiceDialog.access$1600(this.this$0), ServiceDialog.access$1200(this.this$0))) { var10 = null; Object var11 = ServiceDialog.access$400(this.this$0).getSupportedAttributeValues(var1, ServiceDialog.access$1600(this.this$0), ServiceDialog.access$1200(this.this$0)); if (var11 instanceof OrientationRequested[]) { OrientationRequested[] var12 = (OrientationRequested[])var11; if (var12.length > 1) { var10 = var12[0]; } } } if (var10 == null) { var10 = OrientationRequested.PORTRAIT; } ServiceDialog.access$1200(this.this$0).add(var10); } if (var10 == OrientationRequested.PORTRAIT) { this.rbPortrait.setSelected(true); } else if (var10 == OrientationRequested.LANDSCAPE) { this.rbLandscape.setSelected(true); } else if (var10 == OrientationRequested.REVERSE_PORTRAIT) { this.rbRevPortrait.setSelected(true); } else { this.rbRevLandscape.setSelected(true); } } }