From abc7c96950087834359a021e5845c8a12e945257 Mon Sep 17 00:00:00 2001 From: irengrig Date: Fri, 18 Nov 2011 14:05:04 +0400 Subject: [PATCH] git log tree: icons for nodes --- plugins/git4idea/resources/icons/ball0.png | Bin 0 -> 289 bytes plugins/git4idea/resources/icons/ball1.png | Bin 0 -> 290 bytes plugins/git4idea/resources/icons/ball2.png | Bin 0 -> 309 bytes plugins/git4idea/resources/icons/ball3.png | Bin 0 -> 297 bytes plugins/git4idea/resources/icons/ball4.png | Bin 0 -> 279 bytes plugins/git4idea/resources/icons/ball5.png | Bin 0 -> 326 bytes plugins/git4idea/resources/icons/ball6.png | Bin 0 -> 306 bytes plugins/git4idea/resources/icons/ball7.png | Bin 0 -> 297 bytes plugins/git4idea/resources/icons/greyball.png | Bin 0 -> 234 bytes .../history/wholeTree/GraphGutter.java | 61 +++++++++++------- 10 files changed, 36 insertions(+), 25 deletions(-) create mode 100644 plugins/git4idea/resources/icons/ball0.png create mode 100644 plugins/git4idea/resources/icons/ball1.png create mode 100644 plugins/git4idea/resources/icons/ball2.png create mode 100644 plugins/git4idea/resources/icons/ball3.png create mode 100644 plugins/git4idea/resources/icons/ball4.png create mode 100644 plugins/git4idea/resources/icons/ball5.png create mode 100644 plugins/git4idea/resources/icons/ball6.png create mode 100644 plugins/git4idea/resources/icons/ball7.png create mode 100644 plugins/git4idea/resources/icons/greyball.png diff --git a/plugins/git4idea/resources/icons/ball0.png b/plugins/git4idea/resources/icons/ball0.png new file mode 100644 index 0000000000000000000000000000000000000000..092ae4259852e116782a5a4ca98d9d0451e7a516 GIT binary patch literal 289 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5X4tu&dhE&{&>D$e9$U(sMJj;Fl0FT7y>=8>paI+lTFSusw z$#~A6Z6VW|6e3P63sBxSDK?!|S4N`j;hpN|UKI9rgt_%~jl*^GmFGZ<#vz_B012@0~okF^Avnd(I1U z$Fq}9dG}v84g2(leg9%6ruY;0|Fj?1*6@F_K_Teku1M7{8{;$bB+_S|%Hz9b_Nlc- lzVx9?=RWVh%kml782+cHT(ymHivW6u!PC{xWt~$(695T_an=9; literal 0 HcmV?d00001 diff --git a/plugins/git4idea/resources/icons/ball1.png b/plugins/git4idea/resources/icons/ball1.png new file mode 100644 index 0000000000000000000000000000000000000000..4265a02552b1247d56c94cd39587c6b64ed538db GIT binary patch literal 290 zcmV+-0p0$IP)3c+Xa5_RejLLdrZWTfu8?TAn`@UsK|&i~D@#hycz-wVDIybXBQ zK(tN5+a^+d%G3uRJ&!#H?#k0q)WG3fA-m;e*EOL=lVom}25f`jEf`$KhHg$>@-&L2 z$!jHXETANZ-kQw`9ZZN>)E2VG*ZeJw79!@q`Ml@!B+T4g{GPWlF~``!d{t#Br3{(A oK0)mk07*qoM6N<$g6NKVeE9*xLs@&L>|+(WJylHm8FT8r2#?nWL_?AXT-A zIG*!?!O6?#1^fBHF}VMCXc`bjhQghUy?#H1$s;8wj517fc>BJ4&x%r*JdOhd!A4-Y z)J2+Z|DBBGr0W8n=M#M*uvmbe(fJ|nWGo%+h%qBsKLG{+?}~RsDh#f800000NkvXX Hu0mjf*28}g literal 0 HcmV?d00001 diff --git a/plugins/git4idea/resources/icons/ball3.png b/plugins/git4idea/resources/icons/ball3.png new file mode 100644 index 0000000000000000000000000000000000000000..c4724ab672b8f1f68c2374c1df2a1ce5eec311b0 GIT binary patch literal 297 zcmV+^0oMMBP)JDmG%qv!RN8^m8^tC%nJk(uZtfA$}t)ynoR2dWkri{LXjH1q%kA(}#pIH-U37}C&%13&k>_niByFw~IpMA0%%trCMWxnqB)`IIyAE+tpwDykO@o+F dX0wj~0{|->VI}r1?(P5p002ovPDHLkV1gFzZFK+u literal 0 HcmV?d00001 diff --git a/plugins/git4idea/resources/icons/ball5.png b/plugins/git4idea/resources/icons/ball5.png new file mode 100644 index 0000000000000000000000000000000000000000..49c4fb49533546cbb65ac1f9a5e9d94829e82b60 GIT binary patch literal 326 zcmV-M0lEH(P)r&`5B$=eE7#eH5&?eQ?+}rC(2f+`{8P4~I^C{;X z&$p@%46P%m4XiDbwc$Q|7)R>qhQ3m2+&$`bPR>sGS{5Y9l-Kzx7h&i%&W60W3fT93 ztf}c8?s2e7$5@7*k=Vw$$Tc5n%KR;5@u}&y!EOjzKQ-IfLhC=Wfs@(D@+x^KiKqX_ z2D4%-n(SO2^Pi_@%07*qoM6N<$f_5*Dr~m)} literal 0 HcmV?d00001 diff --git a/plugins/git4idea/resources/icons/ball6.png b/plugins/git4idea/resources/icons/ball6.png new file mode 100644 index 0000000000000000000000000000000000000000..cde73de7f7c154953df26947d099183b0246f4da GIT binary patch literal 306 zcmV-20nPr2P)`I`7unm3! z-TDh8e1*MVLB$VPQ=9k$R3ubly;f{TBT)%2BqoOSy|?c8-bPKFo108#a_^lHhvSPn z_tf*yPb@9gfiufzArSUekE?y|HSiNmRyVy6B;qARof8KcugN z%;V=6OyzDHwRfuiMztBMDykt)AK6qFF)`XEC8Q4^TmILM-ST*8{*=EA^XRaYk}`K< zS21(Ms1@x44!oI$W-3n<;Zc{j2f^gWcpW$kEWQO8037Odvb**sjsO4v07*qoM6N<$ Ef<}LVI{*Lx literal 0 HcmV?d00001 diff --git a/plugins/git4idea/resources/icons/ball7.png b/plugins/git4idea/resources/icons/ball7.png new file mode 100644 index 0000000000000000000000000000000000000000..c759c91fbd1c1aff1077d4aa369dd8e98353fccf GIT binary patch literal 297 zcmV+^0oMMBP)~y^civ;HV|O(S8HvFs#gh>OYnGXzVp)bDQXMM ze<(Z7ouGAc_ck6z@i+;KvhRJt_o^G`9cc9AW8Kj3^{xXAG|*iPp00i_>zopr0BGV|=l}o! literal 0 HcmV?d00001 diff --git a/plugins/git4idea/src/git4idea/history/wholeTree/GraphGutter.java b/plugins/git4idea/src/git4idea/history/wholeTree/GraphGutter.java index 0846d6843c1e..80fd28391f0b 100644 --- a/plugins/git4idea/src/git4idea/history/wholeTree/GraphGutter.java +++ b/plugins/git4idea/src/git4idea/history/wholeTree/GraphGutter.java @@ -16,6 +16,7 @@ package git4idea.history.wholeTree; import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.util.IconLoader; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.ui.Gray; import com.intellij.ui.table.JBTable; @@ -284,8 +285,9 @@ public class GraphGutter { //g.drawLine(x1 - 1,y1,x2 - 1,y2); //g.setColor(Color.gray.brighter()); g.drawLine(x1,y1,x2,y2); - //g.setColor(Color.gray.brighter()); g.drawLine(x1 + 1, y1, x2 + 1, y2); + //g.setColor(Gray._200); + //g.drawLine(x1 + 2, y1, x2 + 2, y2); g.setColor(color); } @@ -369,41 +371,34 @@ public class GraphGutter { int correctedWire = myModel.getCorrectedWire(commitAt); int startXPoint = startPoint(correctedWire, wiresGroups); final boolean inCurrentBranch = myCurrentBranchColored ? myModel.isInCurrentBranch(idx) : true; + final Icon icon; if (inCurrentBranch) { - //myStyle.getColorForWire(startXPoint) - if (PresentationStyle.calm.equals(myStyle)) { - graphics.setColor(fill); - } else { - graphics.setColor(myStyle.getColorForWire(correctedWire).brighter()); - } + icon = myStyle.getNodeIcon(correctedWire); } else { - graphics.setColor(fillNotIncluded); + icon = ourGrey; } - graphics.fillArc(startXPoint + ourLineWidth / 2 - 4, upBound + myRowHeight / 2 - 4, diameter, diameter, 0, 360); - //graphics.setColor(contains ? Color.white : UIUtil.getTableSelectionBackground()); - /*if (contains) { - graphics.setColor(Color.white); + icon.paintIcon(this, graphics, startXPoint + 1, upBound + myRowHeight/2 - 3); + +/* graphics.fillArc(startXPoint + ourLineWidth / 2 - 4, upBound + myRowHeight / 2 - 4, diameter, diameter, 0, 360); + + if (inCurrentBranch) { + if (PresentationStyle.calm.equals(myStyle)) { + graphics.setColor(darker); + } else { + graphics.setColor(myStyle.getColorForWire(correctedWire)); + } + } + else { + graphics.setColor(OUTLINE_NOT_INCLUDED); } - else {*/ - if (inCurrentBranch) { - if (PresentationStyle.calm.equals(myStyle)) { - graphics.setColor(darker); - } else { - graphics.setColor(myStyle.getColorForWire(correctedWire)); - } - } - else { - graphics.setColor(OUTLINE_NOT_INCLUDED); - } - //} graphics.drawArc(startXPoint + ourLineWidth / 2 - 4 + 1, upBound + myRowHeight / 2 - 4, diameter, diameter, 0, 360); graphics.drawArc(startXPoint + ourLineWidth / 2 - 4, upBound + myRowHeight / 2 - 4, diameter, diameter, 0, 360); if (inCurrentBranch) { graphics.setColor(Color.white); graphics.drawArc(startXPoint + ourLineWidth / 2 - 4 + 1, upBound + myRowHeight / 2 - 4 + 1, diameter - 1, diameter - 1, 100, 90); - } + }*/ } ++ idx; upBound += myRowHeight; @@ -484,6 +479,11 @@ public class GraphGutter { } } + private final static Icon[] ourIcons = new Icon[] {IconLoader.getIcon("/icons/ball0.png"), IconLoader.getIcon("/icons/ball1.png"), + IconLoader.getIcon("/icons/ball2.png"), IconLoader.getIcon("/icons/ball3.png"), IconLoader.getIcon("/icons/ball4.png"), + IconLoader.getIcon("/icons/ball5.png"), IconLoader.getIcon("/icons/ball6.png"), IconLoader.getIcon("/icons/ball7.png")}; + private final static Icon ourGrey = IconLoader.getIcon("/icons/greyball.png"); + public static enum PresentationStyle { multicolour() { final Color[] ourColors = {new Color(255,128,0), new Color(0,102,204), new Color(0, 130,130), new Color(255,45,45), new Color(64,64,255), @@ -492,6 +492,11 @@ public class GraphGutter { public Color getColorForWire(int wire) { return ourColors[wire % ourColors.length]; } + + @Override + public Icon getNodeIcon(int wire) { + return ourIcons[wire%ourIcons.length]; + } }, calm() { final Color darker2 = new Color(35,107,178); @@ -501,9 +506,15 @@ public class GraphGutter { public Color getColorForWire(int wire) { return (wire/2 % 2 == 1 ? darker : darker2); } + + @Override + public Icon getNodeIcon(int wire) { + return (wire/2 % 2 == 1 ? ourIcons[0] : ourIcons[1]); + } }; public abstract Color getColorForWire(int wire); + public abstract Icon getNodeIcon(int wire); } public boolean isCurrentBranchColored() {