190 lines
7.2 KiB
Java
190 lines
7.2 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.tridium.ui.theme.Theme
|
|
* javax.baja.gx.BColor
|
|
* javax.baja.gx.BInsets
|
|
* javax.baja.gx.BSize
|
|
* javax.baja.gx.Graphics
|
|
* javax.baja.sys.Action
|
|
* javax.baja.sys.BComponent
|
|
* javax.baja.sys.Slot
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
* javax.baja.ui.BBorder
|
|
* javax.baja.ui.BLabel
|
|
* javax.baja.ui.BWidget
|
|
* javax.baja.ui.event.BMouseEvent
|
|
* javax.baja.ui.pane.BBorderPane
|
|
* javax.baja.ui.pane.BEdgePane
|
|
* javax.baja.ui.table.BTable
|
|
* javax.baja.ui.table.DynamicTableModel
|
|
* javax.baja.ui.util.BAuxWidget$Support
|
|
* javax.baja.ui.util.UiLexicon
|
|
*/
|
|
package com.tridium.alarm.ui;
|
|
|
|
import com.tridium.alarm.ui.ConsoleTableModel;
|
|
import com.tridium.ui.theme.Theme;
|
|
import javax.baja.gx.BColor;
|
|
import javax.baja.gx.BInsets;
|
|
import javax.baja.gx.BSize;
|
|
import javax.baja.gx.Graphics;
|
|
import javax.baja.sys.Action;
|
|
import javax.baja.sys.BComponent;
|
|
import javax.baja.sys.Slot;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
import javax.baja.ui.BBorder;
|
|
import javax.baja.ui.BLabel;
|
|
import javax.baja.ui.BWidget;
|
|
import javax.baja.ui.event.BMouseEvent;
|
|
import javax.baja.ui.pane.BBorderPane;
|
|
import javax.baja.ui.pane.BEdgePane;
|
|
import javax.baja.ui.table.BTable;
|
|
import javax.baja.ui.table.DynamicTableModel;
|
|
import javax.baja.ui.util.BAuxWidget;
|
|
import javax.baja.ui.util.UiLexicon;
|
|
|
|
public class BAlarmTitlePane
|
|
extends BEdgePane {
|
|
public static final Action tableModified = BAlarmTitlePane.newAction((int)0, null, null);
|
|
public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BAlarmTitlePane == null ? (class$com$tridium$alarm$ui$BAlarmTitlePane = BAlarmTitlePane.class$("com.tridium.alarm.ui.BAlarmTitlePane")) : class$com$tridium$alarm$ui$BAlarmTitlePane));
|
|
public static final UiLexicon lexicon = new UiLexicon(class$com$tridium$alarm$ui$BAlarmConsole == null ? (class$com$tridium$alarm$ui$BAlarmConsole = BAlarmTitlePane.class$("com.tridium.alarm.ui.BAlarmConsole")) : class$com$tridium$alarm$ui$BAlarmConsole);
|
|
static String sourceText = lexicon.getText("alarm.sources");
|
|
static String alarmText = lexicon.getText("alarm.alarms");
|
|
static BInsets withIcon = BInsets.make((double)1.0, (double)4.0, (double)1.0, (double)2.0);
|
|
static BInsets withoutIcon = BInsets.make((double)2.0, (double)4.0, (double)2.0, (double)4.0);
|
|
BWidget content;
|
|
BLabel label;
|
|
BLabel info;
|
|
BEdgePane top;
|
|
BTable table;
|
|
static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmTitlePane;
|
|
static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmConsole;
|
|
|
|
public void tableModified() {
|
|
this.invoke(tableModified, null, null);
|
|
}
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public static BAlarmTitlePane makePane(String string, BTable bTable) {
|
|
BAlarmTitlePane bAlarmTitlePane = new BAlarmTitlePane(string, (BWidget)bTable);
|
|
bAlarmTitlePane.setTable(bTable);
|
|
return bAlarmTitlePane;
|
|
}
|
|
|
|
public BAlarmTitlePane(String string, BWidget bWidget) {
|
|
this.content = bWidget;
|
|
this.label = new BLabel(string);
|
|
this.label.setFont(Theme.widget().getBoldText());
|
|
this.label.setForeground(BColor.white.toBrush());
|
|
this.top = new BEdgePane();
|
|
this.top.setLeft((BWidget)this.label);
|
|
BBorderPane bBorderPane = new BBorderPane((BWidget)this.top, BBorder.make((String)"top(1) left(1) right(1)"), withoutIcon);
|
|
bBorderPane.setFill(Theme.widget().getControlShadow());
|
|
BEdgePane bEdgePane = new BEdgePane();
|
|
bEdgePane.setTop((BWidget)bBorderPane);
|
|
bEdgePane.setCenter(bWidget);
|
|
this.setCenter((BWidget)new BBorderPane((BWidget)bEdgePane, BBorder.inset, BInsets.DEFAULT));
|
|
}
|
|
|
|
public BAlarmTitlePane() {
|
|
}
|
|
|
|
public void setTitleVisible(boolean bl) {
|
|
this.top.getParentWidget().setVisible(bl);
|
|
}
|
|
|
|
public void setTitle(String string) {
|
|
this.label.setText(string);
|
|
}
|
|
|
|
public void setTable(BTable bTable) {
|
|
this.table = bTable;
|
|
if (this.info == null) {
|
|
this.info = new BLabel("");
|
|
this.info.setFont(Theme.widget().getBoldText());
|
|
this.info.setForeground(BColor.white.toBrush());
|
|
this.top.setRight((BWidget)this.info);
|
|
}
|
|
if (this.get("tableLink") != null) {
|
|
this.remove("tableLink");
|
|
}
|
|
this.linkTo("tableLink", (BComponent)bTable, (Slot)BTable.tableModified, (Slot)tableModified);
|
|
this.doTableModified();
|
|
}
|
|
|
|
public void doTableModified() {
|
|
int n = 0;
|
|
int n2 = 0;
|
|
try {
|
|
DynamicTableModel dynamicTableModel = (DynamicTableModel)this.table.getModel();
|
|
ConsoleTableModel consoleTableModel = (ConsoleTableModel)dynamicTableModel.getRootModel();
|
|
n = consoleTableModel.getSourceCount();
|
|
n2 = consoleTableModel.getAlarmCount();
|
|
}
|
|
catch (Exception exception) {
|
|
// empty catch block
|
|
}
|
|
this.info.setText(n + " " + sourceText + " / " + n2 + " " + alarmText);
|
|
this.relayout();
|
|
}
|
|
|
|
static /* synthetic */ Class class$(String string) {
|
|
try {
|
|
return Class.forName(string);
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
|
|
class AuxSupport
|
|
extends BAuxWidget.Support {
|
|
final BSize size = BSize.make((double)10.0, (double)16.0);
|
|
|
|
AuxSupport() {
|
|
}
|
|
|
|
public BSize getPreferredSize() {
|
|
return this.size;
|
|
}
|
|
|
|
public void paint(Graphics graphics, double d, double d2) {
|
|
graphics.setBrush(BColor.white);
|
|
double d3 = 2.0;
|
|
double d4 = 5.0;
|
|
if (BAlarmTitlePane.this.content.isVisible()) {
|
|
graphics.strokeLine(d3, d4 + 2.0, d3 + 2.0, d4);
|
|
graphics.strokeLine(d3 + 2.0, d4, d3 + 4.0, d4 + 2.0);
|
|
graphics.strokeLine(d3 + 1.0, d4 + 2.0, d3 + 2.0, d4 + 1.0);
|
|
graphics.strokeLine(d3 + 2.0, d4 + 1.0, d3 + 3.0, d4 + 2.0);
|
|
graphics.strokeLine(d3, d4 + 6.0, d3 + 2.0, d4 + 4.0);
|
|
graphics.strokeLine(d3 + 2.0, d4 + 4.0, d3 + 4.0, d4 + 6.0);
|
|
graphics.strokeLine(d3 + 1.0, d4 + 6.0, d3 + 2.0, d4 + 5.0);
|
|
graphics.strokeLine(d3 + 2.0, d4 + 5.0, d3 + 3.0, d4 + 6.0);
|
|
} else {
|
|
graphics.strokeLine(d3, d4, d3 + 2.0, d4 + 2.0);
|
|
graphics.strokeLine(d3 + 2.0, d4 + 2.0, d3 + 4.0, d4);
|
|
graphics.strokeLine(d3 + 1.0, d4, d3 + 2.0, d4 + 1.0);
|
|
graphics.strokeLine(d3 + 2.0, d4 + 1.0, d3 + 3.0, d4);
|
|
graphics.strokeLine(d3, d4 + 4.0, d3 + 2.0, d4 + 6.0);
|
|
graphics.strokeLine(d3 + 2.0, d4 + 6.0, d3 + 4.0, d4 + 4.0);
|
|
graphics.strokeLine(d3 + 1.0, d4 + 4.0, d3 + 2.0, d4 + 5.0);
|
|
graphics.strokeLine(d3 + 2.0, d4 + 5.0, d3 + 3.0, d4 + 4.0);
|
|
}
|
|
}
|
|
|
|
public void mousePressed(BMouseEvent bMouseEvent) {
|
|
BAlarmTitlePane.this.content.setVisible(!BAlarmTitlePane.this.content.getVisible());
|
|
BAlarmTitlePane.this.relayout();
|
|
}
|
|
}
|
|
}
|
|
|