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 is just a code fragment | |
Use JNA : https://github.com/twall/jna#readme to get handle# of Java frame | |
Use 'JaWin to extract java stubs from Google Earth | |
http://jawinproject.sourceforge.net/ | |
GE Java Stubs: | |
IApplicationGE.java // main entry point to GE | |
User32.dll: | |
Windows USER component that creates and manipulates the standard elements of the Windows user interface. |
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
private static Map sortByComparator(Map singleCutTable) { | |
List list = new LinkedList(singleCutTable.entrySet()); | |
// sort list based on comparator | |
Collections.sort(list, new Comparator() { | |
public int compare(Object o1, Object o2) { | |
Map.Entry obj1Entry = (Map.Entry) o1.getValue(); | |
Map.Entry obj2Entry = (Map.Entry) o2.getValue(); | |
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
/* | |
* Copyright (C) 2013 tckb < Chandra [dot] Tungathurthi [at] rwth-aachen.de > | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
/* | |
* Copyright (C) 2013 tckb < Chandra [dot] Tungathurthi [at] rwth-aachen.de > | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
/* | |
* Licensed to the Apache Software Foundation (ASF) under one or more | |
* contributor license agreements. See the NOTICE file distributed with | |
* this work for additional information regarding copyright ownership. | |
* The ASF licenses this file to You under the Apache License, Version 2.0 | |
* (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
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
package cam.uk.ebi.sg.ui; | |
import cam.uk.ebi.sg.main.ImageRenderer; | |
import cam.uk.ebi.sg.main.OSRA; | |
import java.io.File; | |
import java.util.concurrent.Callable; | |
import javax.swing.ImageIcon; | |
/** | |
* |
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
File tokkaloImageFile = Utility.UI.saveFile(frame); | |
Image img = icon.getImage(); | |
BufferedImage bi = new BufferedImage(img.getWidth(null),img.getHeight(null),BufferedImage.TYPE_BYTE_ARGB); | |
Graphics2D g2 = bi.createGraphics(); | |
g2.drawImage(img, 0, 0, null); | |
g2.dispose(); | |
ImageIO.write(bi, "jpg",tokkaloImageFile); |
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
import java.io.File; | |
import com.tckb.util.*; | |
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
/** |
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
// Code part of tckb-lib | |
// Author: tckb <[email protected]> | |
// https://github.com/tckb/jAudIO.pub | |
public static void saveObjectToFile(File thatFile, Object... thisObject) { | |
mylogger.log(Level.INFO, "Saving object{0} to file: {1}", new Object[]{thisObject.hashCode(), thatFile.getAbsolutePath()}); | |
ObjectOutputStream stream; | |
try { | |
stream = new ObjectOutputStream(new FileOutputStream(thatFile)); |
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
public static int getRadius(int[][] distMatrix){ | |
int radius = Integer.MAX_VALUE; | |
//biggest value in evry column of the matrix = ece | |
// radius = minium eccentricity of a molecule | |
for(int r=0;r<distMatrix.length;r++){ | |
int maxDist=0; | |
for(int c=0;r<distMatrix.length;r++){ | |
if(distMatrix[r][c] > maxDist ){ | |
maxDist = distMatrix[r][c]; | |
OlderNewer