Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into groupDragDrop
Browse files Browse the repository at this point in the history
* upstream/master:
  Donate to JabRef!
  Issuestats.com is down
  Add link to logo creator
  Improve perfomance of opening a database that still used the old groups format (#2636)
  Set POSIX filepermissions to 644 (#2637)
  Fix #2629: Removing entry from group updates view properly
  Remove empty tooltip in group panel
  Refactored around the PDF Annotation Importer (#2624)
  Fix last import issue
  Fix imports and some reformatting
  Fix wrong import order
  Add missing svg icon
  RIP old icon
  Add new logo files (#2164)

# Conflicts:
#	src/main/java/org/jabref/gui/groups/GroupSelector.java
  • Loading branch information
Siedlerchr committed Mar 14, 2017
2 parents 875678b + ef6cda5 commit 6b56eff
Show file tree
Hide file tree
Showing 70 changed files with 557 additions and 626 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
## [Unreleased]

### Changed
- JabRef has a new logo! The logo was designed by "[AikTheOne](https://99designs.de/profiles/theonestudio)" - who was the winner of a design contest at 99designs.com
- Add tab which shows the MathSciNet review website if the `MRNumber` field is present.
- Partly switched to a new UI technology (JavaFX).
- Redesigned group panel.
Expand Down Expand Up @@ -61,9 +62,10 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where the `Move linked files to default file directory`- cleanup operation did not move the files to the location of the bib-file. [#2454](https://github.com/JabRef/jabref/issues/2454)
- We fixed an issue where executing `Move file` on a selected file in the `general`-tab could overwrite an existing file. [#2385](https://github.com/JabRef/jabref/issues/2358)
- We fixed an issue with importing groups and subgroups [#2600](https://github.com/JabRef/jabref/issues/2600)
- Fixed an issue where title-related key patterns did not correspond to the documentation [#2604](https://github.com/JabRef/jabref/issues/2604) [#2589](https://github.com/JabRef/jabref/issues/2589)
- We fixed an issue which prohibited the citation export to external programms on MacOS [#2613](https://github.com/JabRef/jabref/issues/2613)
- We fixed an issue where the file folder could not be changed when running `Get fulltext` in the `general`-tab [#2572](https://github.com/JabRef/jabref/issues/2572)
- Fixed an issue where title-related key patterns did not correspond to the documentation. [#2604](https://github.com/JabRef/jabref/issues/2604) [#2589](https://github.com/JabRef/jabref/issues/2589)
- We fixed an issue which prohibited the citation export to external programms on MacOS. [#2613](https://github.com/JabRef/jabref/issues/2613)
- We fixed an issue where the file folder could not be changed when running `Get fulltext` in the `general`-tab. [#2572](https://github.com/JabRef/jabref/issues/2572)
- Newly created libraries no longer have the executable bit set under POSIX/Linux systems. The file permissions are now set to `664 (-rw-rw-r--)`. [#2635](https://github.com/JabRef/jabref/issues/#2635)
### Removed


Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
[![Build Status](https://travis-ci.org/JabRef/jabref.svg?branch=master)](https://travis-ci.org/JabRef/jabref)
[![Dependency Status](https://www.versioneye.com/user/projects/557f2723386664002000009c/badge.svg?style=flat)](https://www.versioneye.com/user/projects/557f2723386664002000009c)
[![codecov.io](https://codecov.io/github/JabRef/jabref/coverage.svg?branch=master)](https://codecov.io/github/JabRef/jabref?branch=master)
[![Donation](https://img.shields.io/badge/donate-something-orange.svg)](https://donations.jabref.org)
[![Issue Stats](http://www.issuestats.com/github/jabref/jabref/badge/pr)](http://www.issuestats.com/github/jabref/jabref)
[![Issue Stats](http://www.issuestats.com/github/jabref/jabref/badge/issue)](http://www.issuestats.com/github/jabref/jabref)
[![Donation](https://img.shields.io/badge/donate-to%20jabref-orange.svg)](https://donations.jabref.org)

This version is a development version. Features may not work as expected.

Expand Down
2 changes: 1 addition & 1 deletion buildres/JabRef.VisualElementsManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<VisualElements ForegroundText="light" BackgroundColor="#4F5F8F" ShowNameOnSquare150x150Logo="on"></VisualElements>
<VisualElements ForegroundText="dark" BackgroundColor="#a2aed1" ShowNameOnSquare150x150Logo="on"></VisualElements>
</Application>
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private void openWindow() {
for (int i = 0; (i < bibDatabases.size()) && (i < JabRefGUI.getMainFrame().getBasePanelCount()); i++) {
ParserResult pr = bibDatabases.get(i);
BasePanel panel = JabRefGUI.getMainFrame().getBasePanelAt(i);
OpenDatabaseAction.performPostOpenActions(panel, pr, true);
OpenDatabaseAction.performPostOpenActions(panel, pr);
}

LOGGER.debug("Finished adding panels");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/cli/CrossrefFetcherEvaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
import java.util.concurrent.atomic.AtomicInteger;

import org.jabref.Globals;
import org.jabref.logic.identifier.DOI;
import org.jabref.logic.importer.ParserResult;
import org.jabref.logic.importer.fetcher.CrossRef;
import org.jabref.logic.importer.fileformat.BibtexParser;
import org.jabref.logic.identifier.DOI;
import org.jabref.model.database.BibDatabase;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.FieldName;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/ClipBoardManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import java.util.Optional;

import org.jabref.Globals;
import org.jabref.logic.identifier.DOI;
import org.jabref.logic.importer.FetcherException;
import org.jabref.logic.importer.fetcher.DoiFetcher;
import org.jabref.logic.importer.fileformat.BibtexParser;
import org.jabref.logic.identifier.DOI;
import org.jabref.model.database.BibDatabase;
import org.jabref.model.entry.BibEntry;

Expand Down
14 changes: 14 additions & 0 deletions src/main/java/org/jabref/gui/IconTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
import java.io.InputStreamReader;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

Expand Down Expand Up @@ -341,6 +343,18 @@ public FontBasedIcon createSmallIcon() {
public FontBasedIcon createWithNewColor(Color newColor) {
return new FontBasedIcon(this.iconCode, newColor, this.size);
}
}

public static List<java.awt.Image> getLogoSet() {
List<java.awt.Image> jabrefLogos = new ArrayList<>();
jabrefLogos.add(new ImageIcon(getIconUrl("jabrefIcon16")).getImage());
jabrefLogos.add(new ImageIcon(getIconUrl("jabrefIcon20")).getImage());
jabrefLogos.add(new ImageIcon(getIconUrl("jabrefIcon32")).getImage());
jabrefLogos.add(new ImageIcon(getIconUrl("jabrefIcon40")).getImage());
jabrefLogos.add(new ImageIcon(getIconUrl("jabrefIcon48")).getImage());
jabrefLogos.add(new ImageIcon(getIconUrl("jabrefIcon64")).getImage());
jabrefLogos.add(new ImageIcon(getIconUrl("jabrefIcon128")).getImage());

return jabrefLogos;
}
}
3 changes: 1 addition & 2 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JComponent;
Expand Down Expand Up @@ -551,7 +550,7 @@ private void init() {
setGlassPane(glassPane);

setTitle(FRAME_TITLE);
setIconImage(new ImageIcon(IconTheme.getIconUrl("jabrefIcon48")).getImage());
setIconImages(IconTheme.getLogoSet());
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/actions/CopyDoiUrlAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import org.jabref.JabRefGUI;
import org.jabref.gui.ClipBoardManager;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.identifier.DOI;
import org.jabref.logic.l10n.Localization;

/**
* Copies the doi url to the clipboard
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/desktop/JabRefDesktop.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
import org.jabref.gui.filelist.FileListEntryEditor;
import org.jabref.gui.filelist.FileListTableModel;
import org.jabref.gui.undo.UndoableFieldChange;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.identifier.DOI;
import org.jabref.logic.identifier.Eprint;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.util.OS;
import org.jabref.logic.util.io.FileUtil;
import org.jabref.model.database.BibDatabaseContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
import org.jabref.gui.fieldeditors.FieldEditor;
import org.jabref.gui.mergeentries.FetchAndMergeEntry;
import org.jabref.gui.undo.UndoableFieldChange;
import org.jabref.logic.identifier.DOI;
import org.jabref.logic.identifier.ISBN;
import org.jabref.logic.journals.JournalAbbreviationRepository;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.net.URLUtil;
import org.jabref.logic.identifier.DOI;
import org.jabref.logic.identifier.ISBN;
import org.jabref.model.database.BibDatabaseMode;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.FieldName;
Expand Down
68 changes: 37 additions & 31 deletions src/main/java/org/jabref/gui/entryeditor/FileAnnotationTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
import java.awt.Component;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.StringJoiner;

import javax.swing.BoxLayout;
Expand Down Expand Up @@ -40,7 +43,7 @@ class FileAnnotationTab extends JPanel {

private final JList<FileAnnotation> annotationList = new JList<>();
private final JScrollPane annotationScrollPane = new JScrollPane();
private final JLabel fileNameLabel = new JLabel(Localization.lang("Filename"),JLabel.CENTER);
private final JLabel fileNameLabel = new JLabel(Localization.lang("Filename"), JLabel.CENTER);
private final JComboBox<String> fileNameComboBox = new JComboBox<>();
private final JScrollPane fileNameScrollPane = new JScrollPane();
private final JLabel authorLabel = new JLabel(Localization.lang("Author"), JLabel.CENTER);
Expand Down Expand Up @@ -71,9 +74,8 @@ class FileAnnotationTab extends JPanel {
FileAnnotationTab(EntryEditor parent) {
this.parent = parent;
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
listModel = new DefaultListModel<>();
listModel = new DefaultListModel<>();
this.isInitialized = false;

}

public FileAnnotationTab initializeTab(FileAnnotationTab tab) {
Expand All @@ -99,7 +101,6 @@ public FileAnnotationTab initializeTab(FileAnnotationTab tab, Map<String, List<F
tab.isInitialized = true;
tab.parent.repaint();
return tab;

}

/**
Expand Down Expand Up @@ -130,32 +131,34 @@ private void addAnnotations() {

/**
* Updates the list model to show the given notes without those with no content
*
* @param annotations value is the annotation name and the value is a pdfAnnotation object to add to the list model
*/
private void updateShownAnnotations(List<FileAnnotation> annotations) {
listModel.clear();
if (annotations.isEmpty()) {
listModel.addElement(new FileAnnotation("", "", "", 0, Localization.lang("File has no attached annotations"), ""));
listModel.addElement(new FileAnnotation("", LocalDateTime.now(), 0, Localization.lang("File has no attached annotations"), "", Optional.empty()));
} else {
Comparator<FileAnnotation> byPage = Comparator.comparingInt(FileAnnotation::getPage);
annotations.stream()
.filter(annotation -> !(null == annotation.getContent()))
.filter(annotation -> (null != annotation.getContent()))
.filter(annotation -> annotation.getAnnotationType().equals(FDFAnnotationHighlight.SUBTYPE)
|| (null == annotation.getLinkedFileAnnotation()))
|| !annotation.hasLinkedAnnotation())
.sorted(byPage)
.forEach(listModel::addElement);
}
}

/**
* Updates the text fields showing meta data and the content from the selected annotation
*
* @param annotation pdf annotation which data should be shown in the text fields
*/
private void updateTextFields(FileAnnotation annotation) {
authorArea.setText(annotation.getAuthor());
dateArea.setText(annotation.getDate());
dateArea.setText(annotation.getTimeModified().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME));
pageArea.setText(String.valueOf(annotation.getPage()));
updateContentAndHighlightTextfields(annotation);
updateContentAndHighlightTextAreas(annotation);
}

/**
Expand All @@ -180,22 +183,22 @@ private void setUpGui() {
.columns("pref, $lcgap, pref:grow")
.rows("pref, $lg, fill:pref:grow, $lg, pref")
.padding(Paddings.DIALOG)
.add(fileNameLabel).xy(1,1, "left, top")
.add(fileNameLabel).xy(1, 1, "left, top")
.add(fileNameScrollPane).xyw(2, 1, 2)
.add(annotationScrollPane).xyw(1, 3, 3)
.build();
annotationScrollPane.setViewportView(annotationList);

JPanel informationPanel = FormBuilder.create()
JPanel informationPanel = FormBuilder.create()
.columns("pref, $lcgap, pref:grow")
.rows("pref, $lg, pref, $lg, pref, $lg, pref, $lg, pref:grow, $lg, pref:grow, $lg, fill:pref")
.padding(Paddings.DIALOG)
.add(authorLabel).xy(1,3, "left, top")
.add(authorScrollPane).xy(3,3)
.add(dateLabel).xy(1,5, "left, top")
.add(dateScrollPane).xy(3,5)
.add(pageLabel).xy(1,7, "left, top")
.add(pageScrollPane).xy(3,7)
.add(authorLabel).xy(1, 3, "left, top")
.add(authorScrollPane).xy(3, 3)
.add(dateLabel).xy(1, 5, "left, top")
.add(dateScrollPane).xy(3, 5)
.add(pageLabel).xy(1, 7, "left, top")
.add(pageScrollPane).xy(3, 7)
.add(annotationTextLabel).xy(1, 9, "left, top")
.add(annotationTextScrollPane).xywh(3, 9, 1, 2)
.add(highlightTxtLabel).xy(1, 11, "left, top")
Expand Down Expand Up @@ -237,7 +240,7 @@ private void setUpGui() {
.build());
}

private JPanel setUpButtons(){
private JPanel setUpButtons() {
JPanel buttonPanel = new JPanel(new GridBagLayout());
GridBagConstraints buttonConstraints = new GridBagConstraints();

Expand All @@ -262,7 +265,7 @@ private JPanel setUpButtons(){
/**
* Copies the meta and content information of the pdf annotation to the clipboard
*/
private void copyToClipboard(){
private void copyToClipboard() {
StringJoiner sj = new StringJoiner(System.getProperty("line.separator"));
sj.add("Author: " + authorArea.getText());
sj.add("Date: " + dateArea.getText());
Expand All @@ -286,22 +289,25 @@ private void reloadAnnotations() {
*
* @param annotation either a text annotation or a highlighting from a pdf
*/
private void updateContentAndHighlightTextfields(final FileAnnotation annotation) {
private void updateContentAndHighlightTextAreas(final FileAnnotation annotation) {

if (annotation.hasLinkedAnnotation()) {
String annotationText;
String highlightedText;
// isPresent() of the optional is already checked in annotation.hasLinkedAnnotation()
if (!annotation.getLinkedFileAnnotation().getContent().isEmpty()) {
contentTxtArea.setText(annotation.getLinkedFileAnnotation().getContent());
contentTxtArea.setEnabled(true);
} else {
contentTxtArea.setText("N/A");
contentTxtArea.setEnabled(false);
}

if (annotation.getAnnotationType().equals(FDFAnnotationHighlight.SUBTYPE)) {
highlightedText = annotation.getContent();
annotationText = annotation.getLinkedFileAnnotation().getContent();
if (annotation.getContent().isEmpty()) {
highlightTxtArea.setEnabled(false);
highlightTxtArea.setText("JabRef: The highlighted area does not contain any legible text!");
} else {
highlightedText = annotation.getLinkedFileAnnotation().getContent();
annotationText = annotation.getContent();
highlightTxtArea.setEnabled(true);
highlightTxtArea.setText(annotation.getContent());
}
highlightTxtArea.setEnabled(true);
contentTxtArea.setText(annotationText);
highlightTxtArea.setText(highlightedText);

} else {
contentTxtArea.setText(annotation.getContent());
Expand Down Expand Up @@ -345,7 +351,7 @@ public Component getListCellRendererComponent(JList<?> list, Object value, int i
FileAnnotation annotation = (FileAnnotation) value;

//call the super method so that the cell selection is done as usual
label = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);

//If more different annotation types should be reflected by icons in the list, add them here
switch (annotation.getAnnotationType()) {
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/org/jabref/gui/groups/GroupSelector.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@
import org.jabref.model.groups.event.GroupUpdatedEvent;
import org.jabref.model.metadata.MetaData;
import org.jabref.model.search.SearchMatcher;
import org.jabref.model.search.matchers.MatcherSet;
import org.jabref.model.search.matchers.MatcherSets;
import org.jabref.model.search.matchers.NotMatcher;
import org.jabref.preferences.JabRefPreferences;

import com.google.common.eventbus.Subscribe;
Expand Down Expand Up @@ -470,6 +467,7 @@ public void valueChanged(TreeSelectionEvent e) {
if (panel == null) {
return; // ignore this event (happens for example if the file was closed)
}
/*
if (getLeafsOfSelection().stream().allMatch(GroupTreeNodeViewModel::isAllEntriesGroup)) {
panel.getMainTable().getTableModel().updateGroupingState(MainTableDataModel.DisplayOption.DISABLED);
if (showOverlappingGroups.isSelected()) {
Expand All @@ -478,12 +476,13 @@ public void valueChanged(TreeSelectionEvent e) {
frame.output(Localization.lang("Displaying no groups") + ".");
return;
}

*/
updateShownEntriesAccordingToSelectedGroups();
}

private void updateShownEntriesAccordingToSelectedGroups() {
final MatcherSet searchRules = MatcherSets
updateShownEntriesAccordingToSelectedGroups(Globals.stateManager.activeGroupProperty().get());
/*final MatcherSet searchRules = MatcherSets
.build(andCb.isSelected() ? MatcherSets.MatcherType.AND : MatcherSets.MatcherType.OR);
for (GroupTreeNodeViewModel node : getLeafsOfSelection()) {
Expand All @@ -492,8 +491,9 @@ private void updateShownEntriesAccordingToSelectedGroups() {
}
SearchMatcher searchRule = invCb.isSelected() ? new NotMatcher(searchRules) : searchRules;
GroupingWorker worker = new GroupingWorker(searchRule);
worker.run();
worker.update();
worker.getWorker().run();
worker.getCallBack().update();
*/
}

private void updateShownEntriesAccordingToSelectedGroups(Optional<GroupTreeNode> selectedGroup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private void initialize() {
viewModel = new AboutDialogViewModel(dialogService, clipBoardManager, buildInfo);

SvgImageLoaderFactory.install();
Image icon = new Image(this.getClass().getResourceAsStream("/images/icons/JabRef-icon.svg"));
Image icon = new Image(this.getClass().getResourceAsStream("/icons/jabref.svg"));
iconImage.setImage(icon);
}

Expand Down
Loading

0 comments on commit 6b56eff

Please sign in to comment.