Skip to content

Commit

Permalink
improved color scheme of the links
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Wisser committed Oct 21, 2024
1 parent 30ba771 commit 31d5b1c
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions src/main/gui/net/sf/jailer/ui/databrowser/Desktop.java
Original file line number Diff line number Diff line change
Expand Up @@ -2419,7 +2419,7 @@ public int compare(Link a, Link b) {
}

final int MAX_PRIO = 5;
for (int prio = rowsClosure.hAlignedPath.isEmpty()? 2 : 0; prio <= MAX_PRIO; ++prio) {
for (int prio = rowsClosure.hAlignedPath.isEmpty()? 1 : 0; prio <= MAX_PRIO; ++prio) {
for (final boolean pbg : new Boolean[] { true, false }) {
for (final RowBrowser tableBrowser : rbSourceToLinks.keySet()) {
if (!tableBrowser.isHidden()) {
Expand Down Expand Up @@ -2484,20 +2484,26 @@ public int compare(Link a, Link b) {
final Point2D end = new Point2D.Double(link.x1, link.y1);
final int ir = dir > 0? i : linksToRender.size() - 1 - i;
final boolean finalLight = light;
boolean sameY = tableBrowser.parent != null && Math.abs(tableBrowser.internalFrame.getY() - tableBrowser.parent.internalFrame.getY()) < 32;
int linkPrio = 0;
if (link.notHAligned) {
if (link.inClosure) {
linkPrio += 1;
}
} else {
linkPrio = 2;
linkPrio = 1;
if (pathToSelectedRowBrowser.contains(tableBrowser)) {
linkPrio += 2;
}
if (link.inClosure) {
linkPrio += 1;
linkPrio += 3;
} else {
if (link.inClosure) {
linkPrio += 2;
}
if (sameY) {
linkPrio += 1;
}
}
}

final boolean doPaint = linkPrio == prio;
Runnable task = new Runnable() {
@Override
Expand Down Expand Up @@ -2599,18 +2605,10 @@ private void paintLink(Point2D start, Point2D end, Color color, Color fgColor, G
1.0f)
: stroke);
}

// TODO

// if ((System.currentTimeMillis() / 4000) % 2 == 0)

if (tableBrowser.parent != null) {
int dist = Math.abs(tableBrowser.internalFrame.getY() - tableBrowser.parent.internalFrame.getY()) / tableBrowser.internalFrame.getHeight();

if (!rowsClosure.hAlignedPath.contains(tableBrowser.browserContentPane) && !inClosure && !notHAligned && numLinks >= 5 && dist > 0 && !dotted && !inClosure && !tableBrowser.internalFrame.isSelected()) {
// stroke = (BasicStroke) g2d.getStroke();
// g2d.setStroke(new BasicStroke(stroke.getLineWidth(), stroke.getEndCap(), stroke.getLineJoin(), stroke.getMiterLimit(), dist == 1? new float[] { 1f, 1.75f } : new float[] { 1f, 2.1f },
// stroke.getDashPhase())); TODO
pseudoHAlignFactor = dist == 1? 0.6f : 1f;
}

Expand All @@ -2626,12 +2624,6 @@ private void paintLink(Point2D start, Point2D end, Color color, Color fgColor, G
fgColorMapPlaf = UIUtil.plaf;
Color mc = fgColorMap.get(fg);

// mc = null; // TODO
// TODO
// TODO
// TODO
// TODO

if (mc == null) {
HSLColor hslColor = new HSLColor(fg);
if (UIUtil.plaf == PLAF.FLATDARK) {
Expand Down

0 comments on commit 31d5b1c

Please sign in to comment.