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<configuration.getNumberValidGroups(); i++)
|
{
|
RTZ32_Configuration_Group group = configuration.groups[i];
|
Diagram_Distribution_Realtime.drawLeftString(g2, Shared.getMessage("G") + group.number, new Rectangle2D.Double(60, currenty, w-150, dy), font);
|
Diagram_Distribution_Realtime.drawCenteredString(g2, "" + group.getType(), new Rectangle2D.Double(90, currenty, 35, dy), font);
|
Diagram_Distribution_Realtime.drawLeftString(g2, group.getTypeName(), new Rectangle2D.Double(135, currenty, w, dy), font);
|
currenty = currenty + dy;
|
}
|
|
|
g2.setColor(FlatGUI.lookDesign.getColor("button.color.background").darker());
|
g2.draw(new Line2D.Double(0, 0, w, 0));
|
g2.draw(new Line2D.Double(50, 0, 50, h));
|
g2.draw(new Line2D.Double(90, 0, 90, h));
|
g2.draw(new Line2D.Double(125, 0, 125, h));
|
|
currenty = 0;
|
|
for (int i=0; i<configuration.getNumberValidGroups(); i++)
|
{
|
currenty = currenty + dy;
|
g2.draw(new Line2D.Double(50, currenty, w, currenty));
|
}
|
|
g2.draw(new Line2D.Double(0, currenty, w, currenty));
|
}
|
catch (Exception e)
|
{
|
}
|
}
|
|
|
|
|
public void paintFooter(Graphics2D g2, int h)
|
{
|
try
|
{
|
int w = getWidth();
|
double dy = (int)((double)h / 9);
|
|
g2.setColor(FlatGUI.lookDesign.getColor("label.color.foreground"));
|
Font font = FlatGUI.lookDesign.getFont("label.font");
|
Diagram_Distribution_Realtime.drawLeftString(g2, Shared.getMessage("Cycle counter"), new Rectangle2D.Double(10, dy, w, dy), font);
|
Diagram_Distribution_Realtime.drawLeftString(g2, Shared.getMessage("Real cycle counter"), new Rectangle2D.Double(10, dy*2, w-150, dy), font);
|
Diagram_Distribution_Realtime.drawLeftString(g2, Shared.getMessage("Algorithm / Cancelation / Correlation"), new Rectangle2D.Double(10, dy*3, w-150, dy), font);
|
Diagram_Distribution_Realtime.drawLeftString(g2, Shared.getMessage("Trolley demands"), new Rectangle2D.Double(10, dy*4, w, dy), font);
|
Diagram_Distribution_Realtime.drawLeftString(g2, Shared.getMessage("Trolley detector 1"), new Rectangle2D.Double(10, dy*5, w, dy), font);
|
Diagram_Distribution_Realtime.drawLeftString(g2, Shared.getMessage("Trolley detector 2"), new Rectangle2D.Double(10, dy*6, w, dy), font);
|
Diagram_Distribution_Realtime.drawLeftString(g2, Shared.getMessage("Trolley detector 3"), new Rectangle2D.Double(10, dy*7, w, dy), font);
|
Diagram_Distribution_Realtime.drawLeftString(g2, Shared.getMessage("Trolley detector 4"), new Rectangle2D.Double(10, dy*8, w, dy), font);
|
|
g2.setColor(FlatGUI.lookDesign.getColor("button.color.background").darker());
|
|
for (int i=2; i<=8; i++)
|
{
|
g2.draw(new Line2D.Double(0, dy*i, w, dy*i));
|
}
|
|
}
|
catch (Exception e)
|
{
|
}
|
}
|
|
|
}
|