Skip to content

Commit

Permalink
Minor UI improvements and code reformat.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrtannus committed May 26, 2015
1 parent e035092 commit c65450e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@
import org.genemania.plugin.view.components.ToggleDetailPanel;
import org.genemania.plugin.view.util.UiUtils;

@SuppressWarnings("serial")
public class NetworkDetailPanel extends ToggleDetailPanel<Network<?>> {
private static final long serialVersionUID = 1L;

private final Network<?> network;
private final JEditorPane descriptionLabel;
private final JToggleButton expander;
Expand All @@ -60,16 +61,9 @@ public NetworkDetailPanel(Network<?> network, Group<?, ?> group, NetworkUtils ne
this.group = group;
this.data = data;

Color textColor;

if (network.hasInteractions()) {
textColor = Color.black;
} else {
setEnabled(false);
textColor = Color.gray;
}
Color textColor = network.hasInteractions() ? SystemColor.textText : SystemColor.textInactiveText;

setBorder(BorderFactory.createMatteBorder(2, 0, 0, 0, Color.white));
setBorder(BorderFactory.createEmptyBorder(2, 0, 0, 0));
setBackground(SystemColor.text);
setOpaque(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.SystemColor;

import javax.swing.BorderFactory;
import javax.swing.JCheckBox;
Expand All @@ -43,8 +44,9 @@
import org.genemania.plugin.view.components.ToggleDetailPanel;
import org.genemania.plugin.view.util.UiUtils;

@SuppressWarnings("serial")
public class NetworkGroupDetailPanel<NETWORK, NODE, EDGE> extends ToggleDetailPanel<Group<?, ?>> {
private static final long serialVersionUID = 1L;

private final Group<?, ?> group;
private final NetworkInfoPanel networksPanel;
private final JToggleButton expander;
Expand All @@ -56,7 +58,15 @@ public class NetworkGroupDetailPanel<NETWORK, NODE, EDGE> extends ToggleDetailPa
private int barXOffset = -1;
private int barYOffset = -1;

public NetworkGroupDetailPanel(Group<?, ?> group, NetworkGroupInfoPanel<NETWORK, NODE, EDGE> groupInfoPanel, GeneMania<NETWORK, NODE, EDGE> plugin, NetworkUtils networkUtils, UiUtils uiUtils, boolean enabledByDefault, ViewState options) {
public NetworkGroupDetailPanel(
final Group<?, ?> group,
final NetworkGroupInfoPanel<NETWORK, NODE, EDGE> groupInfoPanel,
final GeneMania<NETWORK, NODE, EDGE> plugin,
final NetworkUtils networkUtils,
final UiUtils uiUtils,
final boolean enabledByDefault,
final ViewState options
) {
super(uiUtils);

this.group = group;
Expand All @@ -67,14 +77,9 @@ public NetworkGroupDetailPanel(Group<?, ?> group, NetworkGroupInfoPanel<NETWORK,
NetworkSelectionManager<NETWORK, NODE, EDGE> manager = plugin.getNetworkSelectionManager();
networksPanel.addSelectionListener(manager.createNetworkSelectionListener());

Color textColor;
if (group.hasInteractions()) {
textColor = Color.black;
} else {
textColor = Color.gray;
}
Color textColor = group.hasInteractions() ? SystemColor.textText : SystemColor.textInactiveText;

setBorder(BorderFactory.createMatteBorder(2, 0, 0, 0, Color.white));
setBorder(BorderFactory.createEmptyBorder(2, 0, 0, 0));

setLayout(new GridBagLayout());
JLabel nameLabel = new JLabel(group.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
import org.genemania.plugin.view.components.ToggleInfoPanel;
import org.genemania.plugin.view.util.UiUtils;

@SuppressWarnings("serial")
public class NetworkGroupInfoPanel<NETWORK, NODE, EDGE> extends ToggleInfoPanel<Group<?, ?>, NetworkGroupDetailPanel<NETWORK, NODE, EDGE>> {
private static final long serialVersionUID = 1L;

private final CytoscapeUtils<NETWORK, NODE, EDGE> cytoscapeUtils;
private final GeneMania<NETWORK, NODE, EDGE> plugin;
private final NetworkUtils networkUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,12 @@ public JEditorPane createEditorPane(String text) {
JEditorPane pane = new JEditorPane();
pane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, true);
pane.setEditorKit(new HTMLEditorKit());
pane.setOpaque(false);
pane.setEditable(false);
pane.setText(text);

if (isAquaLAF())
pane.setOpaque(false);

return pane;
}

Expand All @@ -134,6 +137,9 @@ public void hyperlinkUpdate(HyperlinkEvent e) {
};
pane.addHyperlinkListener(linkListener);

if (isAquaLAF())
pane.setOpaque(false);

return pane;
}

Expand Down

0 comments on commit c65450e

Please sign in to comment.