MCPcopy Index your code
hub / github.com/processing/processing / updateColors

Method updateColors

app/src/processing/app/contrib/ListPanel.java:640–674  ·  view source on GitHub ↗

Updates the colors of all library panels that are visible.

()

Source from the content-addressed store, hash-verified

638 * Updates the colors of all library panels that are visible.
639 */
640 protected void updateColors() {
641 int count = 0;
642 for (Entry<Contribution, DetailPanel> entry : panelByContribution.entrySet()) {
643 DetailPanel panel = entry.getValue();
644 Border border = BorderFactory.createEmptyBorder(1, 1, 1, 1);
645
646 if (panel.isVisible()) {
647 boolean oddRow = count % 2 == 1;
648 Color bgColor = null;
649 Color fgColor = UIManager.getColor("List.foreground");
650
651 if (panel.isSelected()) {
652 bgColor = UIManager.getColor("List.selectionBackground");
653 fgColor = UIManager.getColor("List.selectionForeground");
654 border = UIManager.getBorder("List.focusCellHighlightBorder");
655 } else if (Platform.isMacOS()) {
656 border = oddRow
657 ? UIManager.getBorder("List.oddRowBackgroundPainter")
658 : UIManager.getBorder("List.evenRowBackgroundPainter");
659 } else {
660 bgColor = oddRow
661 ? new Color(219, 224, 229)
662 : new Color(241, 241, 241);
663 }
664
665 panel.setForeground(fgColor);
666 if (bgColor != null) {
667 panel.setBackground(bgColor);
668 }
669 count++;
670 }
671
672 panel.setBorder(border);
673 }
674 }
675
676
677 @Override

Callers 5

contributionAddedMethod · 0.95
contributionRemovedMethod · 0.95
setSelectedPanelMethod · 0.95
itemStateChangedMethod · 0.80
applyFilterMethod · 0.80

Calls 7

isSelectedMethod · 0.95
isMacOSMethod · 0.95
setForegroundMethod · 0.95
getValueMethod · 0.80
setBorderMethod · 0.80
isVisibleMethod · 0.45
getColorMethod · 0.45

Tested by

no test coverage detected