-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,336 additions
and
664 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Main-Class: coderarjob.kpdfsync.poc.Main | ||
Class-Path: pdfclown.jar | ||
|
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,21 @@ | ||
#!/bin/bash | ||
|
||
echo :: Building packages | ||
|
||
rm -rf dist | ||
mkdir dist | ||
|
||
pushd build/classes | ||
|
||
# Create testplib.jar | ||
# BasicParser is what that can change. So it is packaged separately. | ||
jar cfm kpdfsync.jar ../../Manifest.txt \ | ||
coderarjob | ||
popd | ||
|
||
mv build/classes/kpdfsync.jar ./dist/ | ||
cp lib/pdfclown.jar ./dist/ | ||
|
||
|
||
echo :: Building packages completed | ||
|
51 changes: 51 additions & 0 deletions
51
src/coderarjob/kpdfsync/poc/HighlightNotePairListRenderer.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,51 @@ | ||
package coderarjob.kpdfsync.poc; | ||
|
||
import javax.swing.*; | ||
import java.awt.Component; | ||
import java.awt.BorderLayout; | ||
import java.awt.Color; | ||
|
||
public class HighlightNotePairListRenderer extends JPanel implements ListCellRenderer<HighlightNotePair> | ||
{ | ||
|
||
private JLabel highlightLabel; | ||
private JLabel pairedNoteLabel; | ||
private Color alternateColor; | ||
|
||
public HighlightNotePairListRenderer() | ||
{ | ||
this.setLayout (new BorderLayout()); | ||
|
||
highlightLabel = new JLabel(); | ||
String iconResourceName = "/coderarjob/kpdfsync/poc/res/highlighter.png"; | ||
highlightLabel.setIcon (new ImageIcon (getClass().getResource (iconResourceName))); | ||
highlightLabel.setForeground (Color.BLACK); | ||
highlightLabel.setOpaque (false); | ||
this.add (highlightLabel, BorderLayout.PAGE_START); | ||
|
||
pairedNoteLabel = new JLabel(); | ||
pairedNoteLabel.setForeground (Color.DARK_GRAY); | ||
pairedNoteLabel.setOpaque (false); | ||
this.add (pairedNoteLabel, BorderLayout.PAGE_END); | ||
|
||
alternateColor = new Color (237, 244, 249); | ||
this.setBorder (BorderFactory.createEmptyBorder (5, 2, 5, 0)); | ||
} | ||
|
||
public Component getListCellRendererComponent(JList<? extends HighlightNotePair> list, | ||
HighlightNotePair value, int index, | ||
boolean isSelected, boolean cellHasFocus) | ||
{ | ||
highlightLabel.setText (value.getHighlightText()); | ||
pairedNoteLabel.setText (value.getNoteText()); | ||
|
||
Color normalBackgroundColor = (index % 2 == 0) ? alternateColor : list.getBackground(); | ||
|
||
if (isSelected) | ||
this.setBackground (list.getSelectionBackground()); | ||
else | ||
this.setBackground (normalBackgroundColor); | ||
|
||
return this; | ||
} | ||
} |
Oops, something went wrong.