Alejandro Acuña
2025-04-29 d1d736e487d9eb104dcae9def948066037afd2f0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
package art.client.GUI.components.devices.window.colors.rtz32.tables.main;
 
import art.client.GUI.components.devices.window.colors.rtz32.tables.Table;
import art.library.gui.flat.FlatPanel;
import art.library.gui.flat.FlatSplitPane;
import art.library.gui.flat.FlatTableInput;
import art.library.gui.flat.FlatTitle;
import art.library.model.devices.colors.controller.RTZ32.RTZ32_ControllerConfiguration;
import art.servers.Shared;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import javax.swing.JSplitPane;
import javax.swing.SwingConstants;
 
public class Table6 extends Table
{
    private static String[] SYNCHRONISM_TYPE = new String[]
    {
        Shared.getMessage("Unsynchronizable"),
        Shared.getMessage("Synchronism type 1"),
        Shared.getMessage("Synchronism type 2"),
        Shared.getMessage("Synchronism type 3")
    };
 
    private static String[] SYNCHRONISM_MODE = new String[]
    {
        Shared.getMessage("Normal"),
        Shared.getMessage("Master/Slave"),
    };
 
    private static String[] SYNCHRONISM_SEMIACTUATED = new String[]
    {
        Shared.getMessage("Normal"),
        Shared.getMessage("Semiactuated, type 1"),
        Shared.getMessage("Semiactuated, type 2"),
        Shared.getMessage("Semiactuated, type 2"),
    };
    
    
 
