Skip to content

Commit

Permalink
v.1.0.1 basic
Browse files Browse the repository at this point in the history
  • Loading branch information
enocholumide committed Oct 10, 2017
1 parent 0230d15 commit 9353883
Show file tree
Hide file tree
Showing 14 changed files with 464 additions and 54 deletions.
Binary file added Laserscan-to-dxf_v1.0.1_basic.jar
Binary file not shown.
4 changes: 4 additions & 0 deletions bin/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/tester/
/toolkit/
/core/
/res/
/resources/
/ACI_RGB.csv
Binary file modified bin/core/MemoryTextField.class
Binary file not shown.
Binary file modified bin/core/Point3D.class
Binary file not shown.
Binary file modified bin/core/RadioButton.class
Binary file not shown.
1 change: 1 addition & 0 deletions src/ACI_RGB.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0,0,0,00,0,79,1780,0,104,1760,0,129,1740,0,189,1720,0,255,50,0,255,1700,19,79,1680,25,104,1660,31,129,1640,39,79,1580,46,189,1620,52,104,1560,59,79,1480,63,255,1600,64,129,1540,78,104,1460,79,0,980,79,19,1080,79,39,1180,79,59,1280,79,79,1380,94,189,1520,96,129,1440,104,0,960,104,25,1060,104,52,1160,104,78,1260,104,104,1360,127,255,1500,129,0,940,129,31,1040,129,64,1140,129,96,1240,129,129,1340,141,189,1420,189,0,920,189,46,1020,189,94,1120,189,141,1220,189,189,1320,191,255,1400,255,0,30,255,0,900,255,63,1000,255,127,1100,255,191,1200,255,255,40,255,255,13019,0,79,18819,79,0,8825,0,104,18625,104,0,8631,0,129,18431,129,0,8439,0,79,19839,79,0,7846,0,189,18246,189,0,8251,51,51,25052,0,104,19652,104,0,7653,53,79,17953,59,79,16953,66,79,15953,73,79,14953,79,53,9953,79,59,10953,79,66,11953,79,73,12953,79,79,13959,0,79,20859,53,79,18959,79,0,6859,79,53,8963,0,255,18063,255,0,8064,0,129,19464,129,0,7465,65,65,866,53,79,19966,79,53,7969,69,104,17769,78,104,16769,86,104,15769,95,104,14769,104,69,9769,104,78,10769,104,86,11769,104,95,12769,104,104,13773,53,79,20973,79,53,6978,0,104,20678,69,104,18778,104,0,6678,104,69,8779,0,0,1879,0,19,24879,0,39,23879,0,59,22879,0,79,21879,19,0,2879,39,0,3879,53,53,1979,53,59,24979,53,66,23979,53,73,22979,59,0,4879,59,53,2979,66,53,3979,73,53,4979,79,0,5879,79,53,5980,80,80,25186,69,104,19786,86,129,17586,96,129,16586,104,69,7786,107,129,15586,118,129,14586,129,86,9586,129,96,10586,129,107,11586,129,118,12586,129,129,13594,0,189,19294,189,0,7295,69,104,20795,104,69,6796,0,129,20496,86,129,18596,129,0,6496,129,86,85104,0,0,16104,0,25,246104,0,52,236104,0,78,226104,0,104,216104,25,0,26104,52,0,36104,69,69,17104,69,78,247104,69,86,237104,69,95,227104,69,104,217104,78,0,46104,78,69,27104,86,69,37104,95,69,47104,104,0,56104,104,69,57105,105,105,252107,86,129,195107,129,86,75118,86,129,205118,129,86,65126,126,189,173126,141,189,163126,157,189,153126,173,189,143126,189,126,93126,189,141,103126,189,157,113126,189,173,123126,189,189,133127,0,255,190127,255,0,70128,128,128,9129,0,0,14129,0,31,244129,0,64,234129,0,96,224129,0,129,214129,31,0,24129,64,0,34129,86,86,15129,86,96,245129,86,107,235129,86,118,225129,86,129,215129,96,0,44129,96,86,25129,107,86,35129,118,86,45129,129,0,54129,129,86,55130,130,130,253141,0,189,202141,126,189,183141,189,0,62141,189,126,83157,126,189,193157,189,126,73170,170,255,171170,191,255,161170,212,255,151170,234,255,141170,255,170,91170,255,191,101170,255,212,111170,255,234,121170,255,255,131173,126,189,203173,189,126,63189,0,0,12189,0,46,242189,0,94,232189,0,141,222189,0,189,212189,46,0,22189,94,0,32189,126,126,13189,126,141,243189,126,157,233189,126,173,223189,126,189,213189,141,0,42189,141,126,23189,157,126,33189,173,126,43189,189,0,52189,189,126,53190,190,190,254191,0,255,200191,170,255,181191,255,0,60191,255,170,81212,170,255,191212,255,170,71234,170,255,201234,255,170,61255,0,0,1255,0,0,10255,0,63,240255,0,127,230255,0,191,220255,0,255,6255,0,255,210255,63,0,20255,127,0,30255,170,170,11255,170,191,241255,170,212,231255,170,234,221255,170,255,211255,191,0,40255,191,170,21255,212,170,31255,234,170,41255,255,0,2255,255,0,50255,255,170,51255,255,255,7255,255,255,255
Expand Down
1 change: 1 addition & 0 deletions src/ACI_RGB_v2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
76,0,0,18,127,0,0,16,153,0,0,14,204,0,0,12,255,0,0,10,76,19,0,28,127,31,0,26,153,38,0,24,204,51,0,22,255,63,0,20,76,38,0,38,127,63,0,36,153,76,0,34,204,102,0,32,255,127,0,30,76,57,0,48,127,95,0,46,153,114,0,44,204,153,0,42,255,191,0,40,76,76,0,58,127,127,0,56,153,153,0,54,204,204,0,52,255,255,0,50,57,76,0,68,95,127,0,66,114,153,0,64,153,204,0,62,191,255,0,60,38,76,0,78,63,127,0,76,76,153,0,74,102,204,0,72,127,255,0,70,19,76,0,88,31,127,0,86,38,153,0,84,51,204,0,82,63,255,0,80,0,76,0,98,0,127,0,96,0,153,0,94,0,204,0,92,0,255,0,90,0,76,19,108,0,127,31,106,0,153,38,104,0,204,51,102,0,255,63,100,0,76,38,118,0,127,63,116,0,153,76,114,0,204,102,112,0,255,127,110,0,76,57,128,0,127,95,126,0,153,114,124,0,204,153,122,0,255,191,120,0,76,76,138,0,127,127,136,0,153,153,134,0,204,204,132,0,255,255,130,0,57,76,148,0,95,127,146,0,114,153,144,0,153,204,142,0,191,255,140,0,38,76,158,0,63,127,156,0,76,153,154,0,102,204,152,0,127,255,150,0,19,76,168,0,31,127,166,0,38,153,164,0,51,204,162,0,63,255,160,0,0,76,178,0,0,127,176,0,0,153,174,0,0,204,172,0,0,255,170,19,0,76,188,31,0,127,186,38,0,153,184,51,0,204,182,63,0,255,180,38,0,76,198,63,0,127,196,76,0,153,194,102,0,204,192,127,0,255,190,57,0,76,208,95,0,127,206,114,0,153,204,153,0,204,202,191,0,255,200,76,0,76,218,127,0,127,216,153,0,153,214,204,0,204,212,255,0,255,210,76,0,57,228,127,0,95,226,153,0,114,224,204,0,153,222,255,0,191,220,76,0,38,238,127,0,63,236,153,0,76,234,204,0,102,232,255,0,127,230,76,0,19,248,127,0,31,246,153,0,38,244,204,0,51,242,255,0,63,240,255,127,127,11,204,102,102,13,153,76,76,15,127,63,63,17,76,38,38,19,255,159,127,21,204,127,102,23,153,95,76,25,127,79,63,27,76,47,38,29,255,191,127,31,204,153,102,33,153,114,76,35,127,95,63,37,76,57,38,39,255,223,127,41,204,178,102,43,153,133,76,45,127,111,63,47,76,66,38,49,255,255,127,51,204,204,102,53,153,153,76,55,127,127,63,57,76,76,38,59,223,255,127,61,178,204,102,63,133,153,76,65,111,127,63,67,66,76,38,69,191,255,127,71,153,204,102,73,114,153,76,75,95,127,63,77,57,76,38,79,159,255,127,81,127,204,102,83,95,153,76,85,79,127,63,87,47,76,38,89,127,255,127,91,102,204,102,93,76,153,76,95,63,127,63,97,38,76,38,99,127,255,159,101,102,204,127,103,76,153,95,105,63,127,79,107,38,76,47,109,127,255,191,111,102,204,153,113,76,153,114,115,63,127,95,117,38,76,57,119,127,255,223,121,102,204,178,123,76,153,133,125,63,127,111,127,38,76,66,129,127,255,255,131,102,204,204,133,76,153,153,135,63,127,127,137,38,76,76,139,127,223,255,141,102,178,204,143,76,133,153,145,63,111,127,147,38,66,76,149,127,191,255,151,102,153,204,153,76,114,153,155,63,95,127,157,38,57,76,159,127,159,255,161,102,127,204,163,76,95,153,165,63,79,127,167,38,76,76,169,127,127,255,171,102,102,204,173,76,76,153,175,63,63,127,177,38,38,76,179,159,127,255,181,127,102,204,183,95,76,153,185,79,63,127,187,47,38,76,189,191,127,255,191,153,102,204,193,114,76,153,195,95,63,127,197,57,38,76,199,223,127,255,201,178,102,204,203,133,76,153,205,111,63,127,207,66,38,76,209,255,127,255,211,204,102,204,213,153,76,153,215,127,63,127,217,76,38,76,219,255,127,223,221,204,102,178,223,153,76,133,225,127,63,111,227,76,38,66,229,255,127,191,231,204,102,153,233,153,76,114,235,127,63,95,237,76,38,57,239,255,127,159,241,204,102,127,243,153,76,95,245,127,63,79,247,76,38,47,249,255,0,0,1,255,255,0,2,0,255,0,3,0,255,255,4,0,0,255,5,255,0,255,6,255,255,255,7,128,128,128,8,192,192,192,9,51,51,51,250,91,91,91,251,132,132,132,252,173,173,173,253,214,214,214,254,255,255,255,255,
Expand Down
64 changes: 64 additions & 0 deletions src/core/ACIColor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/**
*
*/
package core;

