public ConfigTestsView() { // default look and feel try { // UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); // UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); // UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticLookAndFeel"); // UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel"); // UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel"); // UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); // UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel"); // //10 // UIManager.setLookAndFeel("com.jgoodies.looks.windows.WindowsLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.aero.AeroLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.aluminium.AluminiumLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.bernstein.BernsteinLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.fast.FastLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.graphite.GraphiteLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.hifi.HiFiLookAndFeel"); // //8 // UIManager.setLookAndFeel("com.jtattoo.plaf.luna.LunaLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.mcwin.McWinLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.mint.MintLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.noire.NoireLookAndFeel"); // //8 // UIManager.setLookAndFeel("com.jtattoo.plaf.smart.SmartLookAndFeel"); UIManager.setLookAndFeel("com.jtattoo.plaf.texture.TextureLookAndFeel"); // 10 // UIManager.setLookAndFeel("com.pagosoft.plaf.PgsLookAndFeel"); JFrame.setDefaultLookAndFeelDecorated(false); } catch (Exception e) { e.printStackTrace(); JFrame.setDefaultLookAndFeelDecorated(true); } // Colors Palette palette = new Palette(); super.getContentPane().setBackground(Color.GRAY.darker()); // On close super.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); super.addWindowListener( new WindowAdapter() { @Override public void windowClosing(WindowEvent event) { dispose(); } }); // axis divisions int maxx = 32; int maxy = 24; // Screen size Dimension dim = new Dimension(800, 600); super.setSize(dim); super.setUndecorated(true); // Dimensions int[] x = new int[maxx]; int[] y = new int[maxy]; int long_x = (int) (dim.getWidth() / x.length); int long_y = (int) (dim.getHeight() / y.length); // Grid for controls Container frameContentPane = super.getContentPane(); frameContentPane.setLayout(new GridBagLayout()); for (int i = 0; i < x.length; i++) x[i] = long_x; for (int i = 0; i < y.length; i++) y[i] = long_y; ((GridBagLayout) frameContentPane.getLayout()).columnWidths = x; ((GridBagLayout) frameContentPane.getLayout()).rowHeights = y; // Add controls PzrPanel _A = new PzrPanel(palette.getColor(Palette.COLOR_CAPTION)); PzrPanel _B = new PzrPanel(palette.getColor(Palette.COLOR_BACKGROUND)); PzrPanel _C = new PzrPanel(palette.getColor("#FFFFFF")); _A.setBorder(BorderFactory.createLineBorder(palette.getColor(Palette.COLOR_BORDER))); // Add controls frameContentPane.add( _A, new GridBagConstraints( 0, 0, maxx, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); frameContentPane.add( _B, new GridBagConstraints( 0, 2, maxx, maxy - 5, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); frameContentPane.add( _C, new GridBagConstraints( 0, maxy - 3, maxx, 3, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); // title lblCaption = new PzrLabel( 0, (int) (long_y * 0.5), long_x * maxx, long_y * 1, "", palette.getColor("#FFFFFF"), new Font("Verdana", Font.BOLD, 16)); lblCaption.setHorizontalAlignment(SwingConstants.LEFT); lblCaption.setVerticalTextPosition(SwingConstants.CENTER); _A.add(lblCaption); _A.add( new PzrImage( (long_x * (maxx - 9)) - 5, (int) (long_y * 0.5), long_x * 9, long_y * 1, "/gui/image/logo_small.png")); // Controls int height = (int) (long_y * 1.4); int top = long_y * 1; int left = long_x * 1; int width = long_x * 9; Font font = new Font("Verdana", Font.BOLD, 16); lblName = new PzrLabel( left, top * 3, width, height, "Name", Color.BLACK, font, SwingConstants.RIGHT, SwingConstants.CENTER); lblDescription = new PzrLabel( left, top * 5, width, height, "Description", Color.BLACK, font, SwingConstants.RIGHT, SwingConstants.CENTER); // height = (int) (long_y * 1.4); top = long_y * 1; left = long_x * 11; width = long_x * 18; font = new Font("Verdana", Font.PLAIN, 16); txtName = new PzrText(left, top * 3, width, height, "txtName", font, true); txtDescription = new PzrTextArea("txtDescription", font, false); PzrScrollPane scrollPane = new PzrScrollPane(left, top * 5, width, height * 5, txtDescription); _B.add(lblName); _B.add(lblDescription); _B.add(txtName); _B.add(scrollPane); // OK button this.btnOK = new PzrButton( long_x * 0, long_y * 0, long_x * maxx / 2, long_y * 3, "btnOK", "OK", palette.getColor(Palette.COLOR_OK), BorderFactory.createLineBorder(Color.white)); this.btnOK.setForeground(palette.getColor("#FFFFFF")); this.btnOK.repaint("/gui/image/form_ok.png", 32, 32); this.btnOK.setHorizontalTextPosition(SwingConstants.RIGHT); this.btnOK.setVerifyInputWhenFocusTarget(false); // Cancel button this.btnCancel = new PzrButton( long_x * maxx / 2, long_y * 0, long_x * maxx / 2, long_y * 3, "btnCancel", "Cancel", palette.getColor(Palette.COLOR_CANCEL), BorderFactory.createLineBorder(Color.white)); this.btnCancel.setForeground(palette.getColor("#FFFFFF")); this.btnCancel.repaint("/gui/image/form_cancel.png", 32, 32); this.btnCancel.setHorizontalTextPosition(SwingConstants.RIGHT); this.btnCancel.setVerifyInputWhenFocusTarget(false); // Add buttons _C.add(this.btnOK); _C.add(this.btnCancel); // Show this.setUndecorated(true); this.getRootPane().setWindowDecorationStyle(JRootPane.NONE); this.setLocationRelativeTo(null); this.setModal(true); }
public TaskGridView() { // default look and feel try { // UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); // UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); // UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticLookAndFeel"); // UIManager.setLookAndFeel("com.jgoodies.looks.plastic.Plastic3DLookAndFeel"); // UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel"); // UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); // UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel"); //10 // UIManager.setLookAndFeel("com.jgoodies.looks.windows.WindowsLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.aero.AeroLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.aluminium.AluminiumLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.bernstein.BernsteinLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.fast.FastLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.graphite.GraphiteLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.hifi.HiFiLookAndFeel"); //8 // UIManager.setLookAndFeel("com.jtattoo.plaf.luna.LunaLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.mcwin.McWinLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.mint.MintLookAndFeel"); // UIManager.setLookAndFeel("com.jtattoo.plaf.noire.NoireLookAndFeel"); //8 // UIManager.setLookAndFeel("com.jtattoo.plaf.smart.SmartLookAndFeel"); UIManager.setLookAndFeel("com.jtattoo.plaf.texture.TextureLookAndFeel"); // 10 // UIManager.setLookAndFeel("com.pagosoft.plaf.PgsLookAndFeel"); JFrame.setDefaultLookAndFeelDecorated(false); } catch (Exception e) { e.printStackTrace(); JFrame.setDefaultLookAndFeelDecorated(true); } // Colors Palette palette = new Palette(); super.getContentPane().setBackground(Color.GRAY.darker()); // On close super.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); super.addWindowListener( new WindowAdapter() { @Override public void windowClosing(WindowEvent event) { dispose(); } }); // axis divisions int maxx = 64; int maxy = 48; // Screen size Dimension dim = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getSize(); // Dimension dim = super.getToolkit().getScreenSize(); // Dimension dim = new Dimension(1024, 768); super.setSize(dim); super.setUndecorated(true); // Dimensions int[] x = new int[maxx]; int[] y = new int[maxy]; int long_x = (int) (dim.getWidth() / x.length); int long_y = (int) (dim.getHeight() / y.length); // Grid for controls Container frameContentPane = super.getContentPane(); frameContentPane.setLayout(new GridBagLayout()); for (int i = 0; i < x.length; i++) x[i] = long_x; for (int i = 0; i < y.length; i++) y[i] = long_y; ((GridBagLayout) frameContentPane.getLayout()).columnWidths = x; ((GridBagLayout) frameContentPane.getLayout()).rowHeights = y; // Panels PzrPanel _A = new PzrPanel(palette.getColor("#447744")); PzrPanel _B = new PzrPanel(palette.getColor("#FFFFFF")); PzrPanel _C = new PzrPanel(palette.getColor("#000000")); PzrPanel _D = new PzrPanel(palette.getColor("#FFFFFF")); _A.setBorder(BorderFactory.createLineBorder(Color.white)); // frameContentPane.add( _A, new GridBagConstraints( 0, 0, maxx, 3, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); frameContentPane.add( _B, new GridBagConstraints( 0, 3, maxx, 3, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); frameContentPane.add( _C, new GridBagConstraints( 0, 6, maxx, maxy - 9, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); frameContentPane.add( _D, new GridBagConstraints( 0, maxy - 3, maxx, 3, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); // Title lblCaption = new PzrLabel( 0, 0, long_x * maxx, long_y * 3, "Tests", palette.getColor("#FFFFFF"), new Font("Verdana", Font.BOLD, 18)); lblCaption.setHorizontalAlignment(SwingConstants.CENTER); _A.add(lblCaption); _A.add( new PzrImage( (long_x * 0) + 5, (int) (long_y * 1), long_x * 9, (int) (long_y * 1), "/gui/image/logo_small.png")); // Close this.btnClose = new PzrButton( (long_x * (maxx - 8)) - 1, (long_y * 0) + 1, long_x * 8, (long_y * 3) - 2, "btnClose", "Close", palette.getColor("#A20025"), ""); this.btnClose.setOpaque(false); this.btnClose.setForeground(palette.getColor("#FFFFFF")); this.btnClose.repaint("/gui/image/grid_close_1.png", 32, 32); this.btnClose.setHorizontalTextPosition(SwingConstants.RIGHT); _A.add(this.btnClose); // Buttons top menu this.btnNew = new PzrButton( long_x * 0, long_y * 0, long_x * 8, long_y * 3, "btnNew", "New", palette.getColor("#DFF2BF"), ""); this.btnNew.setOpaque(false); this.btnNew.setForeground(palette.getColor("#000000")); this.btnNew.repaint("/gui/image/grid_new_0.png", 32, 32); this.btnNew.setHorizontalTextPosition(SwingConstants.RIGHT); this.btnModify = new PzrButton( long_x * 8, long_y * 0, long_x * 8, long_y * 3, "btnModify", "Modify", palette.getColor("#BDE5F8"), ""); this.btnModify.setOpaque(false); this.btnModify.setForeground(palette.getColor("#000000")); this.btnModify.repaint("/gui/image/grid_edit_0.png", 32, 32); this.btnModify.setHorizontalTextPosition(SwingConstants.RIGHT); this.btnDelete = new PzrButton( long_x * 16, long_y * 0, long_x * 8, long_y * 3, "btnDelete", "Delete", palette.getColor("#FFBABA"), ""); this.btnDelete.setOpaque(false); this.btnDelete.setForeground(palette.getColor("#000000")); this.btnDelete.repaint("/gui/image/grid_delete_0.png", 32, 32); this.btnDelete.setHorizontalTextPosition(SwingConstants.RIGHT); this.btnPrint = new PzrButton( long_x * 24, long_y * 0, long_x * 8, long_y * 3, "btnPrint", "Print", palette.getColor("#FEEFB3"), ""); this.btnPrint.setOpaque(false); this.btnPrint.setForeground(palette.getColor("#000000")); this.btnPrint.repaint("/gui/image/grid_print_0.png", 32, 32); this.btnPrint.setHorizontalTextPosition(SwingConstants.RIGHT); this.btnDetail1 = new PzrButton( long_x * 32, long_y * 0, long_x * 8, long_y * 3, "btnDetail1", "", palette.getColor(255, 153, 255), ""); this.btnDetail1.setOpaque(false); this.btnDetail1.setForeground(palette.getColor("#000000")); this.btnDetail1.repaint("/gui/image/grid_roles_0.png", 32, 32); this.btnDetail1.setHorizontalTextPosition(SwingConstants.RIGHT); this.btnDetail2 = new PzrButton( long_x * 40, long_y * 0, long_x * 8, long_y * 3, "btnDetail2", "", palette.getColor(204, 153, 255), ""); this.btnDetail2.setOpaque(false); this.btnDetail2.setForeground(palette.getColor("#000000")); this.btnDetail2.repaint("/gui/image/grid_users_0.png", 32, 32); this.btnDetail2.setHorizontalTextPosition(SwingConstants.RIGHT); _B.add(this.btnNew); _B.add(this.btnModify); _B.add(this.btnDelete); _B.add(this.btnPrint); _B.add(this.btnDetail1); _B.add(this.btnDetail2); // Grid this.grdData = new PzrGrid(0, 0, long_x * maxx, long_y * (maxy - 9), new Font("Verdana", Font.PLAIN, 16)); _C.add(this.grdData); // Buttons bottom menu this.btnGridFirst = new PzrButton( long_x * 0, long_y * 0, long_x * 3, long_y * 3, "btnGridFirst", "", palette.getColor("#FFFFFF"), ""); this.btnGridFirst.setOpaque(false); this.btnGridFirst.setForeground(palette.getColor("#000000")); this.btnGridFirst.repaint("/gui/image/grid_first.png", 32, 32); this.btnGridPrevious = new PzrButton( long_x * 3, long_y * 0, long_x * 3, long_y * 3, "btnGridPrevious", "", palette.getColor("#FFFFFF"), ""); this.btnGridPrevious.setOpaque(false); this.btnGridPrevious.setForeground(palette.getColor("#000000")); this.btnGridPrevious.repaint("/gui/image/grid_previous.png", 32, 32); this.btnGridSet1 = new PzrButton( long_x * 6, long_y * 0, long_x * 3, long_y * 3, "btnGridSet1", "1", palette.getColor("#FFFFFF"), ""); this.btnGridSet1.setOpaque(false); this.btnGridSet1.setForeground(palette.getColor("#000000")); this.btnGridSet1.setFont(new Font("Verdana", Font.PLAIN, 18)); this.btnGridSet2 = new PzrButton( long_x * 9, long_y * 0, long_x * 3, long_y * 3, "btnGridSet2", "2", palette.getColor("#FFFFFF"), ""); this.btnGridSet2.setOpaque(false); this.btnGridSet2.setForeground(palette.getColor("#000000")); this.btnGridSet2.setFont(new Font("Verdana", Font.PLAIN, 18)); this.btnGridSet3 = new PzrButton( long_x * 12, long_y * 0, long_x * 3, long_y * 3, "btnGridSet3", "3", palette.getColor("#FFFFFF"), ""); this.btnGridSet3.setOpaque(false); this.btnGridSet3.setForeground(palette.getColor("#000000")); this.btnGridSet3.setFont(new Font("Verdana", Font.PLAIN, 18)); this.btnGridSet4 = new PzrButton( long_x * 15, long_y * 0, long_x * 3, long_y * 3, "btnGridSet4", "4", palette.getColor("#DFF2BF"), ""); this.btnGridSet4.setOpaque(false); this.btnGridSet4.setForeground(palette.getColor("#000000")); this.btnGridSet4.setFont(new Font("Verdana", Font.PLAIN, 18)); this.btnGridSet5 = new PzrButton( long_x * 18, long_y * 0, long_x * 3, long_y * 3, "btnGridSet5", "5", palette.getColor("#DFF2BF"), ""); this.btnGridSet5.setOpaque(false); this.btnGridSet5.setForeground(palette.getColor("#000000")); this.btnGridSet5.setFont(new Font("Verdana", Font.PLAIN, 18)); this.btnGridNext = new PzrButton( long_x * 21, long_y * 0, long_x * 3, long_y * 3, "btnGridNext", "", palette.getColor("#DFF2BF"), ""); this.btnGridNext.setOpaque(false); this.btnGridNext.setForeground(palette.getColor("#000000")); this.btnGridNext.repaint("/gui/image/grid_next.png", 32, 32); this.btnGridLast = new PzrButton( long_x * 24, long_y * 0, long_x * 3, long_y * 3, "btnGridLast", "", palette.getColor("#DFF2BF"), ""); this.btnGridLast.setOpaque(false); this.btnGridLast.setForeground(palette.getColor("#000000")); this.btnGridLast.repaint("/gui/image/grid_last.png", 32, 32); this.btnGridRefresh = new PzrButton( long_x * 27, long_y * 0, long_x * 3, long_y * 3, "btnGridRefresh", "", palette.getColor("#DFF2BF"), ""); this.btnGridRefresh.setOpaque(false); this.btnGridRefresh.setForeground(palette.getColor("#000000")); this.btnGridRefresh.repaint("/gui/image/grid_refresh.png", 32, 32); this.lblSearch = new PzrLabel( long_x * (maxx - 30), (int) (long_y * 0.5), long_x * 7, long_y * 2, "Search", palette.getColor("#000000"), new Font("Verdana", Font.BOLD, 12)); this.lblSearch.setHorizontalAlignment(SwingConstants.RIGHT); this.cboSearch = new PzrComboBox( long_x * (maxx - 23), (int) (long_y * 0.5), long_x * 10, long_y * 2, "cboSearch"); this.txtSearch = new PzrText( long_x * (maxx - 13), (int) (long_y * 0.5), long_x * 10, long_y * 2, "txtSearch", "", false); this.lblSearch.setFont(new Font("Verdana", Font.PLAIN, 14)); this.cboSearch.setFont(new Font("Verdana", Font.PLAIN, 14)); this.txtSearch.setFont(new Font("Verdana", Font.PLAIN, 14)); this.btnSearchClear = new PzrButton( long_x * (maxx - 3), (int) (long_y * 0.5), long_x * 3, long_y * 2, "btnSearchClear", "", palette.getColor("#DFF2BF"), ""); this.btnSearchClear.setOpaque(false); this.btnSearchClear.setForeground(palette.getColor("#000000")); this.btnSearchClear.repaint("/gui/image/grid_search_clear.png", 32, 32); _D.add(btnGridFirst); _D.add(btnGridPrevious); _D.add(btnGridSet1); _D.add(btnGridSet2); _D.add(btnGridSet3); _D.add(btnGridSet4); _D.add(btnGridSet5); _D.add(btnGridNext); _D.add(btnGridLast); _D.add(btnGridRefresh); _D.add(lblSearch); _D.add(cboSearch); _D.add(txtSearch); _D.add(btnSearchClear); // Show this.setUndecorated(true); this.getRootPane().setWindowDecorationStyle(JRootPane.NONE); this.setLocationRelativeTo(null); this.setModal(true); }