Skip to content

Commit

Permalink
Minor improvements to the color scheme of the new dark UI theme.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Wisser committed Jul 8, 2024
1 parent f329ca7 commit c9a271d
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 20 deletions.
3 changes: 2 additions & 1 deletion src/main/engine/net/sf/jailer/datamodel/DataModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ public static String getVersionFile(ExecutionContext executionContext) {
*/
public static class XmlSettings {
public String datePattern = "yyyy-MM-dd";
public String timestampPattern = "yyyy-MM-dd-HH.mm.ss";
public String timestampPattern = "yyyy-MM-dd-HH.mm.ss"; // TODO
// TODO ISO-8601
public String rootTag = "rowset";
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/gui/net/sf/jailer/ui/Colors.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ private static void initColors() {
Color_255_230_230.init(new Color(255, 210, 210), new Color(85, 28, 28));

Color_0_0_255.init(new Color(0, 0, 255), Color_0_0_220.dark);
Color_0_80_255_80.init(new Color(0, 80, 255, 80), new Color(190, 200, 255, 100));
Color_255_0_0_120.init(new Color(255, 0, 0, 120), new Color(240, 58, 58, 140));

// TODO check "tranparent" todos

Expand Down Expand Up @@ -165,7 +167,6 @@ private static void initColors() {
Color_0_40_90.init(new Color(0, 40, 90));
Color_0_55_0.init(new Color(0, 55, 0));
Color_0_80_160.init(new Color(0, 80, 160));
Color_0_80_255_80.init(new Color(0, 80, 255, 80)); // TODO tranparent
Color_0_96_0.init(new Color(0, 96, 0));
Color_100_0_0.init(new Color(100, 0, 0));
Color_100_100_100.init(new Color(100, 100, 100));
Expand Down Expand Up @@ -221,7 +222,6 @@ private static void initColors() {
Color_247_247_247.init(new Color(247, 247, 247));
Color_250_250_255.init(new Color(250, 250, 255));
Color_255_0_0_0.init(new Color(255, 0, 0, 0)); // TODO tranparent
Color_255_0_0_120.init(new Color(255, 0, 0, 120)); // TODO tranparent
Color_255_0_0_150.init(new Color(255, 0, 0, 150)); // TODO tranparent
Color_255_0_0_20.init(new Color(255, 0, 0, 20)); // TODO tranparent
Color_255_0_0_50.init(new Color(255, 0, 0, 50)); // TODO tranparent
Expand Down
7 changes: 5 additions & 2 deletions src/main/gui/net/sf/jailer/ui/ExtendetCopyPanel.form
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,18 @@
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel3">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="/* Renaming also in *.form! */ Colors.Color_255_255_255" type="code"/>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" id="white" palette="1" red="ff" type="palette"/>
</Property>
</Properties>

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
<Component class="javax.swing.JLabel" name="formattedContentLabel">
<Properties>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="1" green="0" red="0" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="jLabel2"/>
</Properties>
<Constraints>
Expand Down
4 changes: 3 additions & 1 deletion src/main/gui/net/sf/jailer/ui/ExtendetCopyPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
plainPanel.setLayout(new java.awt.BorderLayout());
previewPanel.add(plainPanel, "plain");

jPanel3.setBackground(/* Renaming also in *.form! */ Colors.Color_255_255_255);
jPanel3.setBackground(java.awt.Color.white);
jPanel3.setLayout(new java.awt.GridBagLayout());

formattedContentLabel.setForeground(new java.awt.Color(0, 0, 1));
formattedContentLabel.setText("jLabel2");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
Expand Down Expand Up @@ -1035,3 +1036,4 @@ public void lostOwnership(Clipboard clipboard, Transferable contents) {
// TODO offer other flavors: JSON, XML, ...

}

10 changes: 3 additions & 7 deletions src/main/gui/net/sf/jailer/ui/ProgressPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ public void updateRowsPerTable(Map<String, Long> rowsPerTable) {
for (String tableName: rowsPerTable.keySet()) {
Color bgColor;
if (y % 2 == 0) {
bgColor = Colors.Color_240_255_255;
bgColor = UIUtil.TABLE_BACKGROUND_COLOR_1;
} else {
bgColor = Colors.Color_255_255_255;
bgColor = UIUtil.TABLE_BACKGROUND_COLOR_2;
}
JLabel l = createLabel(y, tableName, bgColor);
l.setText(" " + tableName + " ");
Expand All @@ -120,11 +120,7 @@ public void updateRowsPerTable(Map<String, Long> rowsPerTable) {
rowsPerTablePanel.add(l, gridBagConstraints);

l = new JLabel("" + UIUtil.format(rowsPerTable.get(tableName)) + " ");
if (y % 2 == 0) {
l.setBackground(Colors.Color_240_255_255);
} else {
l.setBackground(Colors.Color_255_255_255);
}
l.setBackground(bgColor);
l.setOpaque(true);
l.setFont(nonbold);
l.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
Expand Down
2 changes: 1 addition & 1 deletion src/main/gui/net/sf/jailer/ui/ProgressTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ public void addRow(List<CellInfo> cells, int day, boolean scrollToBottom) {
++l;
}
}
Color bg = (l % 2 == 0) ? BG1 : BG2;
Color bg = (l % 2 != 0) ? BG1 : BG2;
while (!row.isEmpty()) {
Object[] rowO = new Object[MAX_TABLES_PER_LINE + 1];
boolean rowIsEmpty = true;
Expand Down
2 changes: 1 addition & 1 deletion src/main/gui/net/sf/jailer/ui/RestrictionEditor.form
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
<Component class="javax.swing.JLabel" name="restrictedDependencyWarning">
<Properties>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="/* Renaming also in *.form! */ Colors.Color_255_0_51" type="code"/>
<Connection code="/* Renaming also in *.form! */ Colors.Color_255_0_0" type="code"/>
</Property>
<Property name="text" type="java.lang.String" value="Restricted Dependency! "/>
</Properties>
Expand Down
2 changes: 1 addition & 1 deletion src/main/gui/net/sf/jailer/ui/RestrictionEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private void initComponents() {
ignore.setText("Disabled ");
jPanel1.add(ignore);

restrictedDependencyWarning.setForeground(/* Renaming also in *.form! */ Colors.Color_255_0_51);
restrictedDependencyWarning.setForeground(/* Renaming also in *.form! */ Colors.Color_255_0_0);
restrictedDependencyWarning.setText("Restricted Dependency! ");
jPanel1.add(restrictedDependencyWarning);

Expand Down
12 changes: 12 additions & 0 deletions src/main/gui/net/sf/jailer/ui/databrowser/DataBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -6980,6 +6980,18 @@ public void onDataModelsChanged() {
@Override
public void onNewPlaf() {
updateStatusBar();
UIUtil.invokeLater(() -> {
try {
if (desktop != null) {
File tmpFile = Configuration.getInstance().createTempFile();
desktop.storeSession(tmpFile.toString());
desktop.restoreSession(null, this, tmpFile.toString(), true);
tmpFile.delete();
}
} catch (Exception e) {
UIUtil.showException(this, "Error", e, session);
}
});
}

private ImageIcon tableIcon;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,18 @@
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
</Container>
<Component class="javax.swing.JButton" name="cancelInStautusbarButton">
<Properties>
<Property name="text" type="java.lang.String" value="Cancel"/>
<Property name="toolTipText" type="java.lang.String" value="Cancel"/>
<Property name="focusable" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="4" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="4" anchor="13" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
</SubComponents>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,26 @@ protected String prepareStatementForAliasAnalysis(String statement) {

scaledCancelIcon = UIUtil.scaleIcon(this, cancelIcon);
cancelButton.setIcon(scaledCancelIcon);

cancelInStautusbarButton.setIcon(scaledCancelIcon);

cancelButton.addPropertyChangeListener("enabled", e -> {
if (cancelButton.isEnabled()) {
Timer timer = new Timer(500, ev -> {
cancelInStautusbarButton.setVisible(cancelButton.isEnabled());
});
timer.setRepeats(false);
timer.start();
} else {
cancelInStautusbarButton.setVisible(false);
}
});
cancelInStautusbarButton.setVisible(false);
cancelInStautusbarButton.addActionListener(e -> {
if (cancelButton.isEnabled()) {
cancelButton.doClick(0);
}
});

scaledExplainIcon = UIUtil.scaleIcon(this, explainIcon);
explainButton.setIcon(scaledExplainIcon);

Expand Down Expand Up @@ -1773,6 +1792,8 @@ public void actionPerformed(ActionEvent e) {
updateResultUI();
JPanel tp;
jTabbedPane1.setTabComponentAt(jTabbedPane1.indexOfComponent(rTabContainer), tp = getTitlePanel(jTabbedPane1, rTabContainer, tabContentPanel, title, rb));
tp.setToolTipText(tabContentPanel.statementLabel.getToolTipText());
tabContentPanel.statementLabel.addPropertyChangeListener("text", e -> tp.setToolTipText(tabContentPanel.statementLabel.getToolTipText()));
rowBrowserPerRTabContainer.put(rTabContainer, rb);
rowBrowserPerRTabContainer.put(tp, rb);

Expand Down Expand Up @@ -2627,6 +2648,7 @@ private void initComponents() {
dummyLabel = new javax.swing.JLabel();
continueButton = new javax.swing.JButton();
jPanel4 = new javax.swing.JPanel();
cancelInStautusbarButton = new javax.swing.JButton();
jPanel3 = new javax.swing.JPanel();
jTabbedPane1 = new javax.swing.JTabbedPane();
jLabel2 = new javax.swing.JLabel();
Expand Down Expand Up @@ -2793,6 +2815,16 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
gridBagConstraints.weightx = 1.0;
jPanel6.add(jPanel4, gridBagConstraints);

cancelInStautusbarButton.setText("Cancel");
cancelInStautusbarButton.setToolTipText("Cancel");
cancelInStautusbarButton.setFocusable(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 4;
gridBagConstraints.gridy = 1;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
jPanel6.add(cancelInStautusbarButton, gridBagConstraints);

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 2;
Expand Down Expand Up @@ -2860,6 +2892,7 @@ private void continueButtonActionPerformed(java.awt.event.ActionEvent evt) {//GE

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton cancelButton;
private javax.swing.JButton cancelInStautusbarButton;
private javax.swing.JButton clearButton;
private javax.swing.JPanel consoleContainerPanel;
private javax.swing.JButton continueButton;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,11 +639,11 @@ private StringBuilder createContent(JTable rowsTable, Object sep, boolean aligne
}
if (incHeader && ((rotate ^ columnNamesInFirstRow)? (x == 0) : (y == 0))) {
if (colored) {
sb.append(" bgcolor=" + Colors.HTMLColor_eeeeff + "");
sb.append(" bgcolor=\"#eeeeff\"");
}
} else {
if (colored) {
sb.append(rowNum % 2 == 0? "" : " bgcolor=" + Colors.HTMLColor_eeffee + "");
sb.append(rowNum % 2 == 0? "" : " bgcolor=\"#eeffee\"");
}
}
if (aligned) {
Expand Down Expand Up @@ -708,7 +708,7 @@ private StringBuilder createContent(JTable rowsTable, Object sep, boolean aligne
}
}
if (html) {
sb.append("</body></table></html>");
sb.append("</table></body></html>");
} else if (cellsRendered == 1) {
sb = new StringBuilder(sb.toString().trim());
}
Expand Down

0 comments on commit c9a271d

Please sign in to comment.