import java.awt.Color;

/**
* @author OlumideEnoch
*
*/
public class ACIColor {

private Color RGB = new Color(0,0,0);
private int ACI = 255;
private int sum = 0;
/**
* @param rGB
* @param aCI
*/
public ACIColor(Color rGB, int aCI) {
super();
RGB = rGB;
ACI = aCI;
setSum();
}
/**
* @return the rGB
*/
public Color getRGB() {
return RGB;
}
/**
* @param rGB the rGB to set
*/
public void setRGB(Color rGB) {
RGB = rGB;
}
/**
* @return the aCI
*/
public int getACI() {
return ACI;
}
/**
* @param aCI the aCI to set
*/
public void setACI(int aCI) {
ACI = aCI;
}

private void setSum() {
this.sum = this.RGB.getRed() + this.RGB.getGreen() + this.RGB.getBlue();
}

public int getSum() {
return this.sum;
}

public void print() {
System.out.println(this.RGB.toString() + "ACI: " + getACI());
}

}
97 changes: 97 additions & 0 deletions src/core/ACIColorList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
package core;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import toolkit.Toolset;

public class ACIColorList {

private List<ACIColor> colorList = new ArrayList<ACIColor>();
private int[] redChannel, blueChannel, greenChannel;

/**
* @param colorList
*/
public ACIColorList(List<ACIColor> colorList) {
super();
this.colorList = colorList;
setChannels(this.colorList);
}

/**
* @return the colorList
*/
public List<ACIColor> getColorList() {
return colorList;
}

/**
* @param colorList the colorList to set
*/
public void setColorList(List<ACIColor> colorList) {
this.colorList = colorList;
}

public void sortByRedChannel() {
//Collections.sort(colorList);
}

/**
* @param redChannels the redChannels to set
*/
private void setChannels(List<ACIColor> colorList) {
int n = colorList.size();
redChannel = new int[n];
greenChannel = new int[n];
blueChannel = new int[n];
int i = 0;
for(ACIColor item : colorList) {
redChannel[i] = item.getRGB().getRed();
greenChannel[i] = item.getRGB().getGreen();
blueChannel[i] = item.getRGB().getBlue();
i++;
}
Arrays.sort(redChannel);
Arrays.sort(greenChannel);
Arrays.sort(blueChannel);
}

/**
* @return the redChannel
*/
public int[] getRedChannel() {
return redChannel;
}

/**
* @return the blueChannel
*/
public int[] getBlueChannel() {
return blueChannel;
}

/**
* @return the greenChannel
*/
public int[] getGreenChannel() {
return greenChannel;
}

public int getClosestToColorSum(int value) {

int sumList[] = new int[colorList.size()];

int i = 0;
for(ACIColor item : colorList) {
sumList[i] = item.getSum();
i++;
}

return Toolset.closestNumber(sumList, value);


}
}
22 changes: 22 additions & 0 deletions src/core/MemoryTextField.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,24 @@ public class MemoryTextField extends JTextField {
private List<String> memoryList = new ArrayList<String>();
private boolean isAlreadyCalculated = false;
private JCheckBox toggler = new JCheckBox();
private String originalText = "";

public MemoryTextField(String title, JCheckBox toggler) {
super.setText(title);
this.toggler = toggler;
}

public MemoryTextField(String text) {
super.setText(text);
setOriginalText(text);
}

public MemoryTextField() {
}

public void setOriginalText(String originalText) {
this.originalText = originalText;
}

/**
* @return the memoryList
Expand Down Expand Up @@ -78,5 +88,17 @@ public void addToList(String item) {
super.setText(item);
}

public String getOriginalText() {
return this.originalText;
}

public void setToOriginalText() {
super.setText(originalText);
}

public boolean isOriginalTextField() {
return super.getText().equals(this.originalText);
}


}
2 changes: 1 addition & 1 deletion src/core/Point3D.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class Point3D {

private double x,y,z;
private Color color;
private Color color = new Color(0,0,0);



Expand Down
8 changes: 8 additions & 0 deletions src/core/RadioButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ public class RadioButton extends JRadioButton {
*
*/
private static final long serialVersionUID = -3602197499836281853L;
private String delimeter = " ";

public RadioButton(String title, String actionCommand) {
super.setName(title);
super.setText(title);
super.setActionCommand(actionCommand);
}
/**
* @return the delimeter
*/
public String getDelimeter() {
return delimeter;
}

}
Loading

0 comments on commit 9353883

Please sign in to comment.