package art.client.GUI.components.devices.window.colors.rtz32.realtime.components.distribution; import art.library.gui.FlatGUI; import art.library.model.devices.colors.controller.RTZ32.RTZ32_Controller; import art.library.model.devices.colors.controller.RTZ32.configuration.RTZ32_Configuration; import art.library.model.devices.colors.controller.RTZ32.configuration.RTZ32_Configuration_Group; import art.servers.Shared; import java.awt.BasicStroke; import java.awt.Font; import java.awt.Graphics2D; import java.awt.geom.Line2D; import java.awt.geom.Rectangle2D; import javax.swing.JPanel; public class Diagram_Distribution_Realtime_Header_Y extends JPanel { private RTZ32_Controller rtz32 = null; public Diagram_Distribution_Realtime_Header_Y(RTZ32_Controller rtz32) { this.rtz32 = rtz32; this.setLayout(null); } public void paintPhases (Graphics2D g2, int h) { try { int w = getWidth(); double dy = (int)((double)h / 3); g2.setColor(FlatGUI.lookDesign.getColor("label.color.foreground")); Font font = FlatGUI.lookDesign.getFont("label.font"); Diagram_Distribution_Realtime.drawLeftString(g2, Shared.getMessage("Saturation zone"), new Rectangle2D.Double(10, dy, w, dy), font); Diagram_Distribution_Realtime.drawLeftString(g2, Shared.getMessage("Phase"), new Rectangle2D.Double(10, dy*2, w, dy), font); g2.setColor(FlatGUI.lookDesign.getColor("button.color.background").darker()); g2.draw(new Line2D.Double(0, 0, w, 0)); g2.draw(new Line2D.Double(0, dy, w, dy)); g2.draw(new Line2D.Double(0, dy*2, w, dy*2)); } catch (Exception e) { } } public void paintGroups (Graphics2D g2, int h) { try { RTZ32_Configuration configuration = rtz32.getDeviceConfiguration().rtz32; int w = getWidth(); g2.setStroke(new BasicStroke(1.0f)); Font font = FlatGUI.lookDesign.getFont("label.font"); int numberBars = configuration.getNumberValidGroups(); double dy = (double)((double)h / (double)numberBars); ////////////////////////////////////////////////////////////////////////////////////////////////// // Quitar si no se quiere que ocupe toda la altura de pantalla // // dy = Math.min(dy, 36); // h = (int)(dy * configuration.groups.size()); // ////////////////////////////////////////////////////////////////////////////////////////////////// g2.setColor(FlatGUI.lookDesign.getColor("label.color.foreground")); g2.rotate(-Math.PI/2, 25, h/2); Diagram_Distribution_Realtime.drawCenteredString(g2, Shared.getMessage("Group"), new Rectangle2D.Double(0, 0, 50, h), font); g2.rotate((Math.PI/2), 25, h/2); double currenty = 0; for (int i=0; i