3 import java
.awt
.event
.*;
5 import javax
.swing
.event
.*;
9 import com
.easysw
.cups
.*;
11 public class GLPtabs
extends JPanel
13 JTabbedPane tabPanel
= null;
16 // Panels for the various tabs.
18 JPanel serverPanel
= null;
19 JScrollPane printersPanel
= null;
20 JPanel detailPanel
= null;
21 JPanel optionsPanel
= null;
23 GLPserver server
= null;
24 GLPprinters printers
= null;
25 GLPdetail detail
= null;
26 GLPoptions options
= null;
33 tabPanel
= new JTabbedPane();
34 tabPanel
.setBackground(Color
.white
);
36 serverPanel
= new JPanel();
37 server
= new GLPserver();
38 serverPanel
= server
.getPanel();
39 tabPanel
.add("Server", serverPanel
);
40 tabPanel
.setBackgroundAt(0,GLPcolors
.tabBackgroundColor
);
41 tabPanel
.setForegroundAt(0,GLPcolors
.tabForegroundColor
);
43 printersPanel
= new JScrollPane();
44 printers
= new GLPprinters();
45 printersPanel
= printers
.getPanel();
46 tabPanel
.add( "Printers", printersPanel
);
47 tabPanel
.setBackgroundAt(1,GLPcolors
.tabBackgroundColor
);
48 tabPanel
.setForegroundAt(1,GLPcolors
.tabForegroundColor
);
51 detail
= new GLPdetail();
52 detailPanel
= detail
.getPanel();
53 tabPanel
.add( "Destination", detailPanel
);
54 tabPanel
.setBackgroundAt(2,GLPcolors
.tabBackgroundColor
);
55 tabPanel
.setForegroundAt(2,GLPcolors
.tabForegroundColor
);
57 options
= new GLPoptions();
58 optionsPanel
= new JPanel();
59 optionsPanel
.setBackground(GLPcolors
.backgroundColor
);
60 tabPanel
.add( "Options", optionsPanel
);
61 tabPanel
.setBackgroundAt(3,GLPcolors
.tabBackgroundColor
);
62 tabPanel
.setForegroundAt(3,GLPcolors
.tabForegroundColor
);
64 tabPanel
.setSelectedIndex(0);
66 tabPanel
.addChangeListener(new ChangeListener()
68 public void stateChanged( ChangeEvent e
)
70 Object source
= e
.getSource();
71 if (!printers
.cupsServerName
.equals(GLPvars
.getServerName()))
74 printersPanel
= printers
.getPanel();
75 tabPanel
.setComponentAt(1,printersPanel
);
80 JPanel jobsPanel
= new JPanel();
81 JPanel filePanel
= new JPanel();
86 public void updateServerPanel(String s
)
88 server
.updateServer(s
);
89 serverPanel
= server
.getPanel();
90 tabPanel
.setComponentAt(0,serverPanel
);
93 public void updateDetailPanel()
96 detailPanel
= detail
.getPanel();
97 tabPanel
.setComponentAt(2,detailPanel
);
100 public void updateOptionsPanel(CupsPrinter cp
)
102 options
.updateOptions(cp
);
103 optionsPanel
= options
.getPanel();
104 tabPanel
.setComponentAt(3,optionsPanel
);
107 public boolean updatePrintersTab()
112 public JTabbedPane
getPanel()