From 061c7c5d8614cdda89876f1fc062a4fdf34f4eb2 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 20 Jul 2019 17:18:59 -0400 Subject: [PATCH] layout progress --- .../ui/src/com/rusefi/trigger/WaveState.java | 6 ------ .../com/rusefi/ui/livedocs/LiveDocPanel.java | 18 +++++++++++------- .../rusefi/ui/livedocs/LiveDocsSandbox.java | 4 ++-- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/java_console/ui/src/com/rusefi/trigger/WaveState.java b/java_console/ui/src/com/rusefi/trigger/WaveState.java index c4dff1f057..03dda1ccad 100644 --- a/java_console/ui/src/com/rusefi/trigger/WaveState.java +++ b/java_console/ui/src/com/rusefi/trigger/WaveState.java @@ -43,10 +43,4 @@ public class WaveState { list.add(0, new EngineReport.UpDown(TriggerImage.angleToTime(prevUp), 0, TriggerImage.angleToTime(unusedDown + 720 * (3 + TriggerImage.EXTRA_COUNT)), 0)); } } - - public int getMaxTime() { - if (list.isEmpty()) - return 0; - return list.get(list.size() - 1).downTime; - } } diff --git a/java_console/ui/src/com/rusefi/ui/livedocs/LiveDocPanel.java b/java_console/ui/src/com/rusefi/ui/livedocs/LiveDocPanel.java index 1a656d9132..bce5614a96 100644 --- a/java_console/ui/src/com/rusefi/ui/livedocs/LiveDocPanel.java +++ b/java_console/ui/src/com/rusefi/ui/livedocs/LiveDocPanel.java @@ -16,6 +16,7 @@ import com.rusefi.ldmp.generated.TpsMeta; import com.rusefi.ldmp.generated.TriggerDecoderMeta; import com.rusefi.ui.livedocs.controls.Toolbox; import com.rusefi.ui.util.UiUtils; +import net.miginfocom.swing.MigLayout; import org.jetbrains.annotations.NotNull; import org.putgemin.VerticalFlowLayout; @@ -27,8 +28,11 @@ import java.util.List; import static com.rusefi.config.Field.niceToString; public class LiveDocPanel { + + private static final String CONSTRAINTS = "wrap, grow"; + @NotNull - public static JPanel getPanel(String title, String instancePrefix, final int id, Field[] values, Request[] content) { + static JPanel getPanel(String title, String instancePrefix, final int id, Field[] values, Request[] content) { ActionPanel ap = createComponents(title, content, values, instancePrefix); JPanel panel = ap.getPanel(); @@ -165,22 +169,22 @@ public class LiveDocPanel { @NotNull public static JPanel createLiveDocumentationPanel() { - JPanel liveDocs = new JPanel(new VerticalFlowLayout()); + JPanel liveDocs = new JPanel(new MigLayout("gap 0, insets 0")); liveDocs.add(getPanel("Coolant Sensor", "CLT", Fields.LDS_CLT_INDEX, - ThermistorState.VALUES, ThermistorsMeta.CONTENT)); + ThermistorState.VALUES, ThermistorsMeta.CONTENT), CONSTRAINTS); liveDocs.add(getPanel("Intake Air Sensor", "IAT", Fields.LDS_IAT_INDEX, - ThermistorState.VALUES, ThermistorsMeta.CONTENT)); + ThermistorState.VALUES, ThermistorsMeta.CONTENT), CONSTRAINTS); liveDocs.add(getPanel("Throttle Position Sensor", "", Fields.LDS_ENGINE_STATE_INDEX, - EngineState.VALUES, TpsMeta.TPS_SECTION)); + EngineState.VALUES, TpsMeta.TPS_SECTION), CONSTRAINTS); liveDocs.add(getPanel("tCharge", "", Fields.LDS_ENGINE_STATE_INDEX, - EngineState.VALUES, SpeedDensityMeta.CONTENT)); + EngineState.VALUES, SpeedDensityMeta.CONTENT), CONSTRAINTS); liveDocs.add(getPanel("Trigger", "", Fields.LDS_TRIGGER_INDEX, - TriggerState.VALUES, TriggerDecoderMeta.CONTENT)); + TriggerState.VALUES, TriggerDecoderMeta.CONTENT), CONSTRAINTS); return liveDocs; } diff --git a/java_console/ui/src/com/rusefi/ui/livedocs/LiveDocsSandbox.java b/java_console/ui/src/com/rusefi/ui/livedocs/LiveDocsSandbox.java index 44c828d3a9..bf21877f3f 100644 --- a/java_console/ui/src/com/rusefi/ui/livedocs/LiveDocsSandbox.java +++ b/java_console/ui/src/com/rusefi/ui/livedocs/LiveDocsSandbox.java @@ -19,11 +19,11 @@ public class LiveDocsSandbox { public static void main(String[] args) { comment.setForeground(Color.blue); - JPanel panels = new JPanel(new MigLayout("gap 0, insets 0")); + JPanel panels = new JPanel(new MigLayout("fillx, gap 0, insets 0")); panels.add(LiveDocPanel.getPanel("Coolant Sensor", "CLT", LDS_CLT_INDEX, ThermistorState.VALUES, ThermistorsMeta.CONTENT), "wrap"); panels.add(LiveDocPanel.getPanel("Intake Air Sensor", "CLT", LDS_CLT_INDEX, ThermistorState.VALUES, ThermistorsMeta.CONTENT), "wrap"); - panels.add(getTChargePanel(), "wrap"); + panels.add(getTChargePanel(), "wrap, grow"); panels.add(comment);