    public Table6(RTZ32_ControllerConfiguration configuration)
    {
        super(configuration, "table6.html");
        initialise();
        reload(configuration);
    }
    
    
    public void editable(boolean value)
    {
        if (tableinput != null) tableinput.setEditable(value);
        if (table != null) table.setEditable(value);
    }    
 
    
    public void reload(RTZ32_ControllerConfiguration configuration)
    {
        super.reload(configuration);
    
        try
        {
            tableinput.setFieldIndex(Shared.getMessage("Synchronism type"), configuration.rtz32.operationMode, "synchronismType");
            tableinput.setField(Shared.getMessage("Synchronism (table 78)"), configuration.rtz32.operationMode, "synchronismTable78");
            tableinput.setFieldIndex(Shared.getMessage("Synchronism mode"), configuration.rtz32.operationMode, "synchronismMode");
            tableinput.setField(Shared.getMessage("Slave synchronizable"), configuration.rtz32.operationMode, "slaveSynchronizable");
            tableinput.setField(Shared.getMessage("Master synchronizable"), configuration.rtz32.operationMode, "masterSynchronizable");
            tableinput.setFieldIndex(Shared.getMessage("Semiactuade mode"), configuration.rtz32.operationMode, "semiactuatedMode");
            tableinput.setField(Shared.getMessage("Extension (synchronism type 1)"), configuration.rtz32.operationMode, "cycleExtensionSynchronismType1");
            tableinput.setField(Shared.getMessage("Reduction (synchronism type 1)"), configuration.rtz32.operationMode, "cycleReductionSynchronismType1");
            tableinput.setField(Shared.getMessage("Extension (synchronism type 2)"), configuration.rtz32.operationMode, "inhibitionExtendsSynchronismType2");
            tableinput.setField(Shared.getMessage("Extension (synchronism type 3)"),configuration.rtz32.operationMode, "inhibitionExtendsSynchronismType3");
 
            tableinput.setValueIndex(Shared.getMessage("Synchronism type"), configuration.rtz32.operationMode.synchronismType);
            tableinput.setValue(Shared.getMessage("Synchronism (table 78)"), configuration.rtz32.operationMode.synchronismTable78);
            tableinput.setValueIndex(Shared.getMessage("Synchronism mode"), configuration.rtz32.operationMode.synchronismMode);
            tableinput.setValue(Shared.getMessage("Slave synchronizable"), configuration.rtz32.operationMode.slaveSynchronizable);
            tableinput.setValue(Shared.getMessage("Master synchronizable"), configuration.rtz32.operationMode.masterSynchronizable);
            tableinput.setValueIndex(Shared.getMessage("Semiactuade mode"), configuration.rtz32.operationMode.semiactuatedMode);
            tableinput.setValue(Shared.getMessage("Extension (synchronism type 1)"), configuration.rtz32.operationMode.cycleExtensionSynchronismType1);
            tableinput.setValue(Shared.getMessage("Reduction (synchronism type 1)"), configuration.rtz32.operationMode.cycleReductionSynchronismType1);
            tableinput.setValue(Shared.getMessage("Extension (synchronism type 2)"), configuration.rtz32.operationMode.inhibitionExtendsSynchronismType2);
            tableinput.setValue(Shared.getMessage("Extension (synchronism type 3)"),configuration.rtz32.operationMode.inhibitionExtendsSynchronismType3);
        }
        catch (Exception exception)
        {   
        }
    }
 
 
    private void initialise()
    {
        FlatPanel panel1 = new FlatPanel();
        {
            tableinput = new FlatTableInput(250);
            {
                 tableinput.addComboBox(Shared.getMessage("Synchronism type"), SYNCHRONISM_TYPE, 24);
                 tableinput.addCheckBox(Shared.getMessage("Synchronism (table 78)"), Shared.getMessage("Enabled"), Shared.getMessage("Disabled"), 24);
                 tableinput.addComboBox(Shared.getMessage("Synchronism mode"),SYNCHRONISM_MODE, 24);
                 tableinput.addCheckBox(Shared.getMessage("Slave synchronizable"), Shared.getMessage("Yes"), Shared.getMessage("No"), 24);
                 tableinput.addCheckBox(Shared.getMessage("Master synchronizable"), Shared.getMessage("Yes"), Shared.getMessage("No"), 24);
                 tableinput.addComboBox(Shared.getMessage("Semiactuade mode"), SYNCHRONISM_SEMIACTUATED, 24);
                 tableinput.addNumericTextField(Shared.getMessage("Extension (synchronism type 1)"), 0, 100, 24);
                 tableinput.addNumericTextField(Shared.getMessage("Reduction (synchronism type 1)"), 0, 100, 24);
                 tableinput.addNumericTextField(Shared.getMessage("Extension (synchronism type 2)"), 0, 100, 24);
                 tableinput.addNumericTextField(Shared.getMessage("Extension (synchronism type 3)"), 0, 100, 24);
 
                 tableinput.setMeasurementUnits(Shared.getMessage("Extension (synchronism type 1)"), Shared.getMessage("%"), 100, SwingConstants.CENTER);
                 tableinput.setMeasurementUnits(Shared.getMessage("Reduction (synchronism type 1)"), Shared.getMessage("%"), 100, SwingConstants.CENTER);
                 tableinput.setMeasurementUnits(Shared.getMessage("Extension (synchronism type 2)"), Shared.getMessage("%"), 100, SwingConstants.CENTER);
                 tableinput.setMeasurementUnits(Shared.getMessage("Extension (synchronism type 3)"), Shared.getMessage("%"), 100, SwingConstants.CENTER);
                 
                 tableinput.setEditable(false);
 
             }            
 
            panel1.setLayout(new BorderLayout());
            panel1.add(tableinput.getScrollPane(), BorderLayout.CENTER);
            panel1.setRaisedBorder(0,0,1,1);
        }
        
        FlatSplitPane flatSplitPane1 = new FlatSplitPane();
        {
            panel1.setMinimumSize(new Dimension(0, 0));
            panel1.setPreferredSize(new Dimension(550,0));
            scrollpane.setMinimumSize(new Dimension(0, 0));
            scrollpane.setPreferredSize(new Dimension(0,0));
 
            flatSplitPane1.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
            flatSplitPane1.setOneTouchExpandable();
            flatSplitPane1.changeDividerSize(16);
            flatSplitPane1.setLeftComponent(panel1);
            flatSplitPane1.setRightComponent(scrollpane);
            
            flatSplitPane1.addComponentListener(new ComponentAdapter() 
            {
                public void componentResized(ComponentEvent e) 
                {
                    FlatSplitPane flatSplitPane1 = (FlatSplitPane)e.getSource();
                    flatSplitPane1.setDividerLocation(550);
                }       
            });                 
        }
        
        this.setLayout(new BorderLayout());
        this.add(new FlatTitle(Shared.getMessage("Operating mode and synchronism"), 32), BorderLayout.NORTH);
        this.add(flatSplitPane1, BorderLayout.CENTER);
    }
    
    
    
    
}