Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
frett27 committed Jan 7, 2024
1 parent 5d2f8a0 commit 14bb665
Show file tree
Hide file tree
Showing 27 changed files with 124 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import org.barrelorgandiscovery.scale.Scale;

/**
* book image reading implementation
* Book image reading abstract (or base) implementation.
* for more informations about the bookimage, see documentation
*
* @author pfreydiere
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
import org.barrelorgandiscovery.tools.ImageTools;

/**
* Book Image Creation Tools,
* Book Image Creation Tools,
*
* @author pfreydiere
*
*/
Expand All @@ -23,10 +24,13 @@ public class BookImageIO {
private static final Logger logger = Logger.getLogger(BookImageIO.class);

/**
* Create a book image
* Create a book image file, from a single in-memory image, the book image is
* suffixes with .bookimage, and il a zip file containing horizontally indexed
* images (to speed up the display, and limit the load)
*
* @param bufferedImage
* @param rotate
* @param bufferedImage the source image
* @param destinationBookImage output file to generate
* @param rotate is the source image is vertically or horizontally presented
* @throws Exception
*/
public static void createBookImage(BufferedImage bufferedImage, File destinationBookImage, boolean rotate,
Expand Down Expand Up @@ -71,7 +75,7 @@ public static void createBookImage(BufferedImage bufferedImage, File destination
AffineTransform t = AffineTransform.getTranslateInstance(-sx, -sy);

if (rotate) {

t.preConcatenate(AffineTransform.getRotateInstance(-Math.PI / 2));
t.preConcatenate(AffineTransform.getTranslateInstance(0, height));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

import java.awt.image.BufferedImage;

/**
* interface implemented by bookimage to get a specific image
*
* @author pfreydiere
*
*/
public interface IFamilyImageSeeker {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,51 @@
import java.util.LinkedList;
import java.util.Map;

public class LRUCache<K,V> {

public static class Data<K,V> {

/**
* LRU cache implementation
*
* @author pfreydiere
*
* @param <K>
* @param <V>
*/
public class LRUCache<K, V> {

public static class Data<K, V> {

K key;
V data;

public Data(K key, V value) {
this.key = key;
this.data = value;
}

V getValue() {
return data;
}
}



private int size;
private Map<K, Data<K,V>> cache;
private LinkedList<Data<K,V>> dataList;
private Map<K, Data<K, V>> cache;
private LinkedList<Data<K, V>> dataList;

public LRUCache(int size) {
super();
this.size = size;
this.cache = new HashMap<>();
this.dataList = new LinkedList<>();

}

public void clear() {
this.cache = new HashMap<>();
this.dataList = new LinkedList<>();
}

public V get(K key) {
if (cache.containsKey(key)) {
Data<K,V> data = cache.get(key);
Data<K, V> data = cache.get(key);
// Remove the data from its location
dataList.remove(data);
// Add it to the end of the list
Expand All @@ -49,18 +57,19 @@ public V get(K key) {
}
return null;
}

public void set(K key, V value) {
if (cache.containsKey(key)) {
Data<K,V> oldData = cache.get(key);
Data<K, V> oldData = cache.get(key);
// Remove old data from linkedlist
dataList.remove(oldData);
Data<K,V> newData = new Data<>(key, value);
Data<K, V> newData = new Data<>(key, value);
// Update the value
cache.put(key, newData);
// Add new data at the end of the linkedlist
dataList.add(newData);
} else {
Data<K,V> data = new Data<>(key, value);
Data<K, V> data = new Data<>(key, value);
if (cache.size() >= size) {
// Remove the oldest value from both map and linkedlist
cache.remove(dataList.pollFirst().key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.barrelorgandiscovery.tools.ImageTools;

/**
* this is a utility class for folder in wich the images are taken
* this is a utility class for folder in which the images are taken
*
* @author pfreydiere
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* contains some classes for working with bookimage
*/
package org.barrelorgandiscovery.bookimage;

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.barrelorgandiscovery.exec;

/**
* log object
* consol log interface, permit to log in specific console execution
*
* @author pfreydiere
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import java.util.Map;

/**
* interface for executing a model or script,
* this unify transforms done using a script or a model
* interface for executing a model or script,
* This is an abstraction for either executing script or a modeleditor
*
* @author pfreydiere
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* this package contains interface for user logic or script execution
*/
package org.barrelorgandiscovery.exec;
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.barrelorgandiscovery.gaerepositoryclient;

@Deprecated
public class RepositoryInstrument {

private String name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.barrelorgandiscovery.gaerepositoryclient;

@Deprecated
public interface SynchronizationFeedBack {

public void inform(String message, double progress);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.barrelorgandiscovery.gaerepositoryclient;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
Expand All @@ -10,8 +9,8 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Vector;
import java.util.Map.Entry;
import java.util.Vector;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
import org.barrelorgandiscovery.repository.Repository2;

/**
* Environnement UI permettant à une classe Step de créer son composant visuel
* de configuration, cet objet est passé en paramètre du panel pour la saisie de
* la configuration d'un step
* UI definition for a step class to create associated configuration panel.
*
* @author pfreydiere
*
*/
public class JConfigurePanelEnvironment {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* root package,
*
* @author pfreydiere
*/
package org.barrelorgandiscovery;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

import org.barrelorgandiscovery.scale.Scale;

/**
* only compare the number of tracks in the scale (and not all the tracks definitions, measures)
* @author pfreydiere
*
*/
public class TracksNumberComparator extends ScaleComparator {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
import org.barrelorgandiscovery.scale.eval.Note;

/**
* Comparateur de gamme
* Compare scales, given two scales, this object compare the characteristics and
* return a list of Diff objects.
*
*
* @author pfreydiere
*
Expand Down Expand Up @@ -66,6 +68,13 @@ private boolean compareControlProperties(int track, ControlTrackDef source, Cont
return r;
}

/**
* create differences (diffs), given two scales
* @param s1 scale 1
* @param s2 scale 2
* @return
* @throws Exception
*/
public List<AbstractDiffElement> diff(Scale s1, Scale s2) throws Exception {

assert s1 != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ public class TrackTypeMismatched extends TrackDiff {

public TrackTypeMismatched(int sourceTrack) {
super(sourceTrack);
}



}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* package containing difference operator for scales, this permit to have a
* human reading of differences between scales
*/
package org.barrelorgandiscovery.scale.diff;
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
package org.barrelorgandiscovery.scale.importer;

/**
* internal line parser
*
* @author pfreydiere
*
*/
public interface LineParser {

/**
* inform a line has been parsed
* @param cmd midiboek line
* @param params associated parameters
* @throws Exception
*/
public void lineParsed(String cmd, String[] params) throws Exception;

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

/**
* Parser of a midiboek file
* @author use
* @author pfreydiere
*
*/
public class MidiBoekFileParser {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.barrelorgandiscovery.scale.Scale;

/**
* Classe permettant l'import de gamme issues de midiboek
* import midiboek files
*
* @author Freydiere Patrice
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<html>
<head></head>
<body>
Scale IO ...
Scale Input Ouput methodes, to read, write scale definitions
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/**
* VFS2 provider for using networked files
*/
package org.barrelorgandiscovery.vfs2;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Http Fork for having folder reading content, from http stream containing
* CONTENT file inside with the children list
* CONTENT file inside with the children list.
*/
package org.barrelorgandiscovery.vfs2.provider;
Loading

0 comments on commit 14bb665

Please sign in to comment.