-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1399 from virtualcell/dan-ss-reports2
Cosmetic changes to molecular structures and links tables
- Loading branch information
Showing
5 changed files
with
84 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
vcell-client/src/main/java/org/vcell/util/gui/CompositeIcon.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.vcell.util.gui; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
// see also VCellIcon | ||
// Usage: | ||
// Icon colorIconFirst = new ColorIcon(10, 10, colorFirst, true); | ||
// Icon colorIconSecond = new ColorIcon(10, 10, colorSecond, true); | ||
// Icon compositeIcon = new CompositeIcon(colorIconFirst, colorIconSecond); | ||
public class CompositeIcon implements Icon | ||
{ | ||
private final Icon icon1; | ||
private final Icon icon2; | ||
|
||
public CompositeIcon(Icon icon1, Icon icon2) { | ||
this.icon1 = icon1; | ||
this.icon2 = icon2; | ||
} | ||
|
||
@Override | ||
public void paintIcon(Component c, Graphics g, int x, int y) { | ||
icon1.paintIcon(c, g, x, y); // paint the first icon | ||
icon2.paintIcon(c, g, x + icon1.getIconWidth(), y); // paint the second icon next to the first icon | ||
} | ||
|
||
@Override | ||
public int getIconWidth() { | ||
return icon1.getIconWidth() + icon2.getIconWidth(); // the total width is the sum of both icons' widths | ||
} | ||
|
||
@Override | ||
public int getIconHeight() { | ||
return Math.max(icon1.getIconHeight(), icon2.getIconHeight()); // height is the maximum of both icons' heights | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters