Skip to content

Instantly share code, notes, and snippets.

View keiono's full-sized avatar

Keiichiro Ono keiono

View GitHub Profile
@keiono
keiono / osgi.bnd
Created April 4, 2011 17:22
Sample setting file for bnd tool.
#-----------------------------------------------------------------
# Use this file to add customized Bnd instructions for the bundle
#-----------------------------------------------------------------
Import-Package: *
Export-Package: org.cytoscape.view.presentation, org.cytoscape.view.presentation.property, org.cytoscape.view.presentation.events
Private-Package: org.cytoscape.view.presentation.internal.*
@keiono
keiono / pom.xml
Created April 4, 2011 18:11
Sample pom for OSGi bundles
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${maven-bundle-plugin.version}</version>
<!-- | the following instructions build a simple set of public/private classes into an OSGi bundle -->
<configuration>
<instructions>
<Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<!-- | assume public classes are in the top package, and private classes are under ".internal" -->
@keiono
keiono / gist:1043609
Created June 23, 2011 20:57
Create Empty PDF on OSGi
final Rectangle pageSize = PageSize.LETTER;
final Document document = new Document(pageSize);
OutputStream os = new BufferedOutputStream(new FileOutputStream("itextTest2.pdf"));
final PdfWriter writer = PdfWriter.getInstance(document, os);
document.open();
final PdfContentByte canvas = writer.getDirectContent();
final float pageWidth = pageSize.getWidth();
final float pageHeight = pageSize.getHeight();
final DefaultFontMapper fontMapper = new DefaultFontMapper();
@keiono
keiono / Neo4jPerformanceTest.java
Created August 15, 2011 18:26
Very simple Neo4j + Blueprints test
package org.cytoscape.blueprints.implementations;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.util.Iterator;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@keiono
keiono / gist:1170110
Created August 25, 2011 06:38
Cytoscape semantic web plugin dependency
<!-- Blueprints graph implementation bundles -->
<!-- <dependency> <groupId>org.cytoscape.blueprints</groupId> <artifactId>blueprints-graph-cytoscape</artifactId>
<version>0.1.0</version> </dependency> -->
<dependency>
<groupId>org.cytoscape.wrappers</groupId>
<artifactId>tinkerpop-blueprints-core</artifactId>
<version>0.9</version>
</dependency>
<dependency>
<groupId>org.cytoscape.wrappers</groupId>
@keiono
keiono / VisualPropertyDependency.java
Created April 2, 2012 18:21
Visual Property Dependency New API Plan 1
/**
*
* Plan 1: Use existing VisualLexicon Tree as is.
*
* Set of Visual Properties which are dependent to each other
*
* All Visual Properties should have save data type T.
*
*/
public interface VisualPropertyDependency<T> {
@keiono
keiono / VisualLexicon2.java
Created April 2, 2012 20:17
Visual Property Dependency New API Plan 2
package org.cytoscape.view.model;
import java.util.Set;
public interface VisualLexicon2 {
/**
* Returns the Set of VisualPropertys supported by this Renderer.
*
* @return Set of all visual properties
importPackage( Packages.javax.swing );
JOptionPane.showMessageDialog(
null, "Hello Cytoscape!", "JavaScript on Cytoscape",
Packages.javax.swing.JOptionPane.INFORMATION_MESSAGE
);
@keiono
keiono / VisualStyleChangeRecord.java
Created August 2, 2012 00:32
VisualStyleChangedEvent
public final class VisualStyleChangeRecord<T> {
private final VisualProperty<T> vp;
private T defaultValue = null;
private VisualMappingFunction<?, T> mapping;
public VisualStyleChangeRecord(final VisualProperty<T> vp, final T defaultValue) {
this.defaultValue = defaultValue;
this.vp = vp;
public class VisualMappingFunctionChageDetails<T> {
private final Class<? extends VisualMappingFunction<?, T>> type;
public VisualMappingFunctionChageDetails(final Class<? extends VisualMappingFunction<?, T>> mappingType) {
this.type = mappingType;
}
public Class<? extends VisualMappingFunction<?, T>> getMappingType() {
return type;