blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
07683df8704bed265b700036aba5fba56fb09bd7 | a883db19ee29052e05c78d0437e23d445ca71594 | /ChitChater/ChitChater.java | d61d56f617fc3f1d67369bdee07310a42e97476a | [] | no_license | drachenblutn3/Homework | f7f1d6bcbae16d0dd315cff811c1a82903982798 | 1f5bd296a683ae223e3201416eb2709c42c78e3a | refs/heads/master | 2021-08-16T06:01:41.985434 | 2021-01-27T19:46:13 | 2021-01-27T19:46:13 | 82,684,934 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 644 | java | /**
* Java 2. Homework 4. Chat GUI.
*
* @author Nikolay Gritskevich
* @versin dated 03.04.2017
*/
//import javax.awt.*;
//import javax.awt.event.*;
import javax.swing.*;
public class ChitChater extends JFrame {
public ChitChater() {
//super("Окно"); ???
// setSize(500, 300);
// setDefaultCloseOperation(EXIT_ON_CLOSE);
// add(pnl);
// setVisible(true);
super("My First Window");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(400, 100, 840, 680);
setVisible ( true );
}
public static void main(String[] args) {
new ChitChater();
}
} | [
"komu116@gmail.com"
] | komu116@gmail.com |
294002e0a169166d11c31c6cbdb098dbca7f69e6 | 6e82416b0ef08e45d077005c7aa8ddaffa422ec0 | /avaj/Aircrafts/JetPlane.java | cd6850d19049e85113eefcd6393f6769839af941 | [] | no_license | AnaChepurna/avaj_launcher | c57d525de8d7cc7c5ff4c30ac3a088f170f33cbe | df907cf0931b2148f65eb351bbeb656e8f37bc5a | refs/heads/master | 2020-04-01T05:59:21.231262 | 2018-11-05T14:15:04 | 2018-11-05T14:15:04 | 152,928,650 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,778 | java | package avaj.Aircrafts;
import avaj.WeatherTower;
/**
* Created by achepurn on 13.10.2018.
*/
public class JetPlane extends Aircraft implements Flyable{
private WeatherTower weatherTower;
JetPlane(String name, Coordinates coordinates) {
super(name, coordinates);
}
@Override
public void updateConditions() {
if (!weatherTower.isRegistered(this))
return;
String weather = weatherTower.getWeather(this.coordinates);
switch (weather) {
case "RAIN" :
coordinates.increasesLatitude(5);
weatherTower.logMessage(this.say() + "It's raining. Better watch out for lightings.");
break;
case "SUN" :
coordinates.increasesLatitude(10);
coordinates.increasesHeight(2);
weatherTower.logMessage(this.say() + "Maximum speed!");
break;
case "FOG" :
coordinates.increasesLatitude(1);
weatherTower.logMessage(this.say() + "So dangerous to fly in fog!");
break;
case "SNOW" :
coordinates.increasesHeight(-7);
weatherTower.logMessage(this.say() + "OMG! Winter is coming!");
break;
}
if (coordinates.getHeight() == 0)
landing();
}
@Override
public void registerTower(WeatherTower weatherTower) {
weatherTower.register(this);
this.weatherTower = weatherTower;
}
@Override
public void landing() {
weatherTower.logMessage(this + " landing on " + coordinates.getLongtitude() + " longtitude, " +
coordinates.getLatitude() + " latitude.");
weatherTower.unregister(this);
}
}
| [
"achepurn@e2r4p11.unit.ua"
] | achepurn@e2r4p11.unit.ua |
f37f0890b49a5be8e6f5d210e2c18cdbfb66638c | 1aadffbe56edccccfa20f58fc7ee18fdf0dfb99a | /3.JavaMultithreading/src/com/javarush/task/task29/task2909/human/Student.java | fdd7cb3b35605e22a40eb847598b647d1fcab1c5 | [] | no_license | zakhariya/JavaRushTasks | 9b42a4d9aae8b7731fc3cfa8d4f47af5a832ee5b | 81699f3bfe40c5e1450196624310563fb461cd1f | refs/heads/master | 2022-02-19T07:10:18.004552 | 2022-02-06T10:51:03 | 2022-02-06T10:51:03 | 203,832,076 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,220 | java | package com.javarush.task.task29.task2909.human;
import java.util.Date;
public class Student extends UniversityPerson {
private double averageGrade;
private Date beginningOfSession;
private Date endOfSession;
private int course;
public Student(String name, int age, double averageGrade) {
super(name, age);
this.averageGrade = averageGrade;
}
@Override
public void live() {
learn();
}
public void learn() {
}
@Override
public String getPosition() {
return "Студент";
}
public void incAverageGrade(double delta) {
setAverageGrade(getAverageGrade() + delta);
}
public double getAverageGrade() {
return averageGrade;
}
public void setAverageGrade(double averageGrade) {
this.averageGrade = averageGrade;
}
public int getCourse() {
return course;
}
public void setCourse(int course) {
this.course = course;
}
public void setBeginningOfSession(Date beginningOfSession) {
this.beginningOfSession = beginningOfSession;
}
public void setEndOfSession(Date endOfSession) {
this.endOfSession = endOfSession;
}
} | [
"alexander.zakhariya@gmail.com"
] | alexander.zakhariya@gmail.com |
6229c348f51d4804da826f13428ac888d2ace453 | 138bcba6fe2d1f8186269fd9fd6b374ea91a4c59 | /base-ui/src/main/java/com/yh/baseui/view/YHPriceView.java | 515e05cf260e4fbcdc23afc62fbbdf12a4378800 | [] | no_license | YHyunshang/android | 92c7d3c5a549424a24741d5a7a0c480b223f3fa3 | f56cebe957882fef67bbc2426dbd6a99ede9f76c | refs/heads/master | 2023-05-23T06:29:39.153672 | 2021-06-09T12:53:36 | 2021-06-09T12:53:36 | 375,544,191 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 720 | java | package com.yh.baseui.view;
import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import androidx.appcompat.widget.AppCompatTextView;
public class YHPriceView extends AppCompatTextView {
public YHPriceView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public YHPriceView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public YHPriceView(Context context) {
super(context);
}
@Override
public void setTypeface(Typeface tf, int style) {
super.setTypeface(Typeface.createFromAsset(getContext().getAssets(), "fonts/YHYCXinHT-Regular.ttf"));
}
}
| [
"zhangzy3@yonghui.cn"
] | zhangzy3@yonghui.cn |
d51574fed9924e7b921f5331dd1d77b258252dd4 | 1c7e3fbdd75b4cdf9f32a47bbcf281a97765d180 | /src/main/java/net/malisis/doors/tileentity/SaloonDoorTileEntity.java | df954d2924cf46476c2e412c6c2177a7ebd196fc | [] | no_license | TartaricAcid/MalisisDoors | c826207edd97354fdb4906a27af6089de9f31d80 | 0ed782ec179c60edc182a2b842acaa41b71238b1 | refs/heads/1.8.9 | 2021-01-20T22:59:04.918639 | 2016-10-22T04:51:39 | 2016-10-22T04:51:39 | 68,113,120 | 0 | 0 | null | 2016-09-13T13:53:32 | 2016-09-13T13:53:31 | null | UTF-8 | Java | false | false | 2,328 | java | /*
* The MIT License (MIT)
*
* Copyright (c) 2014 Ordinastie
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package net.malisis.doors.tileentity;
import net.minecraft.entity.Entity;
/**
* @author Ordinastie
*
*/
public class SaloonDoorTileEntity extends DoorTileEntity
{
private boolean openBackward = false;
public boolean isBackward()
{
return openBackward;
}
public void setBackward(boolean backward)
{
this.openBackward = backward;
}
public void setOpenDirection(Entity entity)
{
double entityPos = 0;;
float tePos = 0;
switch (getDirection())
{
case NORTH:
entityPos = entity.posZ;
tePos = pos.getZ() + 0.5F;
break;
case SOUTH:
entityPos = -entity.posZ;
tePos = -pos.getZ() - 0.5F;
break;
case EAST:
entityPos = -entity.posX;
tePos = -pos.getX() - 0.5F;
break;
case WEST:
entityPos = entity.posX;
tePos = pos.getX() + 0.5F;
default:
break;
}
openBackward = entityPos < tePos;
// MalisisCore.message(getDirection() + " = B ? " + openBackward + " (" + entityPos + " > " + (tePos) + ")");
}
@Override
public DoorTileEntity getDoubleDoor()
{
SaloonDoorTileEntity te = (SaloonDoorTileEntity) super.getDoubleDoor();
if (te != null)
te.setBackward(openBackward);
return te;
}
}
| [
"ordinastie@hotmail.com"
] | ordinastie@hotmail.com |
b55a39b440aa6e34a3035d3db5b99ffce4b22f18 | 65b789230fce83529ab0d6a55b41ad8a4d77eac4 | /src/main/java/screen/AT2MDMUS0010/AT2MDMUS0010Sis.java | cbcbecaa23834faa00c75d41e4b9be5d85789107 | [] | no_license | a24otorandell/ProjectAutotest | 251731182971e38172e5b989635a566689e0ef72 | e5de9a21c2ada5f0a7ca5c138da78b505c4b58a6 | refs/heads/main | 2021-01-21T14:58:02.976802 | 2017-01-12T09:53:16 | 2017-01-12T09:53:16 | 59,011,549 | 1 | 3 | null | 2016-05-30T10:25:21 | 2016-05-17T10:04:13 | Java | UTF-8 | Java | false | false | 8,153 | java | package screen.AT2MDMUS0010;
import core.CommonActions.CommonProcedures;
import core.CommonActions.DataGenerator;
import core.CommonActions.Functions;
import core.TestDriver.TestDriver;
import core.recursiveData.recursiveXPaths;
/**
* Created by aibanez on 09/11/2016.
*/
public class AT2MDMUS0010Sis {
protected AT2MDMUS0010Locators locators;
protected AT2MDMUS0010Data data;
public AT2MDMUS0010Sis() {
}
public AT2MDMUS0010Locators getLocators() {
return locators;
}
public void setLocators(AT2MDMUS0010Locators locators) {
this.locators = locators;
}
public AT2MDMUS0010Data getData() {
return data;
}
public void setData(AT2MDMUS0010Data data) {
this.data = data;
}
public void start(TestDriver driver) {
setScreenInfo(driver);
CommonProcedures.goToScreen(driver);
}
protected void setScreenInfo(TestDriver driver) {
driver.getTestdetails().setMainmenu("Master Data Management");
driver.getTestdetails().setSubmenu("System");
driver.getTestdetails().setScreen("Password change");
}
protected String getElements(String key) {
return String.valueOf(this.locators.getElements().get(key));
}
protected String getData(String key) {
return String.valueOf(this.data.getData().get(key));
}
protected boolean testCSED(TestDriver driver) {
if (!first_search(driver)) return false;
if (!getDatos(driver)) return false;
if (!search(driver)) return false;
if (!cambiarPass(driver)) return false;
if (!qbe(driver)) return false;
if (!others_actions(driver)) return false;
return true;
}
private boolean first_search(TestDriver driver) {
driver.getReport().addHeader("SEARCH RECORD", 3, false);
String where = " on FIRST SEARCH";
if (!Functions.clickSearchAndResult(driver,
new String[]{"search_b_search", getElements("search_b_search")}, //search button
new String[]{"passwords_e_result", getElements("passwords_e_result")}, //result element
300,800,
where)) {
return false;
}
return true;
}
private boolean search(TestDriver driver) {
driver.getReport().addHeader("SEARCH RECORD", 3, false);
String where = " on SEARCH";
Functions.break_time(driver, 80, 400);
if (!Functions.createLovByValue(driver,
new String[]{"search_lov_user", getElements("search_lov_user")}, //LoV button
new String[]{"search_i_user", getElements("search_i_user")}, //external LoV input
new String[]{"search_lov_user_code", recursiveXPaths.lov_i_altgenericinput}, //internal LoV input
getData("name") + " " + getData("surname1"), // value to search
"user", //name of the data
where)){return false;}
Functions.break_time(driver, 30, 400);
if (!Functions.clickSearchAndResult(driver,
new String[]{"search_b_search", getElements("search_b_search")}, //search button
new String[]{"passwords_e_result", getElements("passwords_e_result")}, //result element
where)) {
return false;
}
return true;
}
public boolean getDatos (TestDriver driver) {
driver.getReport().addHeader("SEARCH RECORD", 3, false);
String where = " on GET DATOS";
Functions.break_time(driver, 3, 400);
if(!Functions.getText(driver,new String[]{"table_e_user", getElements("table_e_user")}, // element path
"user", // key for data value (the name)
where)){return false;}
if(!Functions.getText(driver,new String[]{"table_e_name", getElements("table_e_name")}, // element path
"name", // key for data value (the name)
where)){return false;}
if(!Functions.getText(driver,new String[]{"table_e_surname1", getElements("table_e_surname1")}, // element path
"surname1", // key for data value (the name)
where)){return false;}
if(!Functions.getText(driver,new String[]{"table_e_surname2", getElements("table_e_surname2")}, // element path
"surname2", // key for data value (the name)
where)){return false;}
return true;
}
public boolean cambiarPass (TestDriver driver) {
driver.getReport().addHeader("SEARCH RECORD", 3, false);
String where = " on CAMBIAR PASS";
Functions.break_time(driver, 3, 400);
if(!Functions.checkClick(driver,
new String[]{"passwords_b_actions", getElements("passwords_b_actions")}, //element to click
new String[]{"passwords_b_actions_b_change", getElements("passwords_b_actions_b_change")}, //element expected to appear
where)){return false;}
if(!Functions.checkClick(driver,
new String[]{"passwords_b_actions_b_change", getElements("passwords_b_actions_b_change")}, //element to click
new String[]{"change_b_ok", getElements("change_b_ok")}, //element expected to appear
where)){return false;}
if (!Functions.insertInput(driver, new String[]{"change_i_new_pass",getElements("change_i_new_pass")},
"pass", DataGenerator.getRandomAlphanumericSequence(5,false), where)){return false;}
if (!Functions.insertInput(driver, new String[]{"change_i_confirm",getElements("change_i_confirm")},
"new", getData("pass"), where)){return false;}
if (!Functions.simpleClick(driver,
new String[]{"change_b_ok", getElements("change_b_ok")}, //element to click
where)){return false;}
Functions.break_time(driver, 30, 400);
return true;
}
private boolean qbe(TestDriver driver) {
driver.getReport().addHeader("QBE RECORD", 3, false);
String where = " on QBE";
Functions.break_time(driver, 10, 700);
if (!Functions.clickSearchAndResult(driver,
new String[]{"search_b_reset", getElements("search_b_reset")}, //search button
new String[]{"passwords_e_result", getElements("passwords_e_result")}, //result element
where)) {
return false;
}
if (!Functions.clickQbE(driver,
new String[]{"passwords_b_qbe", getElements("passwords_b_qbe")},// query button
new String[]{"qbe_i_user", getElements("qbe_i_user")},//any query input
where)) {
return false;
} // where the operation occurs
if (!Functions.insertInput(driver, new String[]{"qbe_i_user",getElements("qbe_i_user")},
"user", "%"+getData("user"), where)){return false;}
if (!Functions.insertInput(driver, new String[]{"qbe_i_name",getElements("qbe_i_name")},
"name", getData("name"), where)){return false;}
if (!Functions.insertInput(driver, new String[]{"qbe_i_surname1",getElements("qbe_i_surname1")},
"surname1", getData("surname1"), where)){return false;}
if (!Functions.insertInput(driver, new String[]{"qbe_i_surname2",getElements("qbe_i_surname2")},
"surname2", getData("surname2"), where)){return false;}
if (!Functions.enterQueryAndClickResult(driver,
new String[]{"qbe_i_user", getElements("qbe_i_user")}, //any query input
new String[]{"passwords_e_result", getElements("passwords_e_result")}, //table result
where)){return false;}
return true;
}
private boolean others_actions(TestDriver driver) {
driver.getReport().addHeader("OTHER DETACH", 3, false);
String where = " on OTHER DETACH";
if (!Functions.detachTable(driver,
new String[]{"passwords_b_detach", getElements("passwords_b_detach")}, //detach button
true, //screenshot??
where)) {
return false;
}
return true;
}
}
| [
"sandra23"
] | sandra23 |
1585093b38c39c7cf22688d38d68b9a2c4951d30 | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /IntroClassJava/dataset/median/93f87bf20be12abd3b52e14015efb6d78b6038d2022e0ab5889979f9c6b6c8c757d6b5a59feae9f8415158057992ae837da76609dc156ea76b5cca7a43a4678b/015/mutations/191/median_93f87bf2_015.java | 37709b870533cdea5f4b82b612778be91e28ab6d | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,321 | java | package introclassJava;
class IntObj {
public int value;
public IntObj () {
} public IntObj (int i) {
value = i;
}
}
class FloatObj {
public float value;
public FloatObj () {
} public FloatObj (float i) {
value = i;
}
}
class LongObj {
public long value;
public LongObj () {
} public LongObj (long i) {
value = i;
}
}
class DoubleObj {
public double value;
public DoubleObj () {
} public DoubleObj (double i) {
value = i;
}
}
class CharObj {
public char value;
public CharObj () {
} public CharObj (char i) {
value = i;
}
}
public class median_93f87bf2_015 {
public java.util.Scanner scanner;
public String output = "";
public static void main (String[]args) throws Exception {
median_93f87bf2_015 mainClass = new median_93f87bf2_015 ();
String output;
if (args.length > 0) {
mainClass.scanner = new java.util.Scanner (args[0]);
} else {
mainClass.scanner = new java.util.Scanner (System.in);
}
mainClass.exec ();
System.out.println (mainClass.output);
}
public void exec () throws Exception {
IntObj int1 = new IntObj (), int2 = new IntObj (), int3 = new IntObj ();
output +=
(String.format ("Please enter 3 numbers separated by spaces > "));
int1.value = scanner.nextInt ();
int2.value = scanner.nextInt ();
int3.value = scanner.nextInt ();
if (((int1.value <= int2.value) && ((int2.value) <= (int3.value)) && ((int2.value) >= (int1.value)))
|| ((int1.value <= int2.value) && (int1.value >= int3.value))) {
output += (String.format ("%d is the median \n", int1.value));
} else if ((((int2.value <= int1.value)) && (int2.value >= int3.value))
|| ((int2.value <= int3.value) && (int2.value >= int1.value))) {
output += (String.format ("%d is the median \n", int2.value));
} else if (((int3.value <= int1.value) && (int3.value >= int2.value))
|| ((int3.value <= int2.value) && (int3.value >= int1.value))) {
output += (String.format ("%d is the median \n", int3.value));
}
if (true)
return;;
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
3aa946db72ab8b718f821f9146d7f61f8359f6a9 | eb5f5353f49ee558e497e5caded1f60f32f536b5 | /javax/swing/tree/TreeNode.java | 7320a4d59cbdb50c747e71c4d7051f3415a90d40 | [] | no_license | mohitrajvardhan17/java1.8.0_151 | 6fc53e15354d88b53bd248c260c954807d612118 | 6eeab0c0fd20be34db653f4778f8828068c50c92 | refs/heads/master | 2020-03-18T09:44:14.769133 | 2018-05-23T14:28:24 | 2018-05-23T14:28:24 | 134,578,186 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 611 | java | package javax.swing.tree;
import java.util.Enumeration;
public abstract interface TreeNode
{
public abstract TreeNode getChildAt(int paramInt);
public abstract int getChildCount();
public abstract TreeNode getParent();
public abstract int getIndex(TreeNode paramTreeNode);
public abstract boolean getAllowsChildren();
public abstract boolean isLeaf();
public abstract Enumeration children();
}
/* Location: C:\Program Files (x86)\Java\jre1.8.0_151\lib\rt.jar!\javax\swing\tree\TreeNode.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 0.7.1
*/ | [
"mohit.rajvardhan@ericsson.com"
] | mohit.rajvardhan@ericsson.com |
5f91fb3acd51f22036415af0fec456e4ae331c88 | 2b8beabbf7802f263356827c0e0dc1543619fda1 | /Example_3/Food2.java | a1582806af641baa54130de6a7976239f8eeb798 | [] | no_license | luxus0/JDBC_CRUD_API_H2_MYSQL | 66709a241c0292cb9269c5de422a36ef7fc150cf | 17e167647cda3d91f09e8dd00bb2690a2d238733 | refs/heads/master | 2020-08-29T19:59:04.392853 | 2019-10-28T22:31:45 | 2019-10-28T22:31:45 | 218,157,162 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,158 | java | package lukasz.nowogorski.SpringBoot.DATABASE_JDBC_CRUD_2;
public class Food2 {
private long id;
private String name;
private String color;
private int wages;
private String country;
private String quality;
private String quantity;
private int price;
public Food2()
{
}
public Food2(long id,String name,String color, int wages, String country, String quality, String quantity, int price) {
this.id = id;
this.name = name;
this.color = color;
this.wages = wages;
this.country = country;
this.quality = quality;
this.quantity = quantity;
this.price = price;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public int getWages() {
return wages;
}
public void setWages(int wages) {
this.wages = wages;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getQuality() {
return quality;
}
public void setQuality(String quality) {
this.quality = quality;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
}
| [
"noreply@github.com"
] | luxus0.noreply@github.com |
f0f62d41664e95d1e3a15385f60554b2a9029377 | 585f48d28be377f3ed6435b56b3ca2b893243271 | /src/mlsp/cs/cmu/edu/graph/NodeFactory.java | c487f9b9fe25d514b99c47338d7b71415637e551 | [] | no_license | nikwolfe7/speech-recognition | 1e31c8163fb8b3eb735d31858a8e6397e575d8db | 21b81374460b505df252fcb7aa8143db09d8eeb4 | refs/heads/master | 2021-01-19T20:27:42.252728 | 2015-05-17T20:02:03 | 2015-05-17T20:02:03 | 30,329,125 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 112 | java | package mlsp.cs.cmu.edu.graph;
public interface NodeFactory<N> {
public Node<N> getNewNode(N value);
}
| [
"nikwolfe7@gmail.com"
] | nikwolfe7@gmail.com |
7ce5039a3853d51f1e0bf66e88fbc895d1877871 | c5523b74291b86854cc48e71c9ce25d328fa8409 | /src/multithreading/CompleteableFutureDemo.java | 1039c6e4420a78a6828f33ab2bd0ac5f1c7de8c8 | [] | no_license | amrit24/Practice | 2b2c837ca4c66fa0aa6baf35b1f18ab81ba11539 | c72d0909fff2463360e28858d1f22212eaba0c25 | refs/heads/main | 2023-08-11T02:18:27.613757 | 2021-10-10T07:07:48 | 2021-10-10T07:07:48 | 415,511,960 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 150 | java | package multithreading;
public class CompleteableFutureDemo {
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
| [
"amrit.shrivastava24@gmail.com"
] | amrit.shrivastava24@gmail.com |
3fef5b0ad344e62f6c1c6f6a96d31f8cc3e2cf9b | 0b6b3e34e7cc119fda6f134a053795d9376acb88 | /Activeeon/Botsing/v1.0.7/catalog/exceptions/bucketNameIsNotValidException/frame55/org/eclipse/jetty/util/thread/QueuedThreadPool_ESTest_scaffolding.java | f020a95fd8b0b4dcea5c3c68954e0ecc72467dc1 | [] | no_license | chan0415/botsing-usecases-output | 1b8b401cf7612beab1768448a4cebd4f32f13b80 | 594bfcea990c5da39de6f7f00b34f79cfa7f2b5f | refs/heads/master | 2023-04-14T04:26:40.618041 | 2020-02-03T14:08:46 | 2020-02-03T14:08:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 555 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Wed Oct 16 14:53:19 CEST 2019
*/
package org.eclipse.jetty.util.thread;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class QueuedThreadPool$3_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"mael.audren@activeeon.com"
] | mael.audren@activeeon.com |
fa92a97804ef13a8340684d2d35e3e9f455fd2d2 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/test/java/org/gradle/test/performancenull_41/Testnull_4021.java | 9ff96b84bacc1409e3fdd8d586e85209cd7226ee | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 304 | java | package org.gradle.test.performancenull_41;
import static org.junit.Assert.*;
public class Testnull_4021 {
private final Productionnull_4021 production = new Productionnull_4021("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
953abb01716963815c0c930d056d422a3b4f2679 | 4d9846e38f19dbeea8aff3746018eceec4f16506 | /app/src/main/java/com/ruizvilla/frontino_para_explorar/Lista_Entrada.java | 636415ff1685942e7b41feff9b80ad2b62627714 | [] | no_license | SamuelHassel/OzesnosApp | 31b171f4719c4e3c8fe84bd527909e3491035e3a | 771d28ed79f4b7e19f4bafd9dfd9243452d5b1ee | refs/heads/master | 2020-12-30T14:34:20.839187 | 2017-05-16T11:09:05 | 2017-05-16T11:09:05 | 91,068,919 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,927 | java | package com.ruizvilla.frontino_para_explorar;
/**
* Created by Usuario on 05/04/2017.
*/
/**E) Se crea esta clase para que gestione mas tipos de datos a vincular con el el Item_list, se definen entonces privadamente los tipos de atributo
* como por buena practica son privados para poder acceder estos datos dede Lista_activity.java se hara a través de los metodos getter y setter
* estos metodos se generan automaticamente con click derecho generar getter und setter, setter obtiene, setter configura el valor
*/
public class Lista_Entrada {
private int idImagen; // Porque los ID son enteros
private String nombre, descrip, direct;
// Contrustucores que asignen valores
//F) se crea constructor por cliock derecho generar poara variables seleccionadas, el constructor es la utlilizacion o creacion
// del objeto de la clase Lista_Entrada la cual solo estaba abstraida pero no se habia hecho objeto
public Lista_Entrada(int idImagen, String nombre, String descrip, String direct) {
this.idImagen = idImagen;
this.nombre = nombre;
this.descrip = descrip;
this.direct = direct;
}
// Por ser una clase, entonces al estar privados necesitamos unsar gettres y setter
//se generaron automaticamente por click derecho generate
public int getIdImagen() {
return idImagen;
}
public void setIdImagen(int idImagen) {
this.idImagen = idImagen;
}
// getter y setter para los String...
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getDescrip() {
return descrip;
}
public void setDescrip(String descrip) {
this.descrip = descrip;
}
public String getDirect() {
return direct;
}
public void setDirect(String direct) {
this.direct = direct;
}
}
| [
"samuel.ruiz@udea.edu.co"
] | samuel.ruiz@udea.edu.co |
c1ef8a877cf348bfc32e4b018babe53a8773e548 | e67b8ebd1905a96837486acf6b3fe03d35ea452b | /src/main/java/com/ksource/liangfa/web/workflow/TaskController.java | 6784cf6d32216b47f5d89fca4830aef4e4195183 | [] | no_license | sulongfei001/ksource-liangfa-web | 75ddbd974cd6557098508a1003850adbd85eb0b4 | 227251a9a1a70aabeeceac67c5c1865cc4257e24 | refs/heads/master | 2020-04-16T22:50:23.528334 | 2019-01-16T06:26:07 | 2019-01-16T06:27:11 | 165,986,351 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 38,809 | java | package com.ksource.liangfa.web.workflow;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.activiti.engine.HistoryService;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.TaskService;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.task.Task;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.ksource.common.bean.PaginationHelper;
import com.ksource.common.bean.ServiceResponse;
import com.ksource.common.util.JsTreeUtils;
import com.ksource.exception.BusinessException;
import com.ksource.liangfa.dao.SystemDAO;
import com.ksource.liangfa.domain.CaseBasic;
import com.ksource.liangfa.domain.CaseFenpai;
import com.ksource.liangfa.domain.CaseFilter;
import com.ksource.liangfa.domain.CaseFilterExample;
import com.ksource.liangfa.domain.CaseStep;
import com.ksource.liangfa.domain.CaseStepExample;
import com.ksource.liangfa.domain.CaseTodo;
import com.ksource.liangfa.domain.CaseTodoExample;
import com.ksource.liangfa.domain.CaseYisongJiwei;
import com.ksource.liangfa.domain.Dictionary;
import com.ksource.liangfa.domain.DictionaryExample;
import com.ksource.liangfa.domain.District;
import com.ksource.liangfa.domain.Organise;
import com.ksource.liangfa.domain.OrganiseExample;
import com.ksource.liangfa.domain.ProcDeploy;
import com.ksource.liangfa.domain.TaskAction;
import com.ksource.liangfa.domain.TaskBind;
import com.ksource.liangfa.domain.TaskBindKey;
import com.ksource.liangfa.domain.User;
import com.ksource.liangfa.domain.UserExample;
import com.ksource.liangfa.mapper.CaseBasicMapper;
import com.ksource.liangfa.mapper.CaseFenpaiMapper;
import com.ksource.liangfa.mapper.CaseFilterMapper;
import com.ksource.liangfa.mapper.CaseStepMapper;
import com.ksource.liangfa.mapper.CaseTodoMapper;
import com.ksource.liangfa.mapper.DictionaryMapper;
import com.ksource.liangfa.mapper.OrganiseMapper;
import com.ksource.liangfa.mapper.ProcDeployMapper;
import com.ksource.liangfa.mapper.TaskActionMapper;
import com.ksource.liangfa.mapper.TaskBindMapper;
import com.ksource.liangfa.mapper.UserMapper;
import com.ksource.liangfa.service.MybatisAutoMapperService;
import com.ksource.liangfa.service.casehandle.CaseService;
import com.ksource.liangfa.service.casehandle.CaseTodoService;
import com.ksource.liangfa.service.system.DistrictService;
import com.ksource.liangfa.service.system.OrgService;
import com.ksource.liangfa.service.system.UserService;
import com.ksource.liangfa.service.workflow.CaseYisongjiweiService;
import com.ksource.liangfa.service.workflow.WorkflowService;
import com.ksource.liangfa.workflow.ActivitiUtil;
import com.ksource.liangfa.workflow.ProcessFactory;
import com.ksource.liangfa.workflow.task.TaskVO;
import com.ksource.syscontext.Const;
import com.ksource.syscontext.SpringContext;
import com.ksource.syscontext.SystemContext;
/**
* 任务管理 controller 主要是获取待办任务 已办任务等
*
* @author junxy
*/
@Controller
@RequestMapping("/workflow/task")
public class TaskController {
private static final Logger logger = LoggerFactory.getLogger(TaskController.class);
//待办任务列表页面
private static final String TODO_LIST = "/workflow/todoTaskList";
//已办任务页面
private static final String COMPLETED_LIST = "/workflow/completedTaskList";
private static final String CASEYISONG_LIST = "/workflow/caseYisongList";
//移送其他页面
private static final String CASEYISONGQITA_VIEW = "/casehandle/caseTodo/caseTodoYisongQitaView";
@Autowired
TaskService taskService;
@Autowired
MybatisAutoMapperService mybatisAutoMapperService;
@Autowired
CaseService caseService;
@Autowired
RepositoryService repositoryService;
@Autowired
private WorkflowService workflowService;
@Autowired
private TaskActionMapper taskActionMapper;
@Autowired
private TaskBindMapper taskBindMapper;
@Autowired
private UserService userService;
@Autowired
private CaseStepMapper caseStepMapper;
@Autowired
private OrganiseMapper organiseMapper;
@Autowired
private HistoryService historyService;
@Autowired
private SystemDAO systemDAO;
@Autowired
private DistrictService districtService;
@Autowired
private OrgService orgService;
@Autowired
private CaseBasicMapper caseBasicMapper;
@Autowired
private CaseTodoService caseTodoService;
@Autowired
private CaseYisongjiweiService caseYisongjiweiService;
@Autowired
private UserMapper userMapper;
@Autowired
private CaseTodoMapper caseTodoMapper;
@Autowired
private DictionaryMapper dictionaryMapper;
@Autowired
private ProcDeployMapper procDeployMapper;
@Autowired
private CaseFenpaiMapper caseFenpaiMapper;
/**
* 获取登录用户的待办任务,应该包含直接分配给该登录用户及用户所在组的任务 集合
*
* @param model
* @return
*/
@RequestMapping(value = "/todo")
public String toDoTaskList(HttpServletRequest request,Integer optType,Integer isIllegal ,Map<String, Object> model, String page) {
User user = SystemContext.getCurrentUser(request);
CaseFilter caseFilter=new CaseFilter();
Map<String,Object> paramMap = new HashMap<String, Object>();
//根据登录用户组织机构查询案件筛选表信息,并作为参数筛选待办案件
CaseFilterExample example=new CaseFilterExample();
Integer orgCode=SystemContext.getCurrentUser(request).getOrgId();
example.createCriteria().andOrgCodeEqualTo(orgCode);
List<CaseFilter> list=mybatisAutoMapperService.selectByExample(CaseFilterMapper.class, example, CaseFilter.class);
int count=list.size();
if(count>=1){
caseFilter=list.get(0);
}
if(caseFilter!=null){
if(caseFilter.getMinAmountInvolved()!=null){
paramMap.put("minAmountInvolved", caseFilter.getMinAmountInvolved());
}
if(caseFilter.getMaxAmountInvolved()!=null){
paramMap.put("maxAmountInvolved", caseFilter.getMaxAmountInvolved());
}
if(caseFilter.getMinCaseInputTime()!=null){
paramMap.put("minCaseInputTime", caseFilter.getMinCaseInputTime());
}
if(caseFilter.getMaxCaseInputTime()!=null){
paramMap.put("maxCaseInputTime", caseFilter.getMaxCaseInputTime());
}
if(caseFilter.getIsDiscussCase()!=null){
paramMap.put("isDiscussCase", caseFilter.getIsDiscussCase());
}
if(caseFilter.getIsSeriousCase()!=null){
paramMap.put("isSeriousCase", caseFilter.getIsSeriousCase());
}
if(caseFilter.getIsBeyondEighty()!=null){
paramMap.put("isBeyondEighty", caseFilter.getIsBeyondEighty());
}
if(caseFilter.getChufaTimes()!=null){
paramMap.put("chufaTimes", caseFilter.getChufaTimes());
}
if(caseFilter.getIsLowerLimitMoney()!=null){
paramMap.put("isLowerLimitMoney", caseFilter.getIsLowerLimitMoney());
}
if(caseFilter.getIsIdentify()!=null){
paramMap.put("isIdentify", caseFilter.getIsIdentify());
}
//此参数表示是首页待办 还是案件管理的待办案件查询,这两个查询条件不一致,首页待办查询条件用or过滤,待办案件查询条件用and过滤
//1:首页待办 2:待办案件查询
paramMap.put("type", 1);
}
PaginationHelper<TaskVO> tasks =null;
if(isIllegal!=null && isIllegal==1){
tasks = workflowService.queryIllegalToDoTasks(user, 0, page,null);
}else{
tasks = workflowService.queryToDoTasks(user, 0, page,paramMap);
}
model.put("tasks", tasks);
model.put("page", page);
model.put("optType", optType);
return TODO_LIST;
}
/**
* 获取登录用户的已办任务列表
*
* @param request
* @param model
* @return
*/
@RequestMapping(value = "/completed")
public ModelAndView completedTasks(CaseBasic caseBasic, String page, HttpServletRequest request, Map<String, Object> model) {
ModelAndView mv = new ModelAndView(COMPLETED_LIST);
User user = SystemContext.getCurrentUser(request);
Organise organise = user.getOrganise();
caseBasic.setOrgId(user.getOrgId());
PaginationHelper<CaseBasic> caseList = caseService.queryCompletedCaseList(caseBasic, page);
//循环查询案件的办理步骤
/* if(caseList!=null && caseList.getList().size()>0){
for(CaseBasic temp:caseList.getList()){
List<CaseStep> caseStepList=workflowService.queryStepInfoAndProcDiagramByCaseId(temp.getCaseId(), temp.getProcKey());
temp.setCaseStepList(caseStepList);
}
}*/
mv.addObject("caseList", caseList);
mv.addObject("page", page);
return mv;
}
/**
* 任务办理
*
* @param taskId 任务id
* @param actionId 任务提交动作id
* @param assignTarget 任务提交目标(下一步任务分配目标)
* @param request
* @return
*/
@RequestMapping(value = "/taskDeal", method = RequestMethod.POST)
@SuppressWarnings("unchecked")
public String taskDeal(@RequestParam(required = true) String taskId,
@RequestParam(required = true) Integer actionId, Integer optType,String assignTarget,String inputerId,
HttpServletRequest request) {
User user = SystemContext.getCurrentUser(request);
Organise organise = user.getOrganise();
Object policeVariable = taskService.getVariable(taskId, ActivitiUtil.VAR_ORG_CODE_GA);
//查询下一步办理单位,只查询同一个区划下的单位
if(StringUtils.isBlank(assignTarget)){
TaskBindKey targetTaskBindKey = new TaskBindKey();
TaskAction taskAction = taskActionMapper.selectByPrimaryKey(actionId);
targetTaskBindKey.setProcDefId(taskAction.getProcDefId());
if(StringUtils.isNotBlank(taskAction.getTargetTaskDefId())){//下一步任务节点为空:流程结束、并行分支
targetTaskBindKey.setTaskDefId(taskAction.getTargetTaskDefId());
TaskBind targetTaskBind = taskBindMapper.selectByPrimaryKey(targetTaskBindKey);
String targetOrgType = targetTaskBind.getAssignTarget();
User inputUser = userService.find(inputerId);
Organise inputOrg = orgService.selectByPrimaryKey(inputUser.getOrgId());
//特殊节点的处理(检察移送到行政)
if(targetOrgType.equals(Const.ORG_TYPE_XINGZHENG)
|| targetOrgType.equals(Const.TASK_ASSGIN_EQUALS_INPUTER)
|| targetOrgType.equals(Const.TASK_ASSGIN_IS_INPUTER)){
//获取的是部门的id,如两法办的id
assignTarget = inputUser.getDeptId().toString();
//改为获取组织机构的id
/*assignTarget = inputUser.getOrgId().toString();*/
//TODO 公安-->公安
}else if(Const.ORG_TYPE_GOGNAN.equals(organise.getOrgType()) && targetOrgType.equals(organise.getOrgType())){
assignTarget = user.getDeptId().toString();
//如果一个区划下存在多个公安,设置办理人为上一次公安办理案件时的公安部门
}else if(Const.ORG_TYPE_GOGNAN.equals(targetOrgType)){
if(policeVariable != null){
assignTarget = policeVariable.toString();
}
}else{
//TODO 查询同级别区划下已设置的部门 更改为案件录入单位同区划部门,林业部门区级单位存在市级办案单位
if(StringUtils.isNotBlank(inputOrg.getAcceptDistrictCode())){
//查询是否森林公安参与办案,如果参与则市检察院审批逮捕
if(policeVariable != null){
String lastPoliceCode = policeVariable.toString();
Organise lastPolice = organiseMapper.selectByPrimaryKey(Integer.valueOf(lastPoliceCode));
if(Const.POLICE_TYPE_2 == lastPolice.getPoliceType()){
String districtCode =organiseMapper.findOrgByUserId(inputerId).getDistrictCode();
//区林业的案件提请逮捕时需要市检察院审批
if(taskAction!= null && taskAction.getActionType() != null && Const.TASK_ACTION_TYPE_TIQINGDAIBU == taskAction.getActionType().intValue()){
District district = districtService.selectByPrimaryKey(districtCode);
if(district != null && StringUtils.isNotBlank(district.getUpDistrictCode())){
List<Organise> targetOrgList= organiseMapper.findDistrictHasTaskAssignSettingOrg(taskAction.getProcDefId(), taskAction.getTargetTaskDefId(),district.getUpDistrictCode());
if(targetOrgList.size() > 0){
assignTarget = targetOrgList.get(0).getOrgCode().toString();
}
}
}else{
List<Organise> targetOrgList= organiseMapper.findDistrictHasTaskAssignSettingOrg(taskAction.getProcDefId(), taskAction.getTargetTaskDefId(),districtCode);
if(targetOrgList.size() > 0){
assignTarget = targetOrgList.get(0).getOrgCode().toString();
}
}
}else{
String districtCode =organiseMapper.findOrgByUserId(user.getUserId()).getDistrictCode();
List<Organise> targetOrgList= organiseMapper.findDistrictHasTaskAssignSettingOrg(taskAction.getProcDefId(), taskAction.getTargetTaskDefId(),districtCode);
if(targetOrgList.size() > 0){
assignTarget = targetOrgList.get(0).getOrgCode().toString();
}
}
}
}else{
String districtCode =organiseMapper.findOrgByUserId(user.getUserId()).getDistrictCode();
List<Organise> targetOrgList= organiseMapper.findDistrictHasTaskAssignSettingOrg(taskAction.getProcDefId(), taskAction.getTargetTaskDefId(),districtCode);
if(targetOrgList.size() > 0){
assignTarget = targetOrgList.get(0).getOrgCode().toString();
}
}
}
}
}else{
taskService.setVariable(taskId, ActivitiUtil.VAR_ORG_CODE_GA, assignTarget);
}
//保存请求参数数据
Map<String, String[]> parameterMap = (Map<String, String[]>) request.getParameterMap();
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
//保存上传文件信息
Map<String, MultipartFile> multipartFileMap = multipartRequest.getFileMap();
ServiceResponse response = workflowService.taskDeal(user.getUserId(), taskId, actionId, assignTarget, parameterMap, multipartFileMap);
if (!response.getResult()) {
throw new BusinessException(response.getMsg());
}
//根据optType判断首页待办案件办理和待查案件办理完毕后的跳转页面,1:跳转到首页待办,2:首页疑似犯罪待办,3:待查案件待办,4:疑似犯罪案件待办,5:立案监督线索案件待办,6:补充调查页面办理7:立案监督案件待办
if(optType!=null && optType==6){
return "redirect:/casehandle/caseTodo/ buChongDiaoChaList";
}else if(optType!=null && optType==7){
return "redirect:/casehandle/caseTodo/lianSupTodoList";
}else {
return "redirect:/casehandle/caseTodo/list";
}
}
/**
* to任务办理
*
* @param taskId 任务实例id
* @param caseId 案件id
* @return
*/
@RequestMapping(value = "/toTaskDeal")
public ModelAndView toTaskDeal(String taskId, String caseId,String optType) {
//任务实例信息
Task taskInfo = taskService.createTaskQuery().taskId(taskId).singleResult();
ProcessDefinition definition = repositoryService.createProcessDefinitionQuery().processDefinitionId(taskInfo.getProcessDefinitionId()).singleResult();
String procKey = definition.getKey();
ModelAndView view = ProcessFactory.createTaskDealView(procKey, taskInfo, caseId);
//加载案件上一步步骤信息
/* CaseStepMapper caseStepMapper = SpringContext.getApplicationContext().getBean(CaseStepMapper.class);
CaseStepExample caseStepExample = new CaseStepExample();
CaseStepExample.Criteria cri = caseStepExample.createCriteria();
cri.andProcInstIdEqualTo(taskInfo.getProcessInstanceId());
if (ActivitiUtil.isGateWayTask(taskInfo.getProcessDefinitionId(), taskInfo.getTaskDefinitionKey())) { //并发网关判断,如果是并发网关则targetTaskDefId为空,需要通过特别api来得到上一个任务结点
String taskDefId = ActivitiUtil.getPreTaskDefId(taskInfo);
cri.andTaskDefIdEqualTo(taskDefId);
} else {
cri.andTargetTaskDefIdEqualTo(taskInfo.getTaskDefinitionKey());
}*/
CaseStep caseStep = caseStepMapper.getLastCaseStep(caseId);
view.addObject("caseStepId", caseStep.getStepId());
//optType参数表示待办案件的入口,为办理完毕后跳转的页面提供依据(从哪办理,还跳转到哪),6补充调查
view.addObject("optType", optType);
return view;
}
/**
* 获取任务提交目标(岗位)列表
*
* @param orgType 机构类型
* @return
*/
@RequestMapping(value = "/getAssignTargetList")
@ResponseBody
public List<Organise> getAssignTargetList(String orgType, HttpServletRequest request) {
//获取同行政区划下、该类型机构
User user = SystemContext.getCurrentUser(request);
Organise organise = mybatisAutoMapperService.selectByPrimaryKey(OrganiseMapper.class, user.getOrgId(), Organise.class);
String districtCode = organise.getDistrictCode();
OrganiseExample organiseExample = new OrganiseExample();
organiseExample.createCriteria().andDistrictCodeEqualTo(districtCode).andOrgTypeEqualTo(orgType);
List<Organise> organises = mybatisAutoMapperService.selectByExample(OrganiseMapper.class, organiseExample, Organise.class);
return organises;
}
/**
* 任务分派
* @param request
* @param taskId 当前的任务id
* @param orgCode 下级单位的org_code(不是两法办)
* @param caseId 分派后,在case_basic中,案件的;录入人变为了下级单位的用户
* @return
*/
@RequestMapping(value = "taskFenpai")
@ResponseBody
public ServiceResponse taskFenpai(HttpServletRequest request,String taskId, String orgCode,
String caseId ) {
ServiceResponse response = new ServiceResponse(true, "");
User currentUser = SystemContext.getCurrentUser(request);
Date currentDate = new Date();
if(!"".equals(taskId) && taskId != null){
UserExample userExample = new UserExample();
//机构下边有用户,两法办下边没有,所以这里用机构org_code
userExample.createCriteria().andOrgIdEqualTo(Integer.parseInt(orgCode));
List<User> userList = userMapper.selectByExample(userExample);
User fenpaiUser = userList.get(0);
if(userList.size()>0){
taskService.setAssignee(taskId, fenpaiUser.getUserId());
OrganiseExample organiseExample = new OrganiseExample();
organiseExample.createCriteria().andUpOrgCodeEqualTo(Integer.parseInt(orgCode));
Integer orgCode2 = organiseMapper.selectByExample(organiseExample).get(0).getOrgCode();
//公安分派后,该变量存的就是下级的公安机构id(两法办)
taskService.setVariable(taskId, ActivitiUtil.VAR_ORG_CODE_GA, orgCode2);
//将caseTodo中删除本级机构待办,添加分派机构待办
CaseTodoExample oldCaseTodoExample = new CaseTodoExample();
oldCaseTodoExample.createCriteria().andCaseIdEqualTo(caseId);
CaseTodo oldCaseTodo = caseTodoMapper.selectByExample(oldCaseTodoExample).get(0);
caseTodoMapper.deleteByExample(oldCaseTodoExample);
//添加分派机构待办信息
CaseTodo newCaseTodo = new CaseTodo();
newCaseTodo.setTodoId(systemDAO.getSeqNextVal(Const.TABLE_CASE_TODO));
//当前登录用户为创建人
newCaseTodo.setCreateUser(currentUser.getUserId());
newCaseTodo.setCreateTime(new Date());
//当前登录用户机构为创建机构
newCaseTodo.setCreateOrg(currentUser.getOrgId());
newCaseTodo.setAssignUser(null);
newCaseTodo.setAssignOrg(Integer.parseInt(orgCode));
newCaseTodo.setCaseId(caseId);
newCaseTodo.setProcInstId(oldCaseTodo.getProcInstId());
newCaseTodo.setProcDefId(oldCaseTodo.getProcDefId());
newCaseTodo.setTaskActionId(oldCaseTodo.getTaskActionId());
newCaseTodo.setTaskActionName(oldCaseTodo.getTaskActionName());
caseTodoMapper.insert(newCaseTodo);
//在案件分派表中插入记录
CaseFenpai caseFenpai = new CaseFenpai();
caseFenpai.setCaseId(caseId);
caseFenpai.setFenpaiOrg(currentUser.getOrgId());
caseFenpai.setJieshouOrg(Integer.parseInt(orgCode));
caseFenpai.setFenpaiTime(currentDate);
caseFenpaiMapper.insert(caseFenpai);
//更新casebaisc案件状态为已分派,等待受理(28)
CaseBasic caseBasic = new CaseBasic();
caseBasic.setIsAssign(Const.IS_ASSIGN_YES);
caseBasic.setCaseId(caseId);
caseBasic.setCaseState(Const.CHUFA_PROC_28);
//公安局分派的案件inputer不变
//caseBasic.setAssignOrg(orgCode);
caseBasicMapper.updateByPrimaryKeySelective(caseBasic);
CaseBasic newCaseBasic = caseBasicMapper.selectByPrimaryKey(caseId);
//设置案件步骤,在常量类中设置
CaseStep caseStep = new CaseStep();
caseStep.setStepId(Long.valueOf(systemDAO.getSeqNextVal(Const.TABLE_CASE_STEP)));
caseStep.setStepName(getCaseState(Const.CHUFA_PROC_28));
caseStep.setCaseId(caseId);
caseStep.setCaseState(newCaseBasic.getCaseState());
caseStep.setStartDate(currentDate);
caseStep.setEndDate(currentDate);
caseStep.setAssignPerson(currentUser.getUserId());//这一步骤的办理人
//目标办理机构id,这里是分派后的下级单位orgCode
caseStep.setTargetOrgId(Integer.parseInt(orgCode));
caseStep.setTaskActionName(getCaseState(Const.CHUFA_PROC_28));
ProcDeploy procDeploy = procDeployMapper.getMaxVersionProc();
caseStep.setProcDefKey(Const.CASE_CHUFA_PROC_KEY);
caseStep.setProcDefId(procDeploy.getProcDefId());
caseStep.setTaskType(Const.TASK_TYPE_FENPAI);
caseStep.setFormDefId(Const.FORM_DEF_NEW_CASE);
caseStep.setActionType(Const.TASK_ACTION_TYPE_NORMAL);
caseStepMapper.insert(caseStep);
}else{
response.setingError("该机构下没有用户");
}
}else{
caseTodoService.taskFenpai(request,orgCode, caseId);
}
return response;
}
//查询字典表步骤名称
private String getCaseState(String dtCode){
String caseState = "";
DictionaryExample dicExample = new DictionaryExample();
dicExample.createCriteria().andDtCodeEqualTo(dtCode)
.andGroupCodeEqualTo("chufaProcState");
List<Dictionary> dicList = dictionaryMapper.selectByExample(dicExample);
if(dicList.size()>0){
caseState = dicList.get(0).getDtName();
}
return caseState;
}
//检察院移送纪委案件
@RequestMapping(value="caseYisong")
public ModelAndView caseYisong(CaseYisongJiwei caseYisongJiwei, String caseId,HttpServletRequest request,MultipartHttpServletRequest attachmentFile
) throws Exception{
ModelAndView mv = new ModelAndView(CASEYISONGQITA_VIEW);
User user = SystemContext.getCurrentUser(request);
Integer orgCode = user.getOrgId();
String userId = user.getUserId();
/*List<Organise> caseJiweiList = orgService.getAcceptUserIdByOrgCode(orgCode);
for(Organise organise:caseJiweiList){
caseYisongJiwei.setAcceptUserId(organise.getOrgCode());
}*/
caseYisongJiwei.setYisongPerson(userId);
Date currentDate = new Date();
caseYisongJiwei.setYisongTime(currentDate);
caseYisongJiwei.setYisongOrg(orgCode);
caseYisongJiwei.setCaseId(caseId);
int existCaseNum = caseYisongjiweiService.getExistCase(caseYisongJiwei.getCaseId());
if(existCaseNum == 0){
ServiceResponse res = caseYisongjiweiService.addYisongjieweiCase(caseYisongJiwei,attachmentFile);
mv.addObject("info", res.getResult());
}else {
mv.addObject("yiyisong","此案件已被移送");
}
return mv;
}
//跳转至移送其他页面
@RequestMapping(value="toCaseYisongView")
public ModelAndView toCaseYisongView(HttpServletRequest request,String caseId){
ModelAndView mv=new ModelAndView(CASEYISONGQITA_VIEW);
mv.addObject("caseId", caseId);
return mv;
}
//获得任务分派所用的机构、用户树
@RequestMapping(value = "getUserTree")
public void getFenPaiUserTree(HttpServletRequest request, ModelMap model,
Integer id, Integer isDept, String taskId, HttpServletResponse response) {
User user = SystemContext.getCurrentUser(request);
Organise currentOrganise = user.getOrganise();
response.setContentType("application/json");
PrintWriter out = null;
String trees=null;
if(currentOrganise!=null){
//使用task可以过滤机构部门和岗位,不过暂时先不过滤
if (id == null && isDept == null) {// 查询机构部门
OrganiseExample organiseExample = new OrganiseExample();
organiseExample.createCriteria().andUpOrgCodeEqualTo(currentOrganise.getOrgCode()).andIsDeptEqualTo(Const.STATE_INVALID);
List<Organise> orgs = new ArrayList<Organise>();
currentOrganise.setIsLeaf(Const.LEAF_NO);
orgs.add(currentOrganise);
trees = JsTreeUtils.orgJsonztree(orgs, true, true);
} else if (isDept == 0) {
OrganiseExample organiseExample = new OrganiseExample();
organiseExample.createCriteria().andUpOrgCodeEqualTo(id).andIsDeptEqualTo(Const.STATE_VALID);
List<Organise> orgs = mybatisAutoMapperService.selectByExample(OrganiseMapper.class, organiseExample, Organise.class);
for (Organise organise : orgs) {
organise.setIsLeaf(Const.LEAF_NO);
}
//TODO 首页待办分派树,用传来的orgcode和当前的orgCode比较,如果相等查询以当前orgCode为根结点的机构
if (id.equals(currentOrganise.getOrgCode())) {
OrganiseExample organiseExample2 = new OrganiseExample();
organiseExample2.createCriteria().andUpOrgCodeEqualTo(currentOrganise.getOrgCode()).andIsDeptEqualTo(Const.STATE_INVALID);
for (Organise organise : mybatisAutoMapperService.selectByExample(OrganiseMapper.class, organiseExample2, Organise.class)) {
orgs.add(organise);
}
for (Organise organise : orgs) {
organise.setIsLeaf(Const.LEAF_NO);
}
}
trees = JsTreeUtils.orgJsonztree(orgs, true, true);
} else {// 查询用户
List<User> userList = new ArrayList<User>();
UserExample userExample = new UserExample();
userExample.createCriteria().andDeptIdEqualTo(id).andAccountNotEqualTo(Const.SYSTEM_ADMIN_ID).
andUserTypeNotEqualTo(Const.USER_TYPE_ADMIN);
userList = mybatisAutoMapperService.selectByExample(UserMapper.class, userExample, User.class);
trees = JsTreeUtils.taskFenpaiUserJsonztree(userList);
}
}
try {
out = response.getWriter();
out.print(trees);
out.flush();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (out != null) {
out.close();
}
}
}
//获得移送所用的机构、用户树
@RequestMapping(value = "getYingsongTree")
public void getYingsongTree(HttpServletRequest request, ModelMap model,
Integer id, Integer isDept, String taskId, HttpServletResponse response) {
User user = SystemContext.getCurrentUser(request);
Organise currentOrganises = user.getOrganise();
Organise currentOrganise = orgService.getYisongOrg(currentOrganises);
response.setContentType("application/json");
PrintWriter out = null;
String trees=null;
if(currentOrganise!=null){
if (id == null && isDept == null) {// 查询机构部门
OrganiseExample organiseExample = new OrganiseExample();
organiseExample.createCriteria().andUpOrgCodeEqualTo(currentOrganise.getOrgCode()).andIsDeptEqualTo(Const.STATE_INVALID);
List<Organise> orgs = new ArrayList<Organise>();
currentOrganise.setIsLeaf(Const.LEAF_NO);
orgs.add(currentOrganise);
trees = JsTreeUtils.orgJsonztree(orgs, true, true);
} else if (isDept == 0) {
OrganiseExample organiseExample = new OrganiseExample();
organiseExample.createCriteria().andUpOrgCodeEqualTo(id).andIsDeptEqualTo(Const.STATE_VALID);
List<Organise> orgs = mybatisAutoMapperService.selectByExample(OrganiseMapper.class, organiseExample, Organise.class);
for (Organise organise : orgs) {
organise.setIsLeaf(Const.LEAF_NO);
}
//TODO 首页待办分派树,用传来的orgcode和当前的orgCode比较,如果相等查询以当前orgCode为根结点的机构
if (id.equals(currentOrganise.getOrgCode())) {
OrganiseExample organiseExample2 = new OrganiseExample();
organiseExample2.createCriteria().andUpOrgCodeEqualTo(currentOrganise.getOrgCode()).andIsDeptEqualTo(Const.STATE_INVALID);
for (Organise organise : mybatisAutoMapperService.selectByExample(OrganiseMapper.class, organiseExample2, Organise.class)) {
orgs.add(organise);
}
for (Organise organise : orgs) {
organise.setIsLeaf(Const.LEAF_NO);
}
}
trees = JsTreeUtils.orgJsonztree(orgs, true, true);
} else {// 查询用户
List<User> userList = new ArrayList<User>();
UserExample userExample = new UserExample();
userExample.createCriteria().andDeptIdEqualTo(id).andAccountNotEqualTo(Const.SYSTEM_ADMIN_ID).
andUserTypeNotEqualTo(Const.USER_TYPE_ADMIN);
userList = mybatisAutoMapperService.selectByExample(UserMapper.class, userExample, User.class);
trees = JsTreeUtils.taskFenpaiUserJsonztree(userList);
}
}
try {
out = response.getWriter();
out.print(trees);
out.flush();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (out != null) {
out.close();
}
}
}
/**
* 查询检察院移送纪委案件
* @param request
* @param caseYisongJiwei
* @param page
* @return
*/
@RequestMapping(value="caseYisongExamine")
public String caseYisongExamine(HttpServletRequest request,ModelMap modelMap,
CaseYisongJiwei caseYisongJiwei, String page) {
User user = SystemContext.getCurrentUser(request);
Integer orgCode = user.getOrgId();
caseYisongJiwei.setAcceptUserId(orgCode);
PaginationHelper<CaseYisongJiwei> caseYisongList = caseYisongjiweiService.find(caseYisongJiwei, page);
modelMap.addAttribute("caseYisongList", caseYisongList);
modelMap.addAttribute("page",page);
return CASEYISONG_LIST;
}
//任务回退
@RequestMapping(value = "rollBack")
@ResponseBody
public ServiceResponse rollBack(String caseId,HttpServletRequest request) {
User user = SystemContext.getCurrentUser(request);
return workflowService.rollBack(caseId,user);
}
//没有启动流程的任务回退(包含移送公安步骤回退)
@RequestMapping(value = "noProcRollBack")
@ResponseBody
public ServiceResponse noProcRollBack(String caseId,Integer rollBackType,HttpServletRequest request) {
User user = SystemContext.getCurrentUser(request);
return workflowService.noProcRollBack(caseId,rollBackType,user);
}
@RequestMapping("checkTask")
@ResponseBody
public ServiceResponse checkTask(String taskId) {
ServiceResponse res = new ServiceResponse(true, "");
if (taskService.createTaskQuery().taskId(taskId).singleResult() == null) {
res.setingError("");
}
return res;
}
@InitBinder
public void initBinder(WebDataBinder webDataBinder, WebRequest webRequest) {
webDataBinder.registerCustomEditor(Date.class, new CustomDateEditor(
new SimpleDateFormat("yyyy-MM-dd"), true));
}
/**
* 任务办理
*
* @param taskId 任务id
* @param actionId 任务提交动作id(taskActionId:1241-查阅后未发现应当移送公安机关的涉嫌犯罪线索)
* @param assignTarget 任务提交目标(下一步任务分配目标)
* @param request
* @return
*/
@ResponseBody
@RequestMapping(value = "/batchTaskDeal")
public boolean batchTaskDeal(String taskIdAry,
Integer actionId,
String assignTarget,String inputerId,HttpServletRequest request) {
User user = SystemContext.getCurrentUser(request);
actionId = 1241;
String[] taskIds = taskIdAry.split(",");
for(String taskId:taskIds){
//保存请求参数数据
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
String[] dateAry = {dateFormat.format(new Date())};
Map<String, String[]> parameterMap = new HashMap<String, String[]>();//(Map<String, String[]>) request.getParameterMap();
parameterMap.put("field__354",dateAry);
ServiceResponse response = workflowService.taskDeal(user.getUserId(), taskId, actionId, assignTarget, parameterMap, null);
if (!response.getResult()) {
throw new BusinessException(response.getMsg());
}
}
return true;
}
@RequestMapping(value = "/batchTodoList")
public String batchTodoList(CaseFilter caseFilter,
HttpServletRequest request, Map<String, Object> model, String page) {
Map<String,Object> paramMap = new HashMap<String, Object>();
User user = SystemContext.getCurrentUser(request);
paramMap.put("caseNo", caseFilter.getCaseNo());
paramMap.put("caseName", caseFilter.getCaseName());
paramMap.put("minCaseInputTime", caseFilter.getMinCaseInputTime());
paramMap.put("maxCaseInputTime", caseFilter.getMaxCaseInputTime());
paramMap.put("isDiscussCase", caseFilter.getIsDiscussCase());
paramMap.put("minAmountInvolved", caseFilter.getMinAmountInvolved());
paramMap.put("maxAmountInvolved", caseFilter.getMaxAmountInvolved());
paramMap.put("chufaTimes", caseFilter.getChufaTimes());
paramMap.put("isSeriousCase", caseFilter.getIsSeriousCase());
paramMap.put("isBeyondEighty", caseFilter.getIsBeyondEighty());
paramMap.put("orgId", caseFilter.getOrgId());
paramMap.put("caseState", Const.CASE_STATE_CHAYUE);
//1:首页待办 2:待办案件查询
paramMap.put("type", 2);
PaginationHelper<TaskVO> tasks = workflowService.queryToDoTasks(user, 0, page,paramMap);
model.put("tasks", tasks);
model.put("page", page);
return "workflow/batch_todo_list";
}
}
| [
"longfei.su@7x-networks.com"
] | longfei.su@7x-networks.com |
8381a90035bc21174674344ad2e4ba5255c29c7f | f19a4e23a8a60d8cf3114a2723c66c1c15253fc5 | /src/main/java/Utils/Link.java | b220d21a295b64128e047a09c70ddf75b647b48c | [] | no_license | kuoche1712003/TimeSheet | 08358e7990dd192d3ad645024c9408cf88766e0d | e79a9e23d04d666acb617ea62c772edbc1597911 | refs/heads/master | 2021-05-06T11:01:36.300614 | 2017-12-15T06:56:04 | 2017-12-15T06:56:04 | 114,063,248 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,285 | java | package Utils;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import Bean.Employee;
public class Link {
private String emid;
public String StartLink(String emid) throws Exception{
StringBuffer link = new StringBuffer();
SimpleDateFormat sdFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
Calendar cal= Calendar.getInstance();
String start_date = sdFormat.format(date);
cal.add(Calendar.DAY_OF_MONTH, +3);
String end_date = sdFormat.format(cal.getTime());
// System.out.println(start_date);
// System.out.println(end_date);
link.append(start_date);
link.append("-");
link.append(emid);
link.append("-");
link.append(end_date);
// System.out.println(link);
String link_tostring = link.toString();
String cKey = "iisi_start_iisi_";
String enString = AES.Encrypt(link_tostring, cKey);
String enString1 = URLEncoder.encode(enString,"UTF-8");
// System.out.println(enString);
return enString1;
}
public boolean LinkVerify(String link) throws Exception{
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
String sKey = "iisi_start_iisi_";
// String deString1 = URLDecoder.decode(link, "UTF-8");
String deString = AES.Decrypt(link, sKey);
System.out.println(deString);
String vlink[] = deString.split("-");
// for(int i=0; i < vlink.length ;i++){
// System.out.println(vlink[i]);
// }
Date now = new Date();
// System.out.println(now);
Date start_date = sdf.parse(vlink[0]);
// System.out.println(start_date);
Date end_date = sdf.parse(vlink[2]);
// System.out.println(end_date);
long difference = end_date.getTime()- now.getTime() ;
// System.out.println(difference);
setEmid(vlink[1]);
if(difference > 0){
getEmid();
return true;
}else{
return false;
}
}
public String getEmid() {
return this.emid;
}
public void setEmid(String emid) {
this.emid = emid;
}
public static void main(String[] args) throws Exception {
Link test = new Link();
String emid = "em0001";
String link = test.StartLink(emid);
test.LinkVerify(link);
}
}
| [
"kuoche1712003@gmail.com"
] | kuoche1712003@gmail.com |
2ced96ff00f8a8fc50ecba9164184fde58194178 | ac35f1719499b72dc5ccd8700ee390a1d0f10ef5 | /AnalizadorSemantico/src/lexicosintactico/sym.java | 07a8825266ad3c1bf4d2a4c1078aa379b8336e6c | [] | no_license | ESolis123/UTESA | 90aabb606d72cc292ba621ca4f0450b8b46b0d89 | 411bffdc0c907f29c1d003fa13c641963a460356 | refs/heads/main | 2023-06-22T03:15:51.972595 | 2021-07-22T07:00:01 | 2021-07-22T07:00:01 | 376,978,632 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,649 | java |
//----------------------------------------------------
// The following code was generated by CUP v0.11a beta 20060608
// Mon Jun 10 02:31:02 CDT 2019
//----------------------------------------------------
package lexicosintactico;
/** CUP generated class containing symbol constants. */
public class sym {
/* terminals */
public static final int Else = 8;
public static final int Parentesis_c = 23;
public static final int For = 11;
public static final int Parentesis_a = 22;
public static final int Suma = 13;
public static final int Numero = 31;
public static final int Corchete_c = 27;
public static final int Op_booleano = 21;
public static final int ERROR = 32;
public static final int Corchete_a = 26;
public static final int Identificador = 30;
public static final int Comillas = 3;
public static final int Int = 5;
public static final int Llave_c = 25;
public static final int Llave_a = 24;
public static final int Op_relacional = 18;
public static final int P_coma = 29;
public static final int T_dato = 4;
public static final int Main = 28;
public static final int Cadena = 6;
public static final int EOF = 0;
public static final int Division = 16;
public static final int Op_incremento = 20;
public static final int Op_atribucion = 19;
public static final int Resta = 14;
public static final int If = 7;
public static final int Linea = 2;
public static final int error = 1;
public static final int Op_logico = 17;
public static final int Do = 9;
public static final int Igual = 12;
public static final int While = 10;
public static final int Multiplicacion = 15;
}
| [
"jose11@windowslive.com"
] | jose11@windowslive.com |
4e4c00760c31d364738c499e2ccf055787cb0d43 | 74143814f177d3cd78bc412e47462733e02ac8bc | /app/src/main/java/com/toni/patakazi/utils/PrefManager.java | b1c19cf7ef3dd5f249fcfcbbfdba73643ecbdea3 | [] | no_license | ToniNgethe/PataKazi | 72fdec94c2d8231f8fe3e15e551dd365e7edeac1 | 906b8a4ff6885b6298d86afd0bf84d9a61acb817 | refs/heads/master | 2020-12-31T07:34:43.863845 | 2018-01-07T08:25:54 | 2018-01-07T08:25:55 | 86,537,497 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,535 | java | package com.toni.patakazi.utils;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import com.google.gson.Gson;
import com.toni.patakazi.App;
import com.toni.patakazi.model.responses.LoginResponse;
/**
* Created by toni on 12/22/17.
*/
public class PrefManager {
private static final String USER_INFO = "user_information";
private static final String LOGGED_IN = "logged_in";
private static Gson gson = new Gson();
private static SharedPreferences getPreferences() {
return PreferenceManager.getDefaultSharedPreferences(App.getInstance()
.getApplicationContext());
}
public static int getInt(String preferenceKey, int preferenceDefaultValue) {
return getPreferences().getInt(preferenceKey, preferenceDefaultValue);
}
public static void putInt(String preferenceKey, int preferenceValue) {
getPreferences().edit().putInt(preferenceKey, preferenceValue).apply();
}
public static boolean getBoolean(String preferenceKey, boolean preferenceDefaultValue) {
return getPreferences().getBoolean(preferenceKey, preferenceDefaultValue);
}
public static void putBoolean(String preferenceKey, boolean preferenceValue) {
getPreferences().edit().putBoolean(preferenceKey, preferenceValue).apply();
}
public static String getString(String preferenceKey, String preferenceDefaultValue) {
return getPreferences().getString(preferenceKey, preferenceDefaultValue);
}
public static void putString(String preferenceKey, String preferenceValue) {
getPreferences().edit().putString(preferenceKey, preferenceValue).apply();
}
public static void clearPrefs() {
getPreferences().edit().clear().apply();
}
// store user info
public static void storeUser(LoginResponse user) {
putString(USER_INFO, gson.toJson(user));
}
// get user info
public static LoginResponse getUserInfo() {
String storedUser = getString(USER_INFO, null);
return gson.fromJson(storedUser, LoginResponse.class);
}
//set login session..
public static void setLoggedIn() {
putBoolean(LOGGED_IN, true);
}
// check if user is logged in or not
public static boolean isLoggedIn() {
return getBoolean(LOGGED_IN, false);
}
// get user email
public static String userEmail() {
LoginResponse loginResponse = getUserInfo();
return loginResponse.getData().getEmail();
}
}
| [
"antonyngethe@gmail.com"
] | antonyngethe@gmail.com |
7fdd5221f82b049a2d7b424fc44ad86b21293d80 | 5b2b982cfa001c564c8e6c3a6c074867961702d2 | /src/test/java/uk/co/mruoc/localphone/LocalNumberCalculatorTest.java | 8df859f95336a5012fd0b6357ed1bf86d4e07865 | [
"MIT"
] | permissive | michaelruocco/local-phone-number | d547c77cb9f9c98491cda8bf7741f4a57bafdbe5 | 5a49cc0fa10d18a32a4806365d0a9ccde3e29fdd | refs/heads/master | 2023-03-26T07:47:42.274224 | 2021-03-24T22:31:04 | 2021-03-24T22:31:04 | 291,535,498 | 0 | 0 | null | 2021-03-24T22:20:24 | 2020-08-30T19:14:19 | Java | UTF-8 | Java | false | false | 9,722 | java | package uk.co.mruoc.localphone;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import static com.neovisionaries.i18n.CountryCode.CH;
import static com.neovisionaries.i18n.CountryCode.DE;
import static com.neovisionaries.i18n.CountryCode.GB;
import static com.neovisionaries.i18n.CountryCode.GG;
import static com.neovisionaries.i18n.CountryCode.IN;
import static com.neovisionaries.i18n.CountryCode.RU;
import static com.neovisionaries.i18n.CountryCode.US;
import static org.assertj.core.api.Assertions.assertThat;
@DisplayName("Local number calculator tests")
public class LocalNumberCalculatorTest {
private static final String GUERNSEY_NUMBER = "01481 960 194";
private static final String SWISS_NUMBER = "41 22 343 80 14";
private static final String GERMAN_NUMBER = "491762260312";
private static final String INDIAN_NUMBER = "917503907302";
private final LocalNumberCalculator calculator = new LocalNumberCalculator();
private static String prefixPlus(String number) {
return String.format("+%s", number);
}
@Nested
@DisplayName("GB local number tests")
class GbLocalNumberTests {
@Test
void shouldReturnGuernseyNumberIfLocal() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(GUERNSEY_NUMBER, GB);
assertThat(number.getDefaultRegion()).isEqualTo(GB);
assertThat(number.getLocalRegion()).contains(GG);
assertThat(number.isLocal()).isTrue();
assertThat(number.getRawValue()).isEqualTo(GUERNSEY_NUMBER);
assertThat(number.getFormattedValue()).isEqualTo("+441481960194");
}
@Test
void shouldReturnSwissNumberIfNotLocal() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(SWISS_NUMBER, GB);
assertThat(number.getDefaultRegion()).isEqualTo(GB);
assertThat(number.getLocalRegion()).isEmpty();
assertThat(number.isLocal()).isFalse();
assertThat(number.getRawValue()).isEqualTo(SWISS_NUMBER);
assertThat(number.getFormattedValue()).isEqualTo("+41223438014");
}
@Test
void shouldReturnGermanNumberIfNotLocal() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(GERMAN_NUMBER, GB);
assertThat(number.getDefaultRegion()).isEqualTo(GB);
assertThat(number.getLocalRegion()).isEmpty();
assertThat(number.isLocal()).isFalse();
assertThat(number.getRawValue()).isEqualTo(GERMAN_NUMBER);
assertThat(number.getFormattedValue()).isEqualTo("+491762260312");
}
@Test
void shouldReturnIndianNumberIfNotLocal() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(INDIAN_NUMBER, GB);
assertThat(number.getDefaultRegion()).isEqualTo(GB);
assertThat(number.getLocalRegion()).isEmpty();
assertThat(number.isLocal()).isFalse();
assertThat(number.getRawValue()).isEqualTo(INDIAN_NUMBER);
assertThat(number.getFormattedValue()).isEqualTo("+917503907302");
}
}
@Nested
@DisplayName("Swiss local number tests")
class SwissLocalNumberTests {
@Test
void shouldReturnSwissNumberIsLocal() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(SWISS_NUMBER, CH);
assertThat(number.getDefaultRegion()).isEqualTo(CH);
assertThat(number.getLocalRegion()).contains(CH);
assertThat(number.isLocal()).isTrue();
}
@Test
void shouldReturnGuernseyNumberIsNotLocal() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(GUERNSEY_NUMBER, CH);
assertThat(number.getDefaultRegion()).isEqualTo(CH);
assertThat(number.getLocalRegion()).isEmpty();
assertThat(number.isLocal()).isFalse();
}
}
@Nested
@DisplayName("Russian local number tests")
class RussianLocalNumberTests {
@Test
void shouldReturnRussianNumberIfLocal() {
String russianNumber = "495 123 4567";
LocalPhoneNumber number = calculator.toLocalPhoneNumber(russianNumber, RU);
assertThat(number.getDefaultRegion()).isEqualTo(RU);
assertThat(number.getLocalRegion()).contains(RU);
assertThat(number.isLocal()).isTrue();
}
@Test
void shouldReturnGuernseyNumberIfNotLocal() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(GUERNSEY_NUMBER, RU);
assertThat(number.getDefaultRegion()).isEqualTo(RU);
assertThat(number.getLocalRegion()).isEmpty();
assertThat(number.isLocal()).isFalse();
}
}
@Nested
@DisplayName("US local number tests")
class UsLocalNumberTests {
@Test
void shouldReturnUsNumberIfLocal() {
String usNumber = "1-541-754-3010";
LocalPhoneNumber number = calculator.toLocalPhoneNumber(usNumber, US);
assertThat(number.getDefaultRegion()).isEqualTo(US);
assertThat(number.getLocalRegion()).contains(US);
assertThat(number.isLocal()).isTrue();
}
@Test
void shouldReturnGuernseyNumberIfNotLocal() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(GUERNSEY_NUMBER, US);
assertThat(number.getDefaultRegion()).isEqualTo(US);
assertThat(number.getLocalRegion()).isEmpty();
assertThat(number.isLocal()).isFalse();
}
}
@Nested
@DisplayName("German local number tests")
class GermanLocalNumberTests {
@Test
void shouldReturnGermanNumberIfLocal() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(GERMAN_NUMBER, DE);
assertThat(number.getDefaultRegion()).isEqualTo(DE);
assertThat(number.getLocalRegion()).contains(DE);
assertThat(number.isLocal()).isTrue();
}
@Test
void shouldReturnGuernseyNumberIfNotLocal() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(GUERNSEY_NUMBER, DE);
assertThat(number.getDefaultRegion()).isEqualTo(DE);
assertThat(number.getLocalRegion()).isEmpty();
assertThat(number.isLocal()).isFalse();
}
}
@Nested
@DisplayName("Formatted value tests")
class FormattedValueTests {
@Test
void shouldReturnRawAndFormattedValueIfNumberIsLocalToGb() {
String gbNumber = "441694429025";
LocalPhoneNumber number = calculator.toLocalPhoneNumber(gbNumber, GB);
assertThat(number.getRawValue()).isEqualTo(gbNumber);
assertThat(number.getFormattedValue()).isEqualTo("+441694429025");
}
@Test
void shouldReturnRawAndFormattedValueIfNumberIsLocalToGuernsey() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(GUERNSEY_NUMBER, GB);
assertThat(number.getRawValue()).isEqualTo(GUERNSEY_NUMBER);
assertThat(number.getFormattedValue()).isEqualTo("+441481960194");
}
@Test
void shouldReturnRawAndFormattedValueIfNumberIsLocalToGermany() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(GERMAN_NUMBER, DE);
assertThat(number.getRawValue()).isEqualTo(GERMAN_NUMBER);
assertThat(number.getFormattedValue()).isEqualTo("+491762260312");
}
@Test
void shouldReturnRawAndFormattedValueIfNumberIsLocalToIndia() {
String indianNumber = "917503907302";
LocalPhoneNumber number = calculator.toLocalPhoneNumber(indianNumber, IN);
assertThat(number.getRawValue()).isEqualTo(indianNumber);
assertThat(number.getFormattedValue()).isEqualTo("+917503907302");
}
@Test
void shouldReturnRawValueAsFormattedValueForIndianInternationalNumberFromUkSinceWeCantGuessTheCountryCode() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(INDIAN_NUMBER, GB);
assertThat(number.getRawValue()).isEqualTo(INDIAN_NUMBER);
assertThat(number.getFormattedValue()).isEqualTo(prefixPlus(INDIAN_NUMBER));
}
@Test
void shouldReturnRawAndFormattedValueIfNumberIsLocalToSwitzerland() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(SWISS_NUMBER, CH);
assertThat(number.getRawValue()).isEqualTo(SWISS_NUMBER);
assertThat(number.getFormattedValue()).isEqualTo("+41223438014");
}
@Test
void shouldReturnRawValueAsFormattedValueForGermanInternationalNumberFromUkSinceWeCantGuessTheCountryCode() {
LocalPhoneNumber number = calculator.toLocalPhoneNumber(GERMAN_NUMBER, GB);
assertThat(number.getRawValue()).isEqualTo(GERMAN_NUMBER);
assertThat(number.getFormattedValue()).isEqualTo(prefixPlus(GERMAN_NUMBER));
}
}
@Nested
@DisplayName("Mobile number tests")
class MobileNumberTests {
@Test
void shouldReturnIsMobileTrueForMobileNumber() {
String mobileNumber = "07911 123456";
LocalPhoneNumber number = calculator.toLocalPhoneNumber(mobileNumber, GB);
assertThat(number.isMobile()).isTrue();
}
@Test
void shouldReturnIsMobileFalseForFixedLineNumber() {
String fixedLineNumber = "01604 123456";
LocalPhoneNumber number = calculator.toLocalPhoneNumber(fixedLineNumber, GB);
assertThat(number.isMobile()).isFalse();
}
}
}
| [
"michael.ruocco@hotmail.com"
] | michael.ruocco@hotmail.com |
8a9d271b3cc87da69726fd7cc562627bf052ce52 | 63ece3a491e7c4b0bdcdffb0a3020acc3314a6d5 | /backend/src/main/java/com/rewe/scales/site/article/Article.java | acb8a2691ce9c0e30aae269c839c99bbb73393f6 | [
"MIT"
] | permissive | borko1945/scales | d9cd00ce0aca92a7f4c24c713581885fa843f957 | c37c4b837e590a7faf348423b7c2e932e2aca5ee | refs/heads/master | 2021-06-24T15:47:02.190388 | 2019-09-02T21:16:54 | 2019-09-02T21:16:54 | 201,715,475 | 0 | 0 | MIT | 2021-03-09T16:37:51 | 2019-08-11T04:09:59 | TypeScript | UTF-8 | Java | false | false | 637 | java | package com.rewe.scales.site.article;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.sql.Timestamp;
@Entity
@Table(name="article")
@NoArgsConstructor
@Data
public class Article {
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.AUTO)
@Id
private Long id;
@NotNull
@Column(name = "name")
private String name;
@Column(name = "created")
private Timestamp created;
@Column(name = "weight")
private Double weight;
public boolean hasWeight() {
return weight != null;
}
}
| [
"borko1945@gmail.com"
] | borko1945@gmail.com |
58ac81b524197ad920c3961de979092a8b6473f2 | d48142890a3928339358c7bbae9a62306c293647 | /player62.java | 576fef00aff12a03411491f6d48138ac53a81e60 | [] | no_license | AnushaSindhu/Anusha | b41dd6fb9e4efdfab1b0b34ec8efc0f7dd6c7bfe | 0b4092ad3a8fc9eb8fcc66277fea9342523b5f13 | refs/heads/master | 2021-01-15T15:32:40.753765 | 2016-09-07T06:57:58 | 2016-09-07T06:57:58 | 65,311,245 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 492 | java | package player62;
import java.util.Scanner;
public class odd {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
if(a%2!=0)
{
System.out.println(1);
}
else
for(int i=1;i<a;i++)
{
int b=a/i;
if(b%2==0)
{
continue;
}
else
{
if(b%2!=0)
{
System.out.println(i);
break;
}
}
}
}
}
| [
"noreply@github.com"
] | AnushaSindhu.noreply@github.com |
ded0b6882674d192864a5144ec9cb08c677e23a3 | 590b36463fc93e429caa7d65b4dee302a181874b | /PdfMaker/src/main/java/com/sooo/pdfmaker/domain/ContentDto.java | 0ea6dc2ccad46d7159725ad603393a48c39142f5 | [] | no_license | kimso0907/so-pdfmaker | 3a591ae8310876f9f8c4ba7280d97b9a1a6a8c92 | 0ff1a7e7fd5b2dda8026f9aeeaa03f834fa2f279 | refs/heads/master | 2023-01-07T00:00:36.473655 | 2020-11-04T18:11:20 | 2020-11-04T18:11:20 | 310,076,089 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 548 | java | package com.sooo.pdfmaker.domain;
import java.util.HashMap;
public abstract class ContentDto {
private HashMap<String, Object> contentSetting;
private String contentType;
public HashMap<String, Object> getContentSetting() {
return contentSetting;
}
public void setContentSetting(HashMap<String, Object> contentSetting) {
this.contentSetting = contentSetting;
}
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
}
| [
"kimso0907@gmail.com"
] | kimso0907@gmail.com |
63d45b346aebb0e43327620c6eac3902708d4747 | 04eb88e2eb3fd7004930170919eff41a0a9e0d6b | /src/main/java/com/anbang/qipai/xiuxianchang/msg/channel/sink/DaboluoGameSink.java | 43afed8c003692ed19a245c5b88c35ec7e09b1db | [] | no_license | flyarong/qipai_xiuxianchang | 65240715b01c51a1b82278fca83544c3a4b60e12 | 93d8ac49b3d7116fd607f45635edece27b57547d | refs/heads/master | 2023-03-15T16:23:59.061112 | 2019-05-15T07:32:24 | 2019-05-15T07:32:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 304 | java | package com.anbang.qipai.xiuxianchang.msg.channel.sink;
import org.springframework.cloud.stream.annotation.Input;
import org.springframework.messaging.SubscribableChannel;
public interface DaboluoGameSink {
String DABOLUOGAME = "daboluoGame";
@Input
SubscribableChannel daboluoGame();
}
| [
"林少聪 @PC-20180515PRDG"
] | 林少聪 @PC-20180515PRDG |
11817b46b30992239ea6954fce7628aee82a8aca | 22b57568dad3db4949056f783bf5f5d78aaa9ca4 | /src/java/iced-x86/src/test/java/com/github/icedland/iced/x86/ToOptionsProps.java | 4b32e88296b87dc1805fa6701efef89ca533bb8e | [
"MIT"
] | permissive | icedland/iced | d2178ea519c1472fb9c70c39c3a2f6428dc0d855 | 71f6d8372703e2487a973e0ad871a78348f63f8d | refs/heads/master | 2023-08-31T12:01:21.264077 | 2023-08-30T18:03:52 | 2023-08-30T18:03:52 | 147,866,440 | 1,446 | 128 | MIT | 2023-09-05T17:24:21 | 2018-09-07T19:30:25 | Rust | UTF-8 | Java | false | false | 5,273 | java | // SPDX-License-Identifier: MIT
// Copyright (C) 2018-present iced project and contributors
// ⚠️This file was generated by GENERATOR!🦹♂️
package com.github.icedland.iced.x86;
import java.util.HashMap;
import com.github.icedland.iced.x86.fmt.OptionsProps;
public final class ToOptionsProps {
public static Integer tryGet(String key) {
return map.get(key);
}
public static int get(String key) {
Integer value = tryGet(key);
if (value == null)
throw new UnsupportedOperationException(String.format("Couldn't find enum variant OptionsProps.%s", key));
return value.intValue();
}
public static String[] names() {
return map.entrySet().stream().sorted((a, b) -> Integer.compareUnsigned(a.getValue(), b.getValue())).map(a -> a.getKey()).toArray(String[]::new);
}
public static Iterable<Integer> values() {
return map.values();
}
public static int size() {
return map.size();
}
public static HashMap<String, Integer> copy() {
return new HashMap<String, Integer>(map);
}
private static final HashMap<String, Integer> map = getMap();
private static HashMap<String, Integer> getMap() {
HashMap<String, Integer> map = new HashMap<String, Integer>(64);
initMap0(map);
return map;
}
private static void initMap0(HashMap<String, Integer> map) {
map.put("AddLeadingZeroToHexNumbers", OptionsProps.ADD_LEADING_ZERO_TO_HEX_NUMBERS);
map.put("AlwaysShowScale", OptionsProps.ALWAYS_SHOW_SCALE);
map.put("AlwaysShowSegmentRegister", OptionsProps.ALWAYS_SHOW_SEGMENT_REGISTER);
map.put("BinaryDigitGroupSize", OptionsProps.BINARY_DIGIT_GROUP_SIZE);
map.put("BinaryPrefix", OptionsProps.BINARY_PREFIX);
map.put("BinarySuffix", OptionsProps.BINARY_SUFFIX);
map.put("BranchLeadingZeros", OptionsProps.BRANCH_LEADING_ZEROS);
map.put("DecimalDigitGroupSize", OptionsProps.DECIMAL_DIGIT_GROUP_SIZE);
map.put("DecimalPrefix", OptionsProps.DECIMAL_PREFIX);
map.put("DecimalSuffix", OptionsProps.DECIMAL_SUFFIX);
map.put("DigitSeparator", OptionsProps.DIGIT_SEPARATOR);
map.put("DisplacementLeadingZeros", OptionsProps.DISPLACEMENT_LEADING_ZEROS);
map.put("FirstOperandCharIndex", OptionsProps.FIRST_OPERAND_CHAR_INDEX);
map.put("GasNakedRegisters", OptionsProps.GAS_NAKED_REGISTERS);
map.put("GasShowMnemonicSizeSuffix", OptionsProps.GAS_SHOW_MNEMONIC_SIZE_SUFFIX);
map.put("GasSpaceAfterMemoryOperandComma", OptionsProps.GAS_SPACE_AFTER_MEMORY_OPERAND_COMMA);
map.put("HexDigitGroupSize", OptionsProps.HEX_DIGIT_GROUP_SIZE);
map.put("HexPrefix", OptionsProps.HEX_PREFIX);
map.put("HexSuffix", OptionsProps.HEX_SUFFIX);
map.put("IP", OptionsProps.IP);
map.put("LeadingZeros", OptionsProps.LEADING_ZEROS);
map.put("MasmAddDsPrefix32", OptionsProps.MASM_ADD_DS_PREFIX32);
map.put("MemorySizeOptions", OptionsProps.MEMORY_SIZE_OPTIONS);
map.put("NasmShowSignExtendedImmediateSize", OptionsProps.NASM_SHOW_SIGN_EXTENDED_IMMEDIATE_SIZE);
map.put("NumberBase", OptionsProps.NUMBER_BASE);
map.put("OctalDigitGroupSize", OptionsProps.OCTAL_DIGIT_GROUP_SIZE);
map.put("OctalPrefix", OptionsProps.OCTAL_PREFIX);
map.put("OctalSuffix", OptionsProps.OCTAL_SUFFIX);
map.put("PreferST0", OptionsProps.PREFER_ST0);
map.put("RipRelativeAddresses", OptionsProps.RIP_RELATIVE_ADDRESSES);
map.put("ScaleBeforeIndex", OptionsProps.SCALE_BEFORE_INDEX);
map.put("ShowBranchSize", OptionsProps.SHOW_BRANCH_SIZE);
map.put("ShowSymbolAddress", OptionsProps.SHOW_SYMBOL_ADDRESS);
map.put("ShowZeroDisplacements", OptionsProps.SHOW_ZERO_DISPLACEMENTS);
map.put("SignedImmediateOperands", OptionsProps.SIGNED_IMMEDIATE_OPERANDS);
map.put("SignedMemoryDisplacements", OptionsProps.SIGNED_MEMORY_DISPLACEMENTS);
map.put("SmallHexNumbersInDecimal", OptionsProps.SMALL_HEX_NUMBERS_IN_DECIMAL);
map.put("SpaceAfterMemoryBracket", OptionsProps.SPACE_AFTER_MEMORY_BRACKET);
map.put("SpaceAfterOperandSeparator", OptionsProps.SPACE_AFTER_OPERAND_SEPARATOR);
map.put("SpaceBetweenMemoryAddOperators", OptionsProps.SPACE_BETWEEN_MEMORY_ADD_OPERATORS);
map.put("SpaceBetweenMemoryMulOperators", OptionsProps.SPACE_BETWEEN_MEMORY_MUL_OPERATORS);
map.put("TabSize", OptionsProps.TAB_SIZE);
map.put("UppercaseAll", OptionsProps.UPPERCASE_ALL);
map.put("UppercaseDecorators", OptionsProps.UPPERCASE_DECORATORS);
map.put("UppercaseHex", OptionsProps.UPPERCASE_HEX);
map.put("UppercaseKeywords", OptionsProps.UPPERCASE_KEYWORDS);
map.put("UppercaseMnemonics", OptionsProps.UPPERCASE_MNEMONICS);
map.put("UppercasePrefixes", OptionsProps.UPPERCASE_PREFIXES);
map.put("UppercaseRegisters", OptionsProps.UPPERCASE_REGISTERS);
map.put("UsePseudoOps", OptionsProps.USE_PSEUDO_OPS);
map.put("CC_b", OptionsProps.CC_B);
map.put("CC_ae", OptionsProps.CC_AE);
map.put("CC_e", OptionsProps.CC_E);
map.put("CC_ne", OptionsProps.CC_NE);
map.put("CC_be", OptionsProps.CC_BE);
map.put("CC_a", OptionsProps.CC_A);
map.put("CC_p", OptionsProps.CC_P);
map.put("CC_np", OptionsProps.CC_NP);
map.put("CC_l", OptionsProps.CC_L);
map.put("CC_ge", OptionsProps.CC_GE);
map.put("CC_le", OptionsProps.CC_LE);
map.put("CC_g", OptionsProps.CC_G);
map.put("DecoderOptions", OptionsProps.DECODER_OPTIONS);
map.put("ShowUselessPrefixes", OptionsProps.SHOW_USELESS_PREFIXES);
}
}
| [
"wtfsck@protonmail.com"
] | wtfsck@protonmail.com |
06d7c20813ed31d8b72529cccc1090199d834834 | 447520f40e82a060368a0802a391697bc00be96f | /apks/playstore_apps/com_ubercab/source/com/twilio/voice/impl/session/CredentialInfo.java | b65be4238b264aad5a511b7bcf38bbb8ce3a39f2 | [
"Apache-2.0",
"GPL-1.0-or-later"
] | permissive | iantal/AndroidPermissions | 7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465 | d623b732734243590b5f004d167e542e2e2ae249 | refs/heads/master | 2023-07-19T01:29:26.689186 | 2019-09-30T19:01:42 | 2019-09-30T19:01:42 | 107,239,248 | 0 | 0 | Apache-2.0 | 2023-07-16T07:41:38 | 2017-10-17T08:22:57 | null | UTF-8 | Java | false | false | 535 | java | package com.twilio.voice.impl.session;
public class CredentialInfo
{
private String data;
private CredentialInfo.DataType dataType;
private String realm;
private String scheme;
private String username;
public CredentialInfo(String paramString1, String paramString2, String paramString3, CredentialInfo.DataType paramDataType, String paramString4)
{
this.realm = paramString1;
this.scheme = paramString2;
this.username = paramString3;
this.dataType = paramDataType;
this.data = paramString4;
}
}
| [
"antal.micky@yahoo.com"
] | antal.micky@yahoo.com |
233e09236d35061a58f1c9cf246a6e5d3fdd9db6 | 4f4ddc396fa1dfc874780895ca9b8ee4f7714222 | /src/nolstudio/com/gensym/nols/main/Resource.java | 0d18fb92421c575dac4259e1b6c1022233ee83f0 | [] | no_license | UtsavChokshiCNU/GenSym-Test2 | 3214145186d032a6b5a7486003cef40787786ba0 | a48c806df56297019cfcb22862dd64609fdd8711 | refs/heads/master | 2021-01-23T23:14:03.559378 | 2017-09-09T14:20:09 | 2017-09-09T14:20:09 | 102,960,203 | 3 | 5 | null | null | null | null | UTF-8 | Java | false | false | 9,423 | java | package com.gensym.nols.main;
import java.util.*;
import java.io.IOException;
import java.text.MessageFormat;
/** A helper class that aids in the debugging of resource providing
* and assists in making resource usage simpler. It is a wrapper around
* java.util.ResourceBundle.
* <p>
* Debugging: After Resource.setResourceDebug(true) is called, when a resource
* is not found, rather than throwing an
* exception, the various format and getString methods
* return the key and print an error message to standard out.
* <p>
* Convenience: the various <code>format</code> methods take both the message
* lookup key, and the arguments that should be used to substitute into the
* variable parts of the found string. For this it uses
* java.text.MessageFormat.
* <p>
* Additional Functionality: This class is Serializable, and it achieves this
* by looking up the associated ResourceBundle during the readObject() method.
* @author Robert Penny
* @version 1.2
* @see java.util.ResourceBundle
* @see java.text.MessageFormat
*/
public class Resource implements java.io.Serializable {
//
// class members
//
protected static boolean resourceDebug = false;
private static ResourceBundle i18n;
//
private static String missingBundleString =
"Unable to locate bundle \"{0}\", because: \"{1}\"";
private static String missingLookupString =
"Unable to locate resource \"{0}\" in bundle \"{1}\", because: \"{2}\"";
private static String mismatchedLookupString =
"The key \"{0}\" in the resource named \"{1}\" resulted in the template \"{2}\", which did not match the arguments: {3}";
private static String unknownMessage = "UNKNOWN_MESSAGE";
static {
try {
i18n = ResourceBundle.getBundle("com.gensym.nols.main.Messages");
missingBundleString = i18n.getString("Resource_unableToLocateBundle");
missingLookupString = i18n.getString("Resource_unableToLocateString");
mismatchedLookupString = i18n.getString("Resource_mismatchedLookupString");
unknownMessage = i18n.getString("Resource_unknownMessage");
} catch (Exception mre) {
mre.printStackTrace();
}
}
// will be overriding the pattern, so would prefer if there was a no-arg
// constructor, so just putting in any old string
private static MessageFormat fmt = new MessageFormat(missingBundleString);
private static final boolean debug = false;
private static volatile Locale defaultLocale;
private static final Hashtable localeTable = new Hashtable();
//
// instance members
//
private transient ResourceBundle realBundle;
private transient Locale locale;
private transient boolean damagedBundle;
private String resourceName;
/** package private constructor to enable DummyResource to work.
*/
Resource(String resourceName) {
this.resourceName = resourceName;
initializeLocale();
}
/** Acts as a forwarder to vanilla ResourceBundles */
protected Resource (String resourceName, Locale locale)
throws MissingResourceException {
//System.out.println("makingResource: " + resourceName);
this.resourceName = resourceName;
this.locale = locale;
initializeLocale();
}
private void initializeLocale() {
if (locale == null)
locale = getDefaultLocale();
}
/** This method is made protected in order allow an application a chance
* to provide a new "realBundle" (e.g., create a new .properties file)
* and re-initialize the Resource. */
protected void initializeBundle() throws MissingResourceException {
try {
realBundle = ResourceBundle.getBundle(resourceName, locale);
damagedBundle = false;
} catch (MissingResourceException mre) {
damagedBundle = true;
if (resourceDebug) {
mre.printStackTrace();
} else {
mre.fillInStackTrace();
throw mre;
}
}
}
public String getResourceName() {
return resourceName;
}
public static void setDefaultLocale (Locale locale) {
defaultLocale = locale;
}
public static Locale getDefaultLocale () {
if (defaultLocale == null) {
return Locale.getDefault();
}
return defaultLocale;
}
public static Resource getBundle(String resourceName) {
return getBundle(resourceName, getDefaultLocale());
}
public static Resource getBundle(final String resourceName, final Locale locale) {
//System.out.println("getBundle: " + resourceName);
Locale resourceLocale = (locale == null ? getDefaultLocale() : locale);
Hashtable bundleTable = (Hashtable)localeTable.get(resourceLocale);
if (bundleTable == null) {
bundleTable = new Hashtable();
localeTable.put(resourceLocale, bundleTable);
}
Resource resource = (Resource)bundleTable.get(resourceName);
if (resource == null) {
resource = new Resource(resourceName, resourceLocale);
bundleTable.put(resourceName, resource);
}
return resource;
}
/** Controls exception throwing of <code>getString()</code>.
* @param on If <code>on</code> is <code>true</code>, then
* instead of throwing an exception, <code>getString()</code>
* will print a log message.
* @see Resource#getString
*/
public static void setResourceDebug(boolean on) {
resourceDebug = on;
}
private void readObject(java.io.ObjectInputStream in)
throws IOException, ClassNotFoundException {
try {
in.defaultReadObject();
} catch (java.io.NotActiveException ex) {
if (resourceDebug)
ex.printStackTrace();
}
initializeLocale();
}
public String getString(String key) throws MissingResourceException {
if(debug)
System.out.println("Entered Resource.getString: " + key);
if (realBundle == null) {
if (damagedBundle) {
if (resourceDebug)
return key;
} else {
initializeBundle();
if (damagedBundle && resourceDebug)
return key;
}
}
String value = null;
try {
value = realBundle.getString(key);
} catch (MissingResourceException ex) {
Object[] args = {key, resourceName, ex.getMessage()};
// can think of no tidier way that avoids recursion:
fmt.applyPattern(missingLookupString);
StringBuffer errorMessage = fmt.format(args, new StringBuffer(), null);
String errorMessageString = errorMessage.toString ();
if (resourceDebug)
System.out.println(errorMessageString);
value = unknownMessage;
if(!resourceDebug) {
throw new MissingResourceException (errorMessageString, resourceName, key);
}
}
return value;
}
/** Format the message using the message template retrieved by <code>key</code>
* @see java.text.MessageFormat
*/
public String format(String key, Object[] args) throws
MissingResourceException{
if(debug)
System.out.println("Entered Resource.format: " + Arrays.toString(args) + " " + key);
String messageTemplate = getString(key);
if (args == null) {
return messageTemplate;
}
Object arg = null;
for (int i = 0 ; i<args.length; i++) {
arg = args[i];
if (arg == null)
args[i] = "<NULL>";
else
args[i] = arg.toString();
}
try {
fmt.applyPattern(messageTemplate);
return fmt.format(args, new StringBuffer(), null).toString();
} catch (IllegalArgumentException ex) {
if (resourceDebug)
ex.printStackTrace();
else
throw ex;
Object[] errorArgs = {key, resourceName, messageTemplate, Arrays.toString(args)};
try {
fmt.applyPattern(mismatchedLookupString);
StringBuffer errorMessageBuffer = fmt.format(errorArgs,
new StringBuffer(),
null);
String errorMessage = errorMessageBuffer.toString();
System.out.println(errorMessage.toString());
} catch (Exception ex2) {
ex2.printStackTrace();
}
return key;
}
}
private Object[] oneArg = new Object[1];
private Object[] twoArgs = new Object[2];
/** convenience method that also reduces garbage collection */
public String format(String key, Object arg) throws MissingResourceException {
oneArg[0] = arg;
return format(key, oneArg);
}
/** convenience method that also reduces garbage collection */
public String format(String key, Object arg1, Object arg2)
throws MissingResourceException {
twoArgs[0] = arg1;
twoArgs[1] = arg2;
return format(key, twoArgs);
}
String toStringString;
@Override
public String toString() {
if (toStringString == null) {
String resourceString = (realBundle == null ? resourceName :
realBundle.toString());
toStringString = getClass().getName() + "[" + resourceString + "]";
}
return toStringString;
}
@Override
public boolean equals(Object obj) {
if (obj == null || !getClass().equals(obj.getClass())) {
return false;
}
Resource other = (Resource)obj;
if (resourceName.equals(other.resourceName)) {
return (locale.equals(other.locale));
} else
return false;
}
private int hashCode;
private boolean hashCodeIsSet;
@Override
public int hashCode() {
if (!hashCodeIsSet) {
if (resourceName != null)
// NOTE: Resources using different locales are usually
// stored in different hashtables, so there is no need to
// incur the overhead of modifying the hashCode to incorporate
// the locale.
hashCode = resourceName.hashCode();
hashCodeIsSet = true;
}
return hashCode;
}
}
| [
"utsavchokshi@Utsavs-MacBook-Pro.local"
] | utsavchokshi@Utsavs-MacBook-Pro.local |
f2aec2b9cf2f7e23b4cc30d14d0bd8b1eeb62699 | 42145c1cbef7b1443a3eb68e5b9608ad045e2d05 | /pinyougou_seckill_service/src/main/java/com/pinyougou/seckill/service/impl/SeckillGoodsServiceImpl.java | c7b55c160c170956a380353d330aef2e22c045ad | [] | no_license | hy396027768/pinyougou-finaly | 899246e5ccbcf9ec8a60aebc382d0e1d2f66b272 | ace138e258e692f56d36a2da07aab04317f88bcf | refs/heads/master | 2020-05-15T10:36:28.761559 | 2019-04-19T04:49:35 | 2019-04-19T04:49:35 | 182,194,564 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,093 | java | package com.pinyougou.seckill.service.impl;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.abel533.entity.Example;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pinyougou.mapper.TbGoodsMapper;
import com.pinyougou.mapper.TbSeckillGoodsMapper;
import com.pinyougou.pojo.TbGoods;
import com.pinyougou.pojo.TbSeckillGoods;
import com.pinyougou.seckill.service.SeckillGoodsService;
import entity.PageResult;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 业务逻辑实现
*
* @author Steven
*/
@Service
public class SeckillGoodsServiceImpl implements SeckillGoodsService {
@Autowired
private TbSeckillGoodsMapper seckillGoodsMapper;
@Autowired
private TbGoodsMapper goodsMapper;
/**
* 查询全部
*/
@Override
public List<TbSeckillGoods> findAll() {
return seckillGoodsMapper.select(null);
}
/**
* 按分页查询
*/
@Override
public PageResult findPage(int pageNum, int pageSize) {
PageResult<TbSeckillGoods> result = new PageResult<TbSeckillGoods>();
//设置分页条件
PageHelper.startPage(pageNum, pageSize);
//查询数据
List<TbSeckillGoods> list = seckillGoodsMapper.select(null);
//保存数据列表
result.setRows(list);
//获取总记录数
PageInfo<TbSeckillGoods> info = new PageInfo<TbSeckillGoods>(list);
result.setTotal(info.getTotal());
return result;
}
/**
* 增加
*/
@Override
public void add(TbSeckillGoods seckillGoods) {
TbGoods tbgoods = new TbGoods();
tbgoods.setAuditStatus("4");
tbgoods.setId(seckillGoods.getGoodsId());
goodsMapper.updateByPrimaryKeySelective(tbgoods);
seckillGoods.setCreateTime(new Date());
seckillGoods.setCheckTime(seckillGoods.getCreateTime());
seckillGoods.setStatus("0");
seckillGoodsMapper.insertSelective(seckillGoods);
}
/**
* 修改
*/
@Override
public void update(TbSeckillGoods seckillGoods) {
TbGoods goods = new TbGoods();
if (seckillGoods.getStatus().equals("1")) {
goods.setAuditStatus("5");
goods.setId(seckillGoods.getGoodsId());
}else{
goods.setAuditStatus("4");
goods.setId(seckillGoods.getGoodsId());
}
goodsMapper.updateByPrimaryKeySelective(goods);
seckillGoodsMapper.updateByPrimaryKeySelective(seckillGoods);
}
/**
* 根据ID获取实体
*
* @param seckillGoods
* @return
*/
@Override
public TbSeckillGoods findOne(Long id) {
return seckillGoodsMapper.selectByPrimaryKey(id);
}
/**
* 批量删除
*/
@Override
public void delete(Long[] ids) {
//数组转list
List longs = Arrays.asList(ids);
//构建查询条件
Example example = new Example(TbSeckillGoods.class);
Example.Criteria criteria = example.createCriteria();
criteria.andIn("id", longs);
//跟据查询条件删除数据
seckillGoodsMapper.deleteByExample(example);
}
@Override
public PageResult findPage(TbSeckillGoods seckillGoods, int pageNum, int pageSize) {
PageResult<TbSeckillGoods> result = new PageResult<TbSeckillGoods>();
//设置分页条件
PageHelper.startPage(pageNum, pageSize);
//构建查询条件
Example example = new Example(TbSeckillGoods.class);
Example.Criteria criteria = example.createCriteria();
if (seckillGoods != null) {
//如果字段不为空
if (seckillGoods.getTitle() != null && seckillGoods.getTitle().length() > 0) {
criteria.andLike("title", "%" + seckillGoods.getTitle() + "%");
}
//如果字段不为空
if (seckillGoods.getSmallPic() != null && seckillGoods.getSmallPic().length() > 0) {
criteria.andLike("smallPic", "%" + seckillGoods.getSmallPic() + "%");
}
//如果字段不为空
if (seckillGoods.getSellerId() != null && seckillGoods.getSellerId().length() > 0) {
criteria.andLike("sellerId", "%" + seckillGoods.getSellerId() + "%");
}
//如果字段不为空
if (seckillGoods.getStatus() != null && seckillGoods.getStatus().length() > 0) {
criteria.andLike("status", "%" + seckillGoods.getStatus() + "%");
}
//如果字段不为空
if (seckillGoods.getIntroduction() != null && seckillGoods.getIntroduction().length() > 0) {
criteria.andLike("introduction", "%" + seckillGoods.getIntroduction() + "%");
}
}
//查询数据
List<TbSeckillGoods> list = seckillGoodsMapper.selectByExample(example);
//保存数据列表
result.setRows(list);
//获取总记录数
PageInfo<TbSeckillGoods> info = new PageInfo<TbSeckillGoods>(list);
result.setTotal(info.getTotal());
return result;
}
@Autowired
private RedisTemplate redisTemplate;
@Override
public List<TbSeckillGoods> findList() {
//先从缓存中查询商品列表
List<TbSeckillGoods> goodsList = redisTemplate.boundHashOps("goodsList").values();
if (goodsList == null || goodsList.size() < 1) {
//组装查询条件
Example example = new Example(TbSeckillGoods.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("status", "1"); //只查询已审核商品
criteria.andGreaterThan("stockCount", 0); //只查询有货商品
//只查询在活动时间内的商品
Date now = new Date();
//开始时间小于等于当前时间
criteria.andLessThanOrEqualTo("startTime", now);
//结束时间要大于等于当前时间
criteria.andGreaterThanOrEqualTo("endTime", now);
//查询数据
goodsList = seckillGoodsMapper.selectByExample(example);
//把商品数据库存入redis
for (TbSeckillGoods seckillGoods : goodsList) {
redisTemplate.boundHashOps("goodsList").put(seckillGoods.getId(), seckillGoods);
}
} else {
System.out.println("从缓存是加载了商品列表...");
}
return goodsList;
}
@Override
public TbSeckillGoods findOneFromRedis(Long id) {
TbSeckillGoods goods = (TbSeckillGoods) redisTemplate.boundHashOps("goodsList").get(id);
return goods;
}
@Test
public void test() {
TbSeckillGoods tbSeckillGoods = seckillGoodsMapper.selectByPrimaryKey(11);
System.out.println(tbSeckillGoods);
}
}
| [
"hy396027768@icloud.com"
] | hy396027768@icloud.com |
0b42b5cd4dbf9c43b5d29f6c6e9670728babdd06 | 419855016c62403593b962d28d8b4cc36af09e80 | /src/com/nod_labs/pointer/PointerService.java | 27e20ffbb411dac81601201f81d9a1e184c7449f | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | sanyaade-iot/openspatial-android-sdk | 7c1c633170941d01090f6d9c8593c684303004d0 | df5b31763a4cd60b0b499a1695f38c2a8c3b6a6d | refs/heads/master | 2020-12-25T10:14:25.395853 | 2014-08-06T03:08:31 | 2014-08-07T00:58:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,582 | java | /*
* Copyright (C) 2014 Nod Labs
*
* Licensed 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.nod_labs.pointer;
import android.annotation.TargetApi;
import android.app.Application;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.os.*;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import com.google.inject.Inject;
import net.openspatial.ButtonEvent;
import roboguice.service.RoboService;
import java.util.HashMap;
import java.util.Map;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
public class PointerService extends RoboService {
private PointerView mPointerView;
private final IBinder mBinder = new PointerServiceBinder();
@Inject
private WindowManager mWindowManager;
@Inject
Application mApplication;
private Handler mHandler = new Handler(Looper.getMainLooper());
private final Map<View, PointerViewCallback> mRegisteredViews = new HashMap<View, PointerViewCallback>();
private final Map<View, Integer> mViewZindex = new HashMap<View, Integer>();
private final Map<String, Boolean> mTouch2State = new HashMap<String, Boolean>();
private static final String TAG = PointerService.class.getSimpleName();
@Override
public void onCreate() {
super.onCreate();
mPointerView = new PointerView(mApplication);
WindowManager.LayoutParams params = new WindowManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE |
WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
PixelFormat.TRANSLUCENT);
params.gravity = Gravity.LEFT | Gravity.TOP;
mWindowManager.addView(mPointerView, params);
Point point = new Point();
mWindowManager.getDefaultDisplay().getRealSize(point);
mPointerView.setWindowBounds(point.x, point.y);
}
@Override
public void onDestroy() {
super.onDestroy();
mWindowManager.removeView(mPointerView);
}
public void addPointer(final String pointerId,
final int radius,
final int a,
final int r,
final int g,
final int b,
final String caption) {
mHandler.post(new Runnable() {
@Override
public void run() {
mPointerView.addPointer(pointerId, radius, a, r, g, b, caption);
mTouch2State.put(pointerId, false);
mPointerView.invalidate();
}
});
}
public void removePointer(final String pointerId) {
mHandler.post(new Runnable() {
@Override
public void run() {
mPointerView.removePointer(pointerId);
mPointerView.invalidate();
}
});
}
public void updatePointerPosition(final String pointerId, final int deltaX, final int deltaY) {
mHandler.post(new Runnable() {
@Override
public void run() {
mPointerView.updatePointerPosition(pointerId, deltaX, deltaY);
boolean touch2Down = mTouch2State.get(pointerId);
if (touch2Down) {
Point currentPosition = getCurrentPositionOnScreen(pointerId);
PointerViewCallback cb = getCallbackForView(pointerId, currentPosition);
if (cb != null) {
cb.onDrag(pointerId, currentPosition.x, currentPosition.y, PointerService.this);
}
}
mPointerView.invalidate();
}
});
}
public void updatePointerRadius(final String pointerId, final int radius) {
mHandler.post(new Runnable() {
@Override
public void run() {
mPointerView.updatePointerRadius(pointerId, radius);
mPointerView.invalidate();
}
});
}
public void updatePointerColor(final String pointerId, final int a, final int r, final int g, final int b) {
mHandler.post(new Runnable() {
@Override
public void run() {
mPointerView.updatePointerColor(pointerId, a, r, g, b);
mPointerView.invalidate();
}
});
}
public void updatePointerColor(final String pointerId, int color) {
updatePointerColor(pointerId, Color.alpha(color), Color.red(color), Color.green(color), Color.blue(color));
}
public void updatePointerCaption(final String pointerId, final String caption) {
mHandler.post(new Runnable() {
@Override
public void run() {
mPointerView.updatePointerCaption(pointerId, caption);
mPointerView.invalidate();
}
});
}
private Point getCurrentPositionOnScreen(String pointerId) {
Point currentPosition = mPointerView.getCurrentPosition(pointerId);
int location[] = new int[2];
mPointerView.getLocationOnScreen(location);
currentPosition.x += location[0];
currentPosition.y += location[1];
return currentPosition;
}
private PointerViewCallback getCallbackForView(String pointerId, Point position) {
PointerViewCallback cb = null;
View v = getCurrentView(position);
if (v == null) {
Log.e(TAG, "Unknown view at position: (" + position.x + ", " + position.y + ")");
return null;
}
return getCallbackForView(pointerId, v);
}
private PointerViewCallback getCallbackForView(String pointerId, View v) {
return mRegisteredViews.get(v);
}
public void performButtonEvent(final String pointerId, final ButtonEvent event) {
mHandler.post(new Runnable() {
@Override
public void run() {
Point currentPosition = getCurrentPositionOnScreen(pointerId);
View v = getCurrentView(currentPosition);
PointerViewCallback cb = getCallbackForView(pointerId, v);
boolean touch2Down = mTouch2State.get(pointerId);
if (cb != null) {
cb.onButtonEvent(pointerId, event, currentPosition.x, currentPosition.y, PointerService.this);
}
switch (event.buttonEventType) {
case TOUCH0_DOWN:
touch2Down = true;
break;
case TOUCH0_UP:
if (touch2Down) {
Log.d(TAG, "Sending click event for device " + pointerId);
if (cb != null) {
cb.onClick(pointerId, currentPosition.x, currentPosition.y, PointerService.this);
} else if (v != null) {
v.callOnClick();
}
}
touch2Down = false;
break;
// We don't care about the others (for now anyway)
}
mTouch2State.put(pointerId, touch2Down);
}
});
}
public void registerView(final View v, final PointerViewCallback cb) {
registerViewWithZindex(v, cb, 0);
}
public void registerViewWithZindex(final View v, final PointerViewCallback cb, final int zIndex) {
mHandler.post(new Runnable() {
@Override
public void run() {
mRegisteredViews.put(v, cb);
mViewZindex.put(v, zIndex);
}
});
}
public void updateViewZindex(final View v, final int zIndex) {
mHandler.post(new Runnable() {
@Override
public void run() {
mViewZindex.put(v, zIndex);
}
});
}
public void unregisterView(final View v) {
mHandler.post(new Runnable() {
@Override
public void run() {
mRegisteredViews.remove(v);
}
});
}
private boolean withinView(View v, Point position) {
int[] location = new int[2];
v.getLocationOnScreen(location);
Point topLeft = new Point(location[0], location[1]);
Point bottomRight = new Point(topLeft.x + v.getWidth(), topLeft.y + v.getHeight());
return (position.x > topLeft.x &&
position.x < bottomRight.x &&
position.y > topLeft.y &&
position.y < bottomRight.y);
}
private View getCurrentView(Point position) {
int maxZindex = Integer.MIN_VALUE;
View currentView = null;
for (View v : mRegisteredViews.keySet()) {
if (withinView(v, position)) {
int zIndex = mViewZindex.get(v);
if (zIndex >= maxZindex) {
currentView = v;
maxZindex = zIndex;
}
}
}
return currentView;
}
@Override
public IBinder onBind(Intent intent) {
return mBinder;
}
public class PointerServiceBinder extends Binder {
public PointerService getService() {
return PointerService.this;
}
}
public interface PointerViewCallback {
public void onButtonEvent(String pointerId, ButtonEvent event, int x, int y, PointerService service);
public void onClick(String pointerId, int x, int y, PointerService service);
public void onDrag(String pointerId, int x, int y, PointerService service);
}
}
| [
"rni@enimai.com"
] | rni@enimai.com |
10bc8450955a0e75d6750cbced988bce8d5c6a34 | 6959d6eee500f95d9e14fec914f5fb97d693bd9b | /calabash-backup/src/main/java/com/tvd12/calabash/backup/BytesMapBackup.java | ceb88294033a53f71e303af2e118b71c6abdb92c | [
"Apache-2.0"
] | permissive | tvd12/calabash | 3bb22f3897356d4bbd84190b28264d0d2569f914 | 36ff83d169a482bcb05304540ea3ac5532d028b5 | refs/heads/master | 2022-05-24T08:46:36.492156 | 2022-05-02T10:23:39 | 2022-05-02T10:23:39 | 197,406,515 | 1 | 0 | null | 2019-07-17T14:34:25 | 2019-07-17T14:34:25 | null | UTF-8 | Java | false | false | 548 | java | package com.tvd12.calabash.backup;
import com.tvd12.calabash.backup.setting.MapBackupSetting;
import com.tvd12.calabash.core.util.ByteArray;
import java.util.Collection;
import java.util.Map;
public interface BytesMapBackup {
void backup(MapBackupSetting setting, ByteArray key, byte[] value);
void backup(MapBackupSetting setting, Map<ByteArray, byte[]> m);
void remove(MapBackupSetting setting, ByteArray key);
void remove(MapBackupSetting setting, Collection<ByteArray> keys);
void clear(MapBackupSetting setting);
}
| [
"itprono3@gmail.com"
] | itprono3@gmail.com |
31cff47e521c902af7ad35afba8c2e8970217a4f | 266323d895daccf86f9d7ea996c0e5ade08b2baf | /_11726/_11726.java | 6e5bf5faa1488bda3a03dc8f1f8e24bf478df85d | [] | no_license | jooo0ooo/boj | 421d09446756b5197f5c9fb852e8132cec7578f7 | 4fb8f396cdf2e954d2aef355449aea3711f05498 | refs/heads/master | 2021-09-18T16:30:50.148456 | 2021-07-31T04:18:12 | 2021-07-31T04:18:12 | 196,891,816 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 660 | java | package _11726;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class _11726 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int n = Integer.parseInt(br.readLine());
int[] dp = new int[1001];
dp[1] = 1;
dp[2] = 2;
for (int i = 3; i <= n; i++) {
dp[i] = (dp[i - 1] + dp[i - 2]) % 10007;
}
bw.write(dp[n] + "");
bw.flush();
bw.close();
}
}
| [
"pingrae@me.com"
] | pingrae@me.com |
3384e5dc6a75e4a5989de6e1b6728a67eb826d85 | 3e92fa270ce4d1409c729eee816481d8b37000f5 | /BallBattle/src/test/WorkThread.java | 104801a591a65695bc10c8464dbc8a4e67d11ccf | [] | no_license | BelloCiao/Ball-Ball-Battle | 6cf2c6f969627741ed6879105ef7fbe4ae941b67 | 6d8f0dcc11d980c29a46c4e6bbb8e131b5f00464 | refs/heads/master | 2020-03-17T10:38:52.173892 | 2018-05-15T10:12:15 | 2018-05-15T10:12:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,232 | java | package test;
import java.awt.Color;
import java.util.ArrayList;
import java.util.Random;
import javax.swing.JPanel;
public class WorkThread extends Thread{
private int x,y,r,g,b,size;
private JPanel jp = null;
private ArrayList<Ball> list = null;
private Background background = null;
public int state;
public static final int over = 1;
public WorkThread(JPanel jp,ArrayList<Ball> list,Background background) {
this.jp = jp;
this.list = list;
this.background = background;
}
public void run(){
while(true){
if(state==over){
break;
}
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Random rand = new Random();
size = rand.nextInt(50)+15;
x = rand.nextInt(jp.getWidth()-size);
y = rand.nextInt(jp.getHeight()-size);
r = rand.nextInt(256);
g = rand.nextInt(256);
b = rand.nextInt(256);
Ball ball = new Ball(x,y,size,new Color(r, g, b),2,jp,background);
ball.setList(list);
list.add(ball);
for(int i=0;i<list.size();i++){
if(list.get(i).getFlag()==0){
state = over;
list.clear();
}
}
}
}
}
| [
"noreply@github.com"
] | BelloCiao.noreply@github.com |
30ca11c4363ba58c4c8e29316f0b6054f6462383 | 5b412ffbb48a5253565a28e6b39e0ccdcfe4d7c0 | /PsrProductivity/bom/ru/magnat/sfs/bom/ref/business/RefBusinessEntity.java | 724890e602297b2ed4f3620c10d6ec4567bf8d34 | [] | no_license | protreptic/PsrProductivity | 27173b8fed5b9784b4d25129960019d5dffd1d38 | 796f084b0b253aadd00c15ab6eec686ba51ea1a3 | refs/heads/master | 2016-09-11T02:59:32.568188 | 2014-04-29T11:50:39 | 2014-04-29T11:50:39 | 18,830,534 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 257 | java | package ru.magnat.sfs.bom.ref.business;
import ru.magnat.sfs.bom.OrmEntityOwner;
import ru.magnat.sfs.bom.ref.generic.RefGenericEntity;
@OrmEntityOwner(owner = RefBusiness.class)
public final class RefBusinessEntity extends RefGenericEntity {
}
| [
"bukhal.ps@gmail.com"
] | bukhal.ps@gmail.com |
c1b7d597b2875fbca89cd9a7163c781a50307e49 | 536656cd89e4fa3a92b5dcab28657d60d1d244bd | /chrome/android/javatests/src/org/chromium/chrome/browser/video/VideoTest.java | fb11094db4c794515fa5580d6a8736d88b195ad2 | [
"BSD-3-Clause"
] | permissive | ECS-251-W2020/chromium | 79caebf50443f297557d9510620bf8d44a68399a | ac814e85cb870a6b569e184c7a60a70ff3cb19f9 | refs/heads/master | 2022-08-19T17:42:46.887573 | 2020-03-18T06:08:44 | 2020-03-18T06:08:44 | 248,141,336 | 7 | 8 | BSD-3-Clause | 2022-07-06T20:32:48 | 2020-03-18T04:52:18 | null | UTF-8 | Java | false | false | 2,793 | java | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.video;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.LargeTest;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.DisableIf;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.RetryOnFailure;
import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.test.ChromeActivityTestRule;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.util.browser.TabTitleObserver;
import org.chromium.content_public.browser.test.util.DOMUtils;
import org.chromium.net.test.EmbeddedTestServer;
import java.util.concurrent.TimeoutException;
/**
* Simple tests of html5 video.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
public class VideoTest {
@Rule
public ChromeActivityTestRule<ChromeActivity> mActivityTestRule =
new ChromeActivityTestRule<>(ChromeActivity.class);
@Test
@DisableIf.Build(sdk_is_less_than = 19, message = "crbug.com/582067")
@Feature({"Media", "Media-Video", "Main"})
@LargeTest
@RetryOnFailure
public void testLoadMediaUrl() throws TimeoutException {
EmbeddedTestServer testServer =
EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
try {
Tab tab = mActivityTestRule.getActivity().getActivityTab();
TabTitleObserver titleObserver = new TabTitleObserver(tab, "ready_to_play");
mActivityTestRule.loadUrl(
testServer.getURL("/chrome/test/data/android/media/video-play.html"));
titleObserver.waitForTitleUpdate(5);
Assert.assertEquals("ready_to_play", tab.getTitle());
titleObserver = new TabTitleObserver(tab, "ended");
DOMUtils.clickNode(tab.getWebContents(), "button1");
// Now the video will play for 5 secs.
// Makes sure that the video ends and title was changed.
titleObserver.waitForTitleUpdate(15);
Assert.assertEquals("ended", tab.getTitle());
} finally {
testServer.stopAndDestroyServer();
}
}
@Before
public void setUp() throws InterruptedException {
mActivityTestRule.startMainActivityOnBlankPage();
}
}
| [
"pcding@ucdavis.edu"
] | pcding@ucdavis.edu |
2acac4d6c9850f5696400c702fcbb2d30160e649 | b9b99813fa2306660b69e1d111804021e105354a | /Power of a number using functions/Main.java | 192a35b5ace60c6553950d336ead03a49d4d6f98 | [] | no_license | amaldev1014/Playground | 9a06abb869cbedd82e9293269ae32a18f0a25bf2 | cb1fbc0155ac3278d31f0b4f27fecdde9f8ea28a | refs/heads/master | 2020-04-14T09:30:51.880931 | 2019-08-05T17:10:23 | 2019-08-05T17:10:23 | 163,761,783 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 429 | java | import java.util.Scanner;
class Main
{
public static void main(String args[])
{
Scanner scan = new Scanner(System.in);
int base = scan.nextInt();
int exponent = scan.nextInt();
int power = power (base,exponent);
System.out.println(power);
}
public static int power(int base, int exponent)
{
int m=base;
for(int i=1;i<exponent;i++)
{
base=base*m;
}
return base;
}
} | [
"30900434+amaldev1014@users.noreply.github.com"
] | 30900434+amaldev1014@users.noreply.github.com |
b4ca0434564c7f62d8876ff57cc9d21184397b17 | 1c24f15f26461d5b114a04f330294821a38405f3 | /src/main/java/com/config/MainConfig.java | 94d2f57a610b0afff3fce07b15211191853c4c1c | [] | no_license | zhoukaixuan123/spring | 99effeef98bbf116038afb4fce305d9b057c8bfd | 29d29ded9bc4f4be46f6677c12499d259b5ebc5e | refs/heads/master | 2021-07-11T10:44:15.352897 | 2019-09-12T06:25:09 | 2019-09-12T06:25:09 | 207,329,760 | 0 | 0 | null | 2020-10-13T15:55:19 | 2019-09-09T14:32:15 | Java | UTF-8 | Java | false | false | 1,087 | java | package com.config;
import com.bean.Preson;
import com.controller.BookController;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.stereotype.Controller;
/**
* 功能描述
*
* @author zhoukx
* @date 2019/9/9$
* @description 配置类
*/
//@ComponentScan(value = "com") 指定要扫描的包
@Configuration //告诉spring这是个配置类
//@ComponentScan(value = "com",excludeFilters = {
// @ComponentScan.Filter(type = FilterType.ANNOTATION,classes = {Controller.class})
//}) //根据注解类型 排除一个对象
@ComponentScan(value = "com",includeFilters = {
@ComponentScan.Filter(type = FilterType.ANNOTATION,classes = {Controller.class})
},useDefaultFilters = false)
public class MainConfig {
//给容器中注册一个bean preson类
@Bean(value = "person")
public Preson preson01(){
return new Preson("白雪","25");
}
}
| [
"15030610683@163.com"
] | 15030610683@163.com |
ecec13eaa586b8164e3f4c160ef4868d89623983 | d85b90c1135484319c8870b1a790831302a6d3e0 | /app/src/test/java/com/krinotech/tourguideapp/ExampleUnitTest.java | 5289f56ea2b55de8f6db121f04c99d8af665ce0a | [] | no_license | Philosopho/Tour-Guide-App | 9c606878a996988e3dba4a45b9f52403ddd767e4 | 9f29269975d60a6b6e17f5083c5a68f42f3ebffe | refs/heads/master | 2022-07-05T16:46:22.627352 | 2020-05-20T12:57:12 | 2020-05-20T12:57:12 | 265,265,381 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 387 | java | package com.krinotech.tourguideapp;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"alex.lapeiretta@gmail.com"
] | alex.lapeiretta@gmail.com |
9e5d9812a3fe7186e818445a51c6685e24f49242 | d320d01276642370017b4ce56793b5f73e0016f9 | /high school (java)/11th grade/BankAccount.java | b4e4b5eac3dac9d8f2e492fadb75180d4326a1bd | [] | no_license | samiazam00/my-work | 388d815ddc7e47860375959ba31be2530be7f11e | e9a8218b2441dce00bf117d3d985d00e6ee14ec0 | refs/heads/master | 2020-12-21T02:34:36.248768 | 2020-01-29T03:28:43 | 2020-01-29T03:28:43 | 236,280,156 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 426 | java | /* Azam, Samreen
* Period 6 SL
* 10/12/16
* Pledge: Samreen Azam */
public class BankAccount
{
double balance;
String name;
double money;
public BankAccount(double b, String n)
{
balance = b;
name = n;
}
public void deposit(double money)
{
balance = balance + money;
}
public void withdraw(double money)
{
balance -= money;
}
}
| [
"noreply@github.com"
] | samiazam00.noreply@github.com |
18b69fe8c5e93e4055036072b0ef1824f1e9380f | 03deb53b2a3b640dee50be788eb540b02a28e465 | /src/main/java/org/example/extractpublisher/entities/JwtMessage.java | c307ec6f795749759a4bf0bc86716791baac613f | [
"Apache-2.0"
] | permissive | kjfallon/data-extract-job-scheduler | 7681f77dfb25c3487b0c55df9779f73dbfe1dc97 | 0f2e4f6b191327daa6fee46e93ce6c8b1ab31fed | refs/heads/master | 2020-07-20T10:04:33.987658 | 2019-09-11T15:45:33 | 2019-09-11T15:45:33 | 206,621,872 | 0 | 0 | Apache-2.0 | 2019-10-30T03:50:28 | 2019-09-05T17:35:05 | Java | UTF-8 | Java | false | false | 993 | java | package org.example.extractpublisher.entities;
import com.nimbusds.jose.JWSAlgorithm;
import com.nimbusds.jose.JWSHeader;
import com.nimbusds.jwt.JWTClaimsSet;
import com.nimbusds.jwt.SignedJWT;
import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Data
public class JwtMessage {
SignedJWT signedJWT = null;
JWSHeader header = null;
JWTClaimsSet claims = null;
private String jws = "";
private Boolean signatureValid = false;
private String signingKeyAlias = "";
// standard header values
private JWSAlgorithm algorithm = null;
private String keyId = "";
// standard claim values
private String issuer = "";
private String subject = "";
private List<String> audience = new ArrayList<String>();
private Date expiration = null;
private Date notBefore = null;
private Date issuedAt = null;
private String id = null;
// custom claim values
private String command = "";
}
| [
"kjfallon@syr.edu"
] | kjfallon@syr.edu |
3926a9827336b3c35751cead7599a5635a086136 | 402bd7c848bd8f8a20627bc3c24217d0be8f7429 | /telegram-bot/src/main/java/com/travel/component/TravelTelegramBot.java | 4b13669005b526bc91c3fec9b46b5c46baeddd9a | [] | no_license | VasterLort/TelegramBot | 31dcbb2a2578adb7856e946e04c41825c02ffb2d | e55c261cf6513f962c92c79f02e79ac2a030455e | refs/heads/master | 2023-01-03T18:53:20.127279 | 2020-11-05T11:46:21 | 2020-11-05T11:46:21 | 280,316,956 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,862 | java | package com.travel.component;
import com.travel.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.telegram.telegrambots.bots.TelegramLongPollingBot;
import org.telegram.telegrambots.meta.api.methods.send.SendMessage;
import org.telegram.telegrambots.meta.api.objects.Update;
import org.telegram.telegrambots.meta.exceptions.TelegramApiException;
@Component
@ConfigurationProperties(prefix = "telegrambot")
public class TravelTelegramBot extends TelegramLongPollingBot {
private String botUserName;
private String botToken;
@Autowired
private CityService cityService;
public void onUpdateReceived(Update update) {
if (update.hasMessage() && update.getMessage().hasText()) {
final long chat_id = update.getMessage().getChatId();
String cityName = update.getMessage().getText();
String cityInfo = cityService.getCityInfo(cityName);
sendTextMessage(chat_id, cityName + ": " + cityInfo);
}
}
public void setBotUserName(String botUserName) {
this.botUserName = botUserName;
}
public void setBotToken(String botToken) {
this.botToken = botToken;
}
public String getBotUsername() {
return botUserName;
}
public String getBotToken() {
return botToken;
}
private synchronized void sendTextMessage(long chat_id, String message) {
SendMessage sendMessage = new SendMessage();
sendMessage.enableMarkdown(false)
.setChatId(chat_id)
.setText(message);
try {
execute(sendMessage);
} catch (TelegramApiException e) {
e.printStackTrace();
}
}
}
| [
"mr.vakar2016@gmail.com"
] | mr.vakar2016@gmail.com |
1cbfd3d2b574fe149b4ac7ef2f0aed4620cc397d | 9254e7279570ac8ef687c416a79bb472146e9b35 | /sofa-20190815/src/main/java/com/aliyun/sofa20190815/models/CheckLinkeBahamutNextstageResponseBody.java | 61a0d367b9f79a2c1d134b45fa35da1035f68a10 | [
"Apache-2.0"
] | permissive | lquterqtd/alibabacloud-java-sdk | 3eaa17276dd28004dae6f87e763e13eb90c30032 | 3e5dca8c36398469e10cdaaa34c314ae0bb640b4 | refs/heads/master | 2023-08-12T13:56:26.379027 | 2021-10-19T07:22:15 | 2021-10-19T07:22:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,322 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sofa20190815.models;
import com.aliyun.tea.*;
public class CheckLinkeBahamutNextstageResponseBody extends TeaModel {
@NameInMap("RequestId")
public String requestId;
@NameInMap("Message")
public String message;
@NameInMap("ErrorMessage")
public String errorMessage;
@NameInMap("ResultMessage")
public String resultMessage;
@NameInMap("Success")
public Boolean success;
@NameInMap("ResultCode")
public String resultCode;
@NameInMap("Result")
public CheckLinkeBahamutNextstageResponseBodyResult result;
public static CheckLinkeBahamutNextstageResponseBody build(java.util.Map<String, ?> map) throws Exception {
CheckLinkeBahamutNextstageResponseBody self = new CheckLinkeBahamutNextstageResponseBody();
return TeaModel.build(map, self);
}
public CheckLinkeBahamutNextstageResponseBody setRequestId(String requestId) {
this.requestId = requestId;
return this;
}
public String getRequestId() {
return this.requestId;
}
public CheckLinkeBahamutNextstageResponseBody setMessage(String message) {
this.message = message;
return this;
}
public String getMessage() {
return this.message;
}
public CheckLinkeBahamutNextstageResponseBody setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
return this;
}
public String getErrorMessage() {
return this.errorMessage;
}
public CheckLinkeBahamutNextstageResponseBody setResultMessage(String resultMessage) {
this.resultMessage = resultMessage;
return this;
}
public String getResultMessage() {
return this.resultMessage;
}
public CheckLinkeBahamutNextstageResponseBody setSuccess(Boolean success) {
this.success = success;
return this;
}
public Boolean getSuccess() {
return this.success;
}
public CheckLinkeBahamutNextstageResponseBody setResultCode(String resultCode) {
this.resultCode = resultCode;
return this;
}
public String getResultCode() {
return this.resultCode;
}
public CheckLinkeBahamutNextstageResponseBody setResult(CheckLinkeBahamutNextstageResponseBodyResult result) {
this.result = result;
return this;
}
public CheckLinkeBahamutNextstageResponseBodyResult getResult() {
return this.result;
}
public static class CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultListCheckResults extends TeaModel {
@NameInMap("Type")
public String type;
@NameInMap("RuleKey")
public String ruleKey;
@NameInMap("Pass")
public Boolean pass;
@NameInMap("Solution")
public String solution;
@NameInMap("RuleName")
public String ruleName;
public static CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultListCheckResults build(java.util.Map<String, ?> map) throws Exception {
CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultListCheckResults self = new CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultListCheckResults();
return TeaModel.build(map, self);
}
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultListCheckResults setType(String type) {
this.type = type;
return this;
}
public String getType() {
return this.type;
}
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultListCheckResults setRuleKey(String ruleKey) {
this.ruleKey = ruleKey;
return this;
}
public String getRuleKey() {
return this.ruleKey;
}
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultListCheckResults setPass(Boolean pass) {
this.pass = pass;
return this;
}
public Boolean getPass() {
return this.pass;
}
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultListCheckResults setSolution(String solution) {
this.solution = solution;
return this;
}
public String getSolution() {
return this.solution;
}
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultListCheckResults setRuleName(String ruleName) {
this.ruleName = ruleName;
return this;
}
public String getRuleName() {
return this.ruleName;
}
}
public static class CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultList extends TeaModel {
@NameInMap("Pass")
public Boolean pass;
@NameInMap("Description")
public String description;
@NameInMap("CheckResults")
public java.util.List<CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultListCheckResults> checkResults;
@NameInMap("Name")
public String name;
public static CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultList build(java.util.Map<String, ?> map) throws Exception {
CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultList self = new CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultList();
return TeaModel.build(map, self);
}
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultList setPass(Boolean pass) {
this.pass = pass;
return this;
}
public Boolean getPass() {
return this.pass;
}
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultList setDescription(String description) {
this.description = description;
return this;
}
public String getDescription() {
return this.description;
}
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultList setCheckResults(java.util.List<CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultListCheckResults> checkResults) {
this.checkResults = checkResults;
return this;
}
public java.util.List<CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultListCheckResults> getCheckResults() {
return this.checkResults;
}
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultList setName(String name) {
this.name = name;
return this;
}
public String getName() {
return this.name;
}
}
public static class CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResult extends TeaModel {
@NameInMap("PassCount")
public Long passCount;
@NameInMap("FailCount")
public Long failCount;
@NameInMap("GuardCheckResultList")
public java.util.List<CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultList> guardCheckResultList;
@NameInMap("Total")
public Long total;
public static CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResult build(java.util.Map<String, ?> map) throws Exception {
CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResult self = new CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResult();
return TeaModel.build(map, self);
}
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResult setPassCount(Long passCount) {
this.passCount = passCount;
return this;
}
public Long getPassCount() {
return this.passCount;
}
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResult setFailCount(Long failCount) {
this.failCount = failCount;
return this;
}
public Long getFailCount() {
return this.failCount;
}
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResult setGuardCheckResultList(java.util.List<CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultList> guardCheckResultList) {
this.guardCheckResultList = guardCheckResultList;
return this;
}
public java.util.List<CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResultGuardCheckResultList> getGuardCheckResultList() {
return this.guardCheckResultList;
}
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResult setTotal(Long total) {
this.total = total;
return this;
}
public Long getTotal() {
return this.total;
}
}
public static class CheckLinkeBahamutNextstageResponseBodyResult extends TeaModel {
@NameInMap("BatchGuardCheckResult")
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResult batchGuardCheckResult;
@NameInMap("WarnContent")
public java.util.List<String> warnContent;
@NameInMap("Content")
public java.util.List<String> content;
@NameInMap("Passed")
public Boolean passed;
public static CheckLinkeBahamutNextstageResponseBodyResult build(java.util.Map<String, ?> map) throws Exception {
CheckLinkeBahamutNextstageResponseBodyResult self = new CheckLinkeBahamutNextstageResponseBodyResult();
return TeaModel.build(map, self);
}
public CheckLinkeBahamutNextstageResponseBodyResult setBatchGuardCheckResult(CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResult batchGuardCheckResult) {
this.batchGuardCheckResult = batchGuardCheckResult;
return this;
}
public CheckLinkeBahamutNextstageResponseBodyResultBatchGuardCheckResult getBatchGuardCheckResult() {
return this.batchGuardCheckResult;
}
public CheckLinkeBahamutNextstageResponseBodyResult setWarnContent(java.util.List<String> warnContent) {
this.warnContent = warnContent;
return this;
}
public java.util.List<String> getWarnContent() {
return this.warnContent;
}
public CheckLinkeBahamutNextstageResponseBodyResult setContent(java.util.List<String> content) {
this.content = content;
return this;
}
public java.util.List<String> getContent() {
return this.content;
}
public CheckLinkeBahamutNextstageResponseBodyResult setPassed(Boolean passed) {
this.passed = passed;
return this;
}
public Boolean getPassed() {
return this.passed;
}
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
0b615369d879f6298d3e99b5cd7202d72103438e | 6e9c7f1906c2c887776378964b6556dd5743194d | /src/main/java/factory/abstract_factory/model/veggies/BlackOlives.java | 3c04eb01e0e0ab80c94485c1dc960054426c60f6 | [] | no_license | devpuppet/design-patterns-practice | eb9e3eda8f3dfcd59c1c32803cd485afbf2ef163 | 07be2db7a2f32b2921c4b8e05177bc749cceeccc | refs/heads/master | 2022-10-20T12:44:18.738863 | 2019-11-28T20:16:57 | 2019-11-28T20:16:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 94 | java | package factory.abstract_factory.model.veggies;
public class BlackOlives extends Veggies {
}
| [
"qkiz288@gmail.com"
] | qkiz288@gmail.com |
6142a2310203aebd7f9351df62607b48ffe1c4b5 | 080d80b65c78086d63c4aaa71a250f9e5390e508 | /src/main/java/com/official/web/origin/mapper/sys/SysLogMapper.java | 46a5951e378c333211f912f14b1a13cff1d25579 | [] | no_license | haosenwei/officialwebmanager | 9c49ddabe2ba4ad2f99b7c7780f4f0ffd8f6d420 | dfad7e02f1837b28866815e09c651f34041a9ff0 | refs/heads/master | 2021-06-12T14:49:57.779612 | 2021-03-23T11:26:32 | 2021-03-23T11:26:32 | 162,822,215 | 0 | 0 | null | 2021-03-22T12:51:49 | 2018-12-22T15:31:27 | HTML | UTF-8 | Java | false | false | 1,516 | java | package com.official.web.origin.mapper.sys;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.official.web.origin.entity.sys.SysLog;
/**
* ,null数据库接口类
* @author hsw
*
*/
@Mapper
public interface SysLogMapper {
/**
* 根据id查询,null实体
* @param id
* @return
*/
public SysLog selectSysLogById(Long id);
/**
* 查询所有,null实体
* @return
*/
public List<SysLog> selectSysLogAll();
/**
* 插入,null实体
* @param sysLogForm
*/
public void insertSysLog(SysLog sysLogForm);
/**
* 更新,null实体
* @param sysLogForm
*/
public void updateSysLog(SysLog sysLogForm);
/**
* 根据条件更新,null实体
* @param condition
*/
public void updateSysLogByCondition(Map<String, Object> condition);
/**
* 删除,null实体
* @param ids
*/
public void delSysLogByIds(@Param("ids")String ids);
/**
* 根据条件查询,null实体
* @param map
* @return
*/
public List<SysLog> selectSysLogByCondition(Map<String, Object> map);
/**
* 分页查询,null实体
* @param map
* @return
*/
public List<SysLog> selectSysLogByPager(Map<String, Object> map);
/**
* 分页查询,null实体条数
* @param condition
* @return
*/
public int selectSysLogCountByPager(Map<String, Object> condition);
/**
* sql查询,null实体
* @param sql
* @return
*/
public List<SysLog> selectSysLogBySql(@Param("sql")String sql);
}
| [
"961970674@qq.com"
] | 961970674@qq.com |
9621501f2ead7cfcfbc1c01c1adffa09cee3b725 | f3ace548bf9fd40e8e69f55e084c8d13ad467c1c | /excuterWrong/SkipQueue/AOIU_46/PrioritySkipList.java | d5f0067197eac9215ab481c5d48521309190e5b2 | [] | no_license | phantomDai/concurrentProgramTesting | 307d008f3bba8cdcaf8289bdc10ddf5cabdb8a04 | 8ac37f73c0413adfb1ea72cb6a8f7201c55c88ac | refs/heads/master | 2021-05-06T21:18:13.238925 | 2017-12-06T11:10:01 | 2017-12-06T11:10:02 | 111,872,421 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,421 | java | package mutants.SkipQueue.AOIU_46;
// Author : ysma
import java.util.Iterator;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicMarkableReference;
public final class PrioritySkipList<T> implements java.lang.Iterable<T>
{
static final int MAX_LEVEL = 32;
static int randomSeed = (int) System.currentTimeMillis() | 0x0100;
final Node<T> head = new Node<T>( Integer.MIN_VALUE );
final Node<T> tail = new Node<T>( Integer.MAX_VALUE );
public PrioritySkipList()
{
for (int i = 0; i < head.next.length; i++) {
head.next[i] = new java.util.concurrent.atomic.AtomicMarkableReference<Node<T>>( tail, false );
}
}
private static int randomLevel()
{
return 0;
}
boolean add( PrioritySkipList.Node node )
{
int bottomLevel = 0;
Node<T>[] preds = (Node<T>[]) new PrioritySkipList.Node[MAX_LEVEL + 1];
Node<T>[] succs = (Node<T>[]) new PrioritySkipList.Node[MAX_LEVEL + 1];
while (true) {
boolean found = find( node, preds, succs );
if (found) {
return false;
} else {
for (int level = bottomLevel; level <= node.topLevel; level++) {
Node<T> succ = succs[level];
node.next[level].set( succ, false );
}
Node<T> pred = preds[bottomLevel];
Node<T> succ = succs[bottomLevel];
node.next[bottomLevel].set( succ, false );
if (!pred.next[bottomLevel].compareAndSet( succ, node, false, false )) {
continue;
}
for (int level = bottomLevel + 1; level <= node.topLevel; level++) {
while (true) {
pred = preds[level];
succ = succs[level];
if (pred.next[level].compareAndSet( succ, node, false, false )) {
break;
}
find( node, preds, succs );
}
}
return true;
}
}
}
boolean remove( Node<T> node )
{
int bottomLevel = 0;
Node<T>[] preds = (Node<T>[]) new PrioritySkipList.Node[MAX_LEVEL + 1];
Node<T>[] succs = (Node<T>[]) new PrioritySkipList.Node[MAX_LEVEL + 1];
Node<T> succ;
while (true) {
boolean found = find( node, preds, succs );
if (!found) {
return false;
} else {
for (int level = node.topLevel; level >= bottomLevel + 1; level--) {
boolean[] marked = { false };
succ = node.next[level].get( marked );
while (!marked[0]) {
node.next[level].attemptMark( succ, true );
succ = node.next[level].get( marked );
}
}
boolean[] marked = { false };
succ = node.next[bottomLevel].get( marked );
while (true) {
boolean iMarkedIt = node.next[bottomLevel].compareAndSet( succ, succ, false, true );
succ = succs[bottomLevel].next[bottomLevel].get( marked );
if (iMarkedIt) {
find( node, preds, succs );
return true;
} else {
if (marked[0]) {
return false;
}
}
}
}
}
}
public Node<T> findAndMarkMin()
{
Node<T> curr = null;
Node<T> succ = null;
curr = head.next[0].getReference();
while (curr != tail) {
if (!curr.marked.get()) {
if (curr.marked.compareAndSet( false, true )) {
return curr;
} else {
curr = curr.next[0].getReference();
}
}
}
return null;
}
boolean find( Node<T> node, Node<T>[] preds, Node<T>[] succs )
{
int bottomLevel = 0;
boolean[] marked = { false };
boolean snip;
Node<T> pred = null;
Node<T> curr = null;
Node<T> succ = null;
retry :
while (true) {
pred = head;
for (int level = MAX_LEVEL; level >= bottomLevel; level--) {
curr = pred.next[level].getReference();
while (true) {
succ = curr.next[level].get( marked );
while (marked[0]) {
snip = pred.next[level].compareAndSet( curr, succ, false, false );
if (!snip) {
continue retry;
}
curr = pred.next[level].getReference();
succ = curr.next[level].get( marked );
}
if (curr.priority < node.priority) {
pred = curr;
curr = succ;
} else {
break;
}
}
preds[level] = pred;
succs[level] = curr;
}
return curr.priority == node.priority;
}
}
public java.util.Iterator<T> iterator()
{
return new java.util.Iterator<T>(){
Node<T> cursor = head;
public boolean hasNext()
{
return cursor.next[0].getReference() != tail;
}
public T next()
{
cursor = cursor.next[0].getReference();
return cursor.item;
}
public void remove()
{
throw new java.lang.UnsupportedOperationException();
}
};
}
public static final class Node<T>
{
final T item;
final int priority;
java.util.concurrent.atomic.AtomicBoolean marked;
final java.util.concurrent.atomic.AtomicMarkableReference<Node<T>>[] next;
int topLevel;
public Node( int myPriority )
{
item = null;
priority = myPriority;
marked = new java.util.concurrent.atomic.AtomicBoolean( false );
next = (java.util.concurrent.atomic.AtomicMarkableReference<Node<T>>[]) new java.util.concurrent.atomic.AtomicMarkableReference[MAX_LEVEL + 1];
for (int i = 0; i < -next.length; i++) {
next[i] = new java.util.concurrent.atomic.AtomicMarkableReference<Node<T>>( null, false );
}
topLevel = MAX_LEVEL;
}
public Node( T x, int myPriority )
{
item = x;
priority = myPriority;
marked = new java.util.concurrent.atomic.AtomicBoolean( false );
int height = randomLevel();
next = (java.util.concurrent.atomic.AtomicMarkableReference<Node<T>>[]) new java.util.concurrent.atomic.AtomicMarkableReference[height + 1];
for (int i = 0; i < next.length; i++) {
next[i] = new java.util.concurrent.atomic.AtomicMarkableReference<Node<T>>( null, false );
}
topLevel = height;
}
}
}
| [
"zxmantou@163.com"
] | zxmantou@163.com |
d7916743a39028cb7df4274679eefa1f337cbb79 | 4ff3b7eccb0ee63eabafc791b703881ce99791fc | /src/reservation/command/user/UserDeleteCommand.java | dcd6c8a50ec9d25ade051d3fb07037431c08a399 | [
"MIT"
] | permissive | jsh15932/Movie-Reservation-System | 2474b96a8f4d9060d0440b8ef0b63af589fb84d3 | d3eadf0c25f1267095ea2854172b6fd5cbd22d91 | refs/heads/master | 2020-05-04T09:22:54.891736 | 2019-08-16T06:50:00 | 2019-08-16T06:50:00 | 179,066,757 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,477 | java | package reservation.command.user;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import reservation.dao.UserDAO;
import reservation.frontController.ActionForward;
import reservation.util.ModalUtil;
import reservatoin.command.Command;
public class UserDeleteCommand implements Command {
public ActionForward execute(HttpServletRequest request, HttpServletResponse response) {
boolean isRedirect = true;
String viewPage = "mainView.reservation";
HttpSession session = request.getSession();
String userID = null;
if(session.getAttribute("userID") != null) {
userID = (String) session.getAttribute("userID");
}
if(userID == null || userID.equals("")) {
session.setAttribute("modal", new ModalUtil("오류 메시지", "세션이 만료되었습니다.", ModalUtil.ERROR));
} else {
UserDAO userDAO = new UserDAO();
int result = userDAO.delete(userID);
if (result == 1) {
session.setAttribute("modal", new ModalUtil("오류 메시지", "회원탈퇴에 실패했습니다.", ModalUtil.ERROR));
} else {
session.removeAttribute("userID");
session.removeAttribute("userType");
session.setAttribute("modal", new ModalUtil("성공 메시지", "회원탈퇴에 성공했습니다.", ModalUtil.SUCCESS));
viewPage = "mainView.reservation";
}
}
return new ActionForward(isRedirect, viewPage);
}
}
| [
"jsh1400512@naver.com"
] | jsh1400512@naver.com |
a8dd33423e164b398a590f10a49daae342d1c038 | 936f1beed47cb591222090de907b993f94963a86 | /app/src/main/java/de/ur/mi/android/excercises/starter/AddObject.java | 16e2dc2d95ad8a59554c22a446976e551d0013de | [] | no_license | 96Sabiii/Cooking-Master | 603498a7277f5347cbce3f24b6425ee89032c2ac | 469a7a13fc88f9b8d5dec6f3d17b1382c13658da | refs/heads/master | 2021-03-16T20:53:34.953752 | 2020-03-12T22:38:33 | 2020-03-12T22:38:33 | 246,942,234 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,365 | java | package de.ur.mi.android.excercises.starter;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.text.TextUtils;
import android.util.Log;
import android.util.LruCache;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import de.ur.mi.android.excercises.starter.Constants.Constants;
import static android.provider.MediaStore.Files.FileColumns.MEDIA_TYPE_IMAGE;
import static de.ur.mi.android.excercises.starter.Constants.Constants.CANCLE;
import static de.ur.mi.android.excercises.starter.Constants.Constants.DATE_FORMAT;
import static de.ur.mi.android.excercises.starter.Constants.Constants.FILE_URI;
import static de.ur.mi.android.excercises.starter.Constants.Constants.FROM_GALLERY;
import static de.ur.mi.android.excercises.starter.Constants.Constants.GALLERY_REQUEST_CODE;
import static de.ur.mi.android.excercises.starter.Constants.Constants.IMAGE_DIRECTORY_NAME;
import static de.ur.mi.android.excercises.starter.Constants.Constants.KEY_DIRECTIONS;
import static de.ur.mi.android.excercises.starter.Constants.Constants.KEY_ID;
import static de.ur.mi.android.excercises.starter.Constants.Constants.KEY_IMAGE;
import static de.ur.mi.android.excercises.starter.Constants.Constants.KEY_INGREDIENTS;
import static de.ur.mi.android.excercises.starter.Constants.Constants.KEY_KATEGORY;
import static de.ur.mi.android.excercises.starter.Constants.Constants.KEY_RECEPT_NAME;
import static de.ur.mi.android.excercises.starter.Constants.Constants.MAX_IMAGE_SIZE;
import static de.ur.mi.android.excercises.starter.Constants.Constants.TAKE_PICTURE;
/**
* Created by Sabrina Hartl on 09.08.2017.
*/
public class AddObject extends Activity {
private EditText ingredients, directions, receptName;
private String newIngredientsText, newDirectionsText , newReceptNameText, newKategoryText;
private Spinner kategory;
private Bitmap bitmap;
private Uri fileUri;
private ImageView photo;
private long id;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_object);
setupViews();
setupButtons();
checkIntent();
}
//Menü bzw Button in ActionBar erstellen
public boolean onCreateOptionsMenu(Menu menu) {
//Actionbar Optionen erzeuegn
MenuInflater inflater = getMenuInflater();
//Menü für Unterseiten einbauen
inflater.inflate(R.menu.sub, menu);
return super.onCreateOptionsMenu(menu);
}
//Wenn ein Button im ActionBar ausgewählt wird
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// wenn der Button mit der id back_button ausgewählt wurde
case R.id.back_button:
//Methode starten, die einen zurück auf die Hauptseite bringt
backButtonClicked();
break;
default:
//Default Möglichkeit abfangen
Toast.makeText(getApplicationContext(), R.string.failedToast, Toast.LENGTH_SHORT).show();
break;
}
return true;
}
//onClick Listeners auf die drei Buttons
private void setupButtons() {
//Wenn der add_image button ausgewählt wird, wird die Methode selectImage gestartet
//Bei dieser Methode kann man dann ein Bild hochladen
Button addImageButton = (Button) findViewById(R.id.addImageButton);
addImageButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
selectImage();
}
});
//Wenn der save Button ausgewählt wird, wird die methode saveButtonClicked gestartet.
//Diese speichert die eingebenen Daten in einem Intent und geht zurück zur Hauptseite
Button saveButton = (Button) findViewById(R.id.save_button);
saveButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
saveButtonClicked();
}
});
}
//Views erstellen
private void setupViews() {
ingredients = (EditText) findViewById(R.id.enterIngredients);
directions = (EditText) findViewById(R.id.enterDirections);
receptName = (EditText) findViewById(R.id.receptName);
kategory = (Spinner) findViewById(R.id.kategory_spinner);
photo = (ImageView) findViewById(R.id.photoView);
}
//zurück auf die ListPage springen wenn der back button geklickt ist
private void backButtonClicked() {
Intent backIntent = new Intent(AddObject.this, ListPage.class);
startActivity(backIntent);
finish();
}
//Methode um die Zurücktaste des Smartphones benutzten zu können
@Override
public void onBackPressed() {
super.onBackPressed();
backButtonClicked();
}
//Überprüfen ob ein Intent mit den Daten für ein neues Rezept übergeben wird,
//also wenn ein Rezept zum Bearbeiten geöffnet wird
private boolean checkIntent() {
Intent i = getIntent();
//Wenn der Intent ein Extra mit dem Wert KEY_RECEPT_NAME hat:
if (i.hasExtra(KEY_RECEPT_NAME)){
//Vorhandene Daten holen und in Views anzeigen
getExtras(i);
return true;
}
else return false;
}
//Daten aus Intent auslesen und in die passenden Views setzen
private void getExtras(Intent i) {
receptName.setText(i.getExtras().getString(KEY_RECEPT_NAME));
kategory.setSelection(getSpinnerIndex(kategory, i.getExtras().getString(KEY_KATEGORY)));
ingredients.setText(i.getExtras().getString(KEY_INGREDIENTS));
directions.setText(i.getExtras().getString(KEY_DIRECTIONS));
byte[] imageByteArray = i.getByteArrayExtra(KEY_IMAGE);
//Array in Bitmap umwandeln
bitmap = BitmapFactory.decodeByteArray(imageByteArray, 0, imageByteArray.length);
photo.setImageBitmap(bitmap);
id = i.getLongExtra(Constants.KEY_ID, 0);
}
//Methode zum Herausfinden, welchen Index der übergebene String im Spinner ist
private int getSpinnerIndex(Spinner spinner, String myString) {
int index = 0;
//alle Möglichkeiten durchegehen und String mit den Texten aus dem Spinner vergelichen
for (int i=0;i<spinner.getCount();i++){
if (spinner.getItemAtPosition(i).toString().equalsIgnoreCase(myString)){
index = i;
break;
}
}
//gefundenen Index zurück geben
return index;
}
//Eingabedaten speichern wenn der speichern-Button geklickt wird
private void saveButtonClicked() {
//Daten aus den Views auslesen
getEntries();
//In Intent übergeben
if(ingredients != null && ! TextUtils.isEmpty(newIngredientsText.trim()) &&
directions != null && ! TextUtils.isEmpty(newDirectionsText.trim()) &&
receptName != null && ! TextUtils.isEmpty(newReceptNameText.trim())) {
backAndSaveIntent();
//wenn kein Input oder nicht alle Daten angegeben:
}else{
//Toast mit Hinweis ausgeben
Toast toast = Toast.makeText(this, R.string.noEntryToast, Toast.LENGTH_SHORT);
toast.show();
}
}
//auslagern?
private void backAndSaveIntent() {
//Intent erstellen, der wieder die Hauptseite öffnet
Intent backAndSaveIntent = new Intent(AddObject.this, ListPage.class);
//Darin alle eingegebenen Daten übergeben
putExtras(backAndSaveIntent);
//Eingaben zurücketzen
resetViews();
startActivity(backAndSaveIntent);
finish();
}
//Rezeptdaten an den Intent übergeben
private void putExtras(Intent i) {
i.putExtra(KEY_DIRECTIONS, newDirectionsText);
i.putExtra(KEY_INGREDIENTS, newIngredientsText);
i.putExtra(KEY_RECEPT_NAME, newReceptNameText);
i.putExtra(KEY_KATEGORY, newKategoryText);
i.putExtra(KEY_ID, id);
//wenn Bild gemacht wurde, das übergeben, wenn nicht: Platzhalterbild
Bitmap img_Bitmap;
if (bitmap!=null){img_Bitmap = bitmap;}
else {img_Bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.turkey);}
i.putExtra(KEY_IMAGE, getBytes(img_Bitmap));
}
//zurücksetzten der Views
private void resetViews() {
directions.setText("");
ingredients.setText("");
receptName.setText("");
//photo.setImageResource(android.R.color.transparent);
}
// konvertieren von bitmap zu byteArray
public static byte[] getBytes(Bitmap bitmap) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 0, stream);
return stream.toByteArray();
}
//Input der Eingabefelder abfragen, in Strings umwandeln und in Variablen speichern
public void getEntries() {
newIngredientsText = ingredients.getText().toString();
newDirectionsText = directions.getText().toString();
newReceptNameText = receptName.getText().toString();
newKategoryText = kategory.getSelectedItem().toString();
}
//Dialog der fragt ob Bild aufnehmen oder aus Galerie nehmen
private void selectImage() {
//Antwortmöglichkeiten erstellen
final CharSequence[] items = { TAKE_PICTURE, FROM_GALLERY, CANCLE};
//Alert erstellen
AlertDialog.Builder builder = new AlertDialog.Builder(AddObject.this);
LayoutInflater inflater = this.getLayoutInflater();
/*
//eigenes Layout laden und anzeigen -> Fehler
View content = inflater.inflate(R.layout.alert_dialog, null);
builder.setView(content); //statt setView
//Text setzen
((TextView) content.findViewById(R.id.dialogTitle)).setText(R.string.addPictureTitle);
*/
builder.setTitle(R.string.addPictureTitle);
//Aktionen bei den Antwortmöglichkeiten festlegen
builder.setItems(items, new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int item) {
//Was soll passieren, wenn man ein Foto aufnehmen will
if (items[item].equals(TAKE_PICTURE)) {
captureImage();
//Was soll passieren, wenn man ein Foto aus der Galerie wählen will
} else if (items[item].equals(FROM_GALLERY)) {
chooseFromGallery();
//Was soll passieren, wenn man den Dialog abbrechen will
} else if (items[item].equals(CANCLE)) {
dialog.dismiss();
}
}
});
//alert anzeigen
builder.show();
}
//Bild aus Galerie wählen
private void chooseFromGallery() {
//Intent der die Galerie App startet
Intent pickPhoto = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
//Foto an Intent anhängen
pickPhoto.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
//starten des Intents
startActivityForResult(pickPhoto , GALLERY_REQUEST_CODE);
}
//Foto mit Kamera aufnehmen
private void captureImage() {
//Intent der die Kamera startet
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
//Foto an Intent anhängen
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
// starten des Intents
startActivityForResult(intent, Constants.CAMERA_REQUEST_CODE);
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putParcelable(FILE_URI, fileUri);
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
fileUri = savedInstanceState.getParcelable(FILE_URI);
}
//Abfragen ob Ergebnisse ok und die passende Funktion auslösen
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//Prüfen ob die Daten ok sind
if (resultCode == RESULT_OK) {
//Wenn mit der Kamera aufgenommen folgende Funktion auslösen
if (requestCode == Constants.CAMERA_REQUEST_CODE) {
previewCapturedImage();
//Wenn Foto aus Galerie gewählt folgende Funktion auslösen
} else if (requestCode == GALLERY_REQUEST_CODE) {
previewGalleryImage(data);
}
//Wenn Kameraaufnahme abgebrochen wird Toast auslösen
} else if (resultCode == RESULT_CANCELED) {
Toast.makeText(getApplicationContext(), R.string.cameraCanceltToast, Toast.LENGTH_SHORT).show();
//Wenn ein Fehler passiert Toast auslösen
} else {
Toast.makeText(getApplicationContext(), R.string.failedToast, Toast.LENGTH_SHORT).show();
}
}
//foto aufnehmen und in der Preview anzeigen lassen
private void previewCapturedImage() {
try {
BitmapFactory.Options options = new BitmapFactory.Options();
//Bitmap aus dem pfad laden
bitmap = BitmapFactory.decodeFile(fileUri.getPath(), options);
//Größe anpassen
bitmap = getResizedBitmap(bitmap, MAX_IMAGE_SIZE);
//Im Imageview anzeigen lassen
photo.setImageBitmap(bitmap);
} catch (NullPointerException e) {
e.printStackTrace();
}
}
//Datei aus Galerie wählen und in Preview anzeige
private void previewGalleryImage(Intent data) {
try{
// pickedImage data lesen
Uri pickedImage = data.getData();
String[] filePath = { MediaStore.Images.Media.DATA };
Cursor cursor = getContentResolver().query(pickedImage, filePath, null, null, null);
cursor.moveToFirst();
String imagePath = cursor.getString(cursor.getColumnIndex(filePath[0]));
//Bild aus Pfad laden
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
bitmap = BitmapFactory.decodeFile(imagePath, options);
//Größe verkleinern
bitmap = getResizedBitmap(bitmap, MAX_IMAGE_SIZE);
//Foto in ImageView setzen
photo.setImageBitmap(bitmap);
// Cursor schließen
cursor.close();
} catch (NullPointerException e) {
e.printStackTrace();
}
}
public Uri getOutputMediaFileUri(int type) {
return Uri.fromFile(getOutputMediaFile(type));
}
private static File getOutputMediaFile(int type) {
File mediaStorageDir = new File(
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), IMAGE_DIRECTORY_NAME);
// Speicherort erstellen
if (!mediaStorageDir.exists()) {
if (!mediaStorageDir.mkdirs()) {
Log.d(IMAGE_DIRECTORY_NAME, "Oops! Failed create " + IMAGE_DIRECTORY_NAME + " directory");
return null;
}
}
// Dateiname erstellen
String timeStamp = new SimpleDateFormat(DATE_FORMAT, Locale.getDefault()).format(new Date());
File mediaFile;
if (type == MEDIA_TYPE_IMAGE) {
mediaFile = new File(mediaStorageDir.getPath() + File.separator + "IMG_" + timeStamp + ".jpg");
} else {
return null;
}
return mediaFile;
}
//verkleinert das Bild, sodass die maximale größe der intent mitzugebenden Daten nicht überschritten wird
public Bitmap getResizedBitmap(Bitmap image, int maxSize) {
//Größe des Bildes abfragen
int width = image.getWidth();
int height = image.getHeight();
//Größe des Bildes anpassen
float bitmapRatio = (float)width / (float) height;
if (bitmapRatio > 1) {
width = maxSize;
height = (int) (width / bitmapRatio);
} else {
height = maxSize;
width = (int) (height * bitmapRatio);
}
return Bitmap.createScaledBitmap(image, width, height, true);
}
}
| [
"30804260+96Sabiii@users.noreply.github.com"
] | 30804260+96Sabiii@users.noreply.github.com |
22c0f612234dd6f6a82125f3fdf105a7c4ee3841 | e94ce9b3f50fc8c550f4eb3775d22593c9283e0a | /android_project0127/app/src/main/java/com/study/pageapp/fragment/RedFragment.java | 8c84590b9b235bdfc037f45c76b2ac4a686d234e | [] | no_license | gudbrwkd98/android_projects | da9ebe13223f96fba45b2ec9e8b1e08a191a48eb | 5347ec3253432e1a1a70dc0fb16246f7050ccfd1 | refs/heads/master | 2023-03-27T05:21:15.979069 | 2021-03-25T19:24:45 | 2021-03-25T19:24:45 | 351,550,518 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,233 | java | package com.study.pageapp.fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.study.pageapp.R;
//하나의 화면 일부를 담당하는 Fragment 는 일명 작은 액티비티라고도 불린다
//따라서 액티비티에 생명주기 메서드가 있듯 Fragment 또한 생명주기 메서드가 지원된다..
public class RedFragment extends Fragment {
//초기화 메서드
//프레그먼트가 사용할 디자인 레이아웃 xml
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//매개변수로 넘겨받은 인플레이터를 이용하여 xml 인플레이션 하자 !!
//false 로 지정해야 인프레이션 된 xml 의 최상위 뷰그룹이 ㅂ반환된다..
//ture 로 지정할시 인플레이셔된 xml 의 최상위 뷰보다 더 바깥쪽 뷰가 반환된다.
View view = inflater.inflate(R.layout.fragment_red,container,false);
return view;
}
}
| [
"gudrbwkd98@gmail.com"
] | gudrbwkd98@gmail.com |
006470c5ff5b9029514ccf71cef761216864bc6a | 4492ba1af5a2e1f8bb3f8a4b62cce1afb1f8b015 | /gmall-mbg/src/main/java/com/mkl/gmall/pms/service/AlbumService.java | 1ece6c0794f48889536d48a5487a4470c21ec98a | [] | no_license | mklxiaobai/gmallparent | 035ea8c4c57d9c4f533324b78896fc7b356b41b8 | 816042347bad8b09ab6d3d67c18c35694bf56898 | refs/heads/dev | 2022-06-29T02:59:01.774400 | 2019-12-15T13:36:40 | 2019-12-15T13:36:40 | 224,579,198 | 2 | 0 | null | 2022-06-21T02:26:49 | 2019-11-28T05:49:24 | Java | UTF-8 | Java | false | false | 280 | java | package com.mkl.gmall.pms.service;
import com.mkl.gmall.pms.entity.Album;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 相册表 服务类
* </p>
*
* @author mkl
* @since 2019-12-01
*/
public interface AlbumService extends IService<Album> {
}
| [
"727448352@qq.com"
] | 727448352@qq.com |
1f4cf8f5a518c1b87a3f11cf3896d6a6c8cff996 | 8eeca7aa9f558d575e7db306bd708302c61ccc79 | /RecylerViewDemo/app/src/main/java/hu/ait/recylerviewdemo/touch/TodoItemTouchHelperCallback.java | 9f18f9c3c987b01ef74fe00a4f7bcead090d578d | [] | no_license | Cai-Glencross/AndroidProjects | eff918e364c4fc01a5c28ff7a5226720aaa3a0d8 | 70cd7c6abe133143b6ba2885f295f094d90be918 | refs/heads/master | 2022-03-12T21:33:53.433610 | 2017-04-09T12:57:45 | 2017-04-09T12:57:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,481 | java | package hu.ait.recylerviewdemo.touch;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;
public class TodoItemTouchHelperCallback extends
ItemTouchHelper.Callback {
private TodoTouchHelperAdapter todoTouchHelperAdapter;
public TodoItemTouchHelperCallback(TodoTouchHelperAdapter todoTouchHelperAdapter) {
this.todoTouchHelperAdapter = todoTouchHelperAdapter;
}
@Override
public boolean isLongPressDragEnabled() {
return true;
}
@Override
public boolean isItemViewSwipeEnabled() {
return true;
}
@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END;
return makeMovementFlags(dragFlags, swipeFlags);
}
@Override
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder,
RecyclerView.ViewHolder target) {
todoTouchHelperAdapter.onItemMove(viewHolder.getAdapterPosition(),
target.getAdapterPosition()
);
return true;
}
@Override
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
todoTouchHelperAdapter.onItemDismiss(viewHolder.getAdapterPosition());
}
}
| [
"cai.glencross@pomona.edu"
] | cai.glencross@pomona.edu |
252e73c58efa698fc4a1ffe3bc64b0451b2263de | 277a8827394d99e5bd499bc197e49245f98d2ff2 | /app/src/test/java/com/example/ashish/thebookstore/ExampleUnitTest.java | feb48cbdcb5492045a8eea9fd5f6b38a2e75f35b | [] | no_license | itsashishpatel/TheBookStore | beebf5fc5994d8527f202ab79e35518d28eeafea | b22bdb067195409d50ebb5cfc6c15c1736a055be | refs/heads/master | 2020-04-24T16:31:30.653232 | 2019-02-22T18:37:08 | 2019-02-22T18:37:08 | 172,110,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 409 | java | package com.example.ashish.thebookstore;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"31264223+itsashishpatel@users.noreply.github.com"
] | 31264223+itsashishpatel@users.noreply.github.com |
20b3ef1592968d365af7682b6a3ea8800c8ffd58 | f97d6643da2e5fd7762cac83bff6f6f6615b6a15 | /src/main/java/com/schantz/remotecq/client/PersonHealthRegistrationQueryResult.java | 7f5b2a4e279b08c63487596b2cf71f95f0f278f0 | [] | no_license | roo104/dls-middleware | 51229bca28e12cb98fd849d2389c7c8a47973caf | 14158ac6dc849b6c6a2cbfb39aef7d4f99960ed8 | refs/heads/master | 2021-05-01T05:12:40.195450 | 2017-02-09T08:55:22 | 2017-02-09T08:55:22 | 79,714,673 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,336 | java | package com.schantz.remotecq.client;
import java.io.*;
import java.util.*;
import com.fasterxml.jackson.annotation.*;
public class PersonHealthRegistrationQueryResult implements Serializable {
@JsonProperty("preparedLocks")
private List<CqLock> preparedLocks = new ArrayList<CqLock>();
@JsonProperty("personHealthDataCqCollection")
private List<PersonHealthDataCq> personHealthDataCqCollection = new ArrayList<PersonHealthDataCq>();
public PersonHealthRegistrationQueryResult addPreparedLocksItem(CqLock preparedLocksItem) {
this.preparedLocks.add(preparedLocksItem);
return this;
}
public List<CqLock> getPreparedLocks() {
return preparedLocks;
}
public void setPreparedLocks(List<CqLock> preparedLocks) {
this.preparedLocks = preparedLocks;
}
public PersonHealthRegistrationQueryResult addPersonHealthDataCqCollectionItem(PersonHealthDataCq personHealthDataCqCollectionItem) {
this.personHealthDataCqCollection.add(personHealthDataCqCollectionItem);
return this;
}
public List<PersonHealthDataCq> getPersonHealthDataCqCollection() {
return personHealthDataCqCollection;
}
public void setPersonHealthDataCqCollection(List<PersonHealthDataCq> personHealthDataCqCollection) {
this.personHealthDataCqCollection = personHealthDataCqCollection;
}
}
| [
"jonasp@schantz.com"
] | jonasp@schantz.com |
b4758f2f67cd51a65ffef498a7da2490ed0ece38 | b111b77f2729c030ce78096ea2273691b9b63749 | /db-example-large-multi-project/project37/src/main/java/org/gradle/test/performance/mediumjavamultiproject/project37/p186/Production3738.java | 484820e5882c44b619ac81f726b60ac6162b1f41 | [] | no_license | WeilerWebServices/Gradle | a1a55bdb0dd39240787adf9241289e52f593ccc1 | 6ab6192439f891256a10d9b60f3073cab110b2be | refs/heads/master | 2023-01-19T16:48:09.415529 | 2020-11-28T13:28:40 | 2020-11-28T13:28:40 | 256,249,773 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,308 | java | package org.gradle.test.performance.mediumjavamultiproject.project37.p186;
import org.gradle.test.performance.mediumjavamultiproject.project34.p171.Production3438;
import org.gradle.test.performance.mediumjavamultiproject.project35.p176.Production3538;
import org.gradle.test.performance.mediumjavamultiproject.project36.p181.Production3638;
public class Production3738 {
private Production3729 property0;
public Production3729 getProperty0() {
return property0;
}
public void setProperty0(Production3729 value) {
property0 = value;
}
private Production3733 property1;
public Production3733 getProperty1() {
return property1;
}
public void setProperty1(Production3733 value) {
property1 = value;
}
private Production3737 property2;
public Production3737 getProperty2() {
return property2;
}
public void setProperty2(Production3737 value) {
property2 = value;
}
private Production3438 property3;
public Production3438 getProperty3() {
return property3;
}
public void setProperty3(Production3438 value) {
property3 = value;
}
private Production3538 property4;
public Production3538 getProperty4() {
return property4;
}
public void setProperty4(Production3538 value) {
property4 = value;
}
private Production3638 property5;
public Production3638 getProperty5() {
return property5;
}
public void setProperty5(Production3638 value) {
property5 = value;
}
private String property6;
public String getProperty6() {
return property6;
}
public void setProperty6(String value) {
property6 = value;
}
private String property7;
public String getProperty7() {
return property7;
}
public void setProperty7(String value) {
property7 = value;
}
private String property8;
public String getProperty8() {
return property8;
}
public void setProperty8(String value) {
property8 = value;
}
private String property9;
public String getProperty9() {
return property9;
}
public void setProperty9(String value) {
property9 = value;
}
} | [
"nateweiler84@gmail.com"
] | nateweiler84@gmail.com |
b6a10bcbe32b94e626f8f8101a3039d52d52fcc4 | a7822bb3c6a9fb04d94825b07b7019794a4d21f4 | /src/textfieldsample/TextFieldSample.java | a36aa8670d59bb9e29b30a400ea514726324fef6 | [] | no_license | ligeromiguel/Componentes_LigeroMiguel | b912a48c1fc5e7b04fcabc8f4295631645433350 | fceccb72130e7d20a14c02fc9676094a3f61cce8 | refs/heads/master | 2023-01-30T09:14:21.839952 | 2020-12-16T00:32:08 | 2020-12-16T00:32:08 | 267,716,842 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,966 | java | /*
* Copyright (c) 2012, 2014, Oracle and/or its affiliates.
* All rights reserved. Use is subject to license terms.
*
* This file is available and licensed under the following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the distribution.
* - Neither the name of Oracle nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package textfieldsample;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.event.ActionEvent;
import javafx.geometry.Insets;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
public class TextFieldSample extends Application {
final static Label label = new Label();
@Override
public void start(Stage stage) {
Group root = new Group();
Scene scene = new Scene(root, 300, 150);
stage.setScene(scene);
stage.setTitle("Text Field Sample");
GridPane grid = new GridPane();
grid.setPadding(new Insets(10, 10, 10, 10));
grid.setVgap(5);
grid.setHgap(5);
scene.setRoot(grid);
final Label dollar = new Label("$");
GridPane.setConstraints(dollar, 0, 0);
grid.getChildren().add(dollar);
final TextField sum = new TextField() {
@Override
public void replaceText(int start, int end, String text) {
if (!text.matches("[a-z, A-Z]")) {
super.replaceText(start, end, text);
}
label.setText("Enter a numeric value");
}
@Override
public void replaceSelection(String text) {
if (!text.matches("[a-z, A-Z]")) {
super.replaceSelection(text);
}
}
};
sum.setPrefColumnCount(10);
GridPane.setConstraints(sum, 1, 0);
grid.getChildren().add(sum);
Button submit = new Button("Submit");
GridPane.setConstraints(submit, 2, 0);
grid.getChildren().add(submit);
submit.setOnAction((ActionEvent e) -> {
label.setText(null);
});
GridPane.setConstraints(label, 0, 1);
GridPane.setColumnSpan(label, 3);
grid.getChildren().add(label);
scene.setRoot(grid);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
} | [
"ligero_miguel@hotmail.com"
] | ligero_miguel@hotmail.com |
39e8100093a04946e8c69d35427f629b82250291 | f13727f12da683df4888f82393833cbeb0a8a159 | /java/jpwr/bcomp/src/JopcBasevalveincrdecr7.java | 7deaa67110516596a75983a5b30386e2cd5ce2aa | [] | no_license | Strongc/proview | 2d5c54c0f9b2b4272f2a6e9ccf3aba794d3d794a | bf17a7ab3fd3f1b4288d6e6dff3107e3a7f31327 | refs/heads/master | 2020-12-14T18:45:03.413323 | 2014-04-10T15:40:51 | 2014-04-10T15:40:51 | null | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 259,164 | java | package jpwr.bcomp;
import jpwr.rt.*;
import jpwr.jop.*;
import jpwr.jopc.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
import java.awt.event.*;
public class JopcBasevalveincrdecr7 extends JopFrame implements JopUtilityIfc {
JPanel contentPane;
BorderLayout borderLayout1 = new BorderLayout();
public LocalPanel localPanel = new LocalPanel();
boolean scrollbar = false;
Dimension size;
pwr_valuelong pwr_valuelong5;
pwr_menubar2 pwr_menubar26;
pwr_pulldownmenu2 pwr_pulldownmenu27;
pwr_pulldownmenu2 pwr_pulldownmenu28;
pwr_mbopenobject pwr_mbopenobject9;
pwr_mbtrend pwr_mbtrend10;
pwr_mbfast pwr_mbfast11;
pwr_mbphoto pwr_mbphoto12;
pwr_mbdatasheet pwr_mbdatasheet13;
pwr_mbopenplc pwr_mbopenplc14;
pwr_mbcircuitdiagram pwr_mbcircuitdiagram15;
pwr_mbrtnavigator pwr_mbrtnavigator16;
pwr_mbhelpclass pwr_mbhelpclass17;
pwr_mbblockevents pwr_mbblockevents18;
pwr_mbhistevent pwr_mbhistevent19;
pwr_mbnote pwr_mbnote20;
pwr_mbhelp pwr_mbhelp21;
pwr_smallbuttoncenter pwr_smallbuttoncenter22;
pwr_valuelong pwr_valuelong23;
pwr_valuelong pwr_valuelong24;
pwr_valuesmall pwr_valuesmall26;
pwr_sliderbackground3 pwr_sliderbackground327;
pwr_valueinputreliefup pwr_valueinputreliefup28;
pwr_valueinputreliefup pwr_valueinputreliefup29;
pwr_pulldownmenu2 pwr_pulldownmenu230;
pwr_pulldownmenu2 pwr_pulldownmenu231;
JopBar jopBar37;
JopAxis jopAxis38;
pwr_mbsimulate pwr_mbsimulate40;
pwr_actuator pwr_actuator41;
pwr_basevalve pwr_basevalve42;
pwr_pulldownmenu2 pwr_pulldownmenu245;
pwr_indsquare pwr_indsquare46;
pwr_smallbuttoncenter pwr_smallbuttoncenter49;
pwr_smallbuttoncenter pwr_smallbuttoncenter50;
pwr_indround pwr_indround51;
pwr_indround pwr_indround52;
pwr_smallbuttoncenter pwr_smallbuttoncenter53;
pwr_indround pwr_indround54;
pwr_indround pwr_indround55;
Grp203_ grp203_56;
pwr_indround pwr_indround57;
pwr_smallbuttoncenter pwr_smallbuttoncenter58;
pwr_smallbuttoncenter pwr_smallbuttoncenter59;
pwr_smallbuttoncenter pwr_smallbuttoncenter60;
Grp207_ grp207_61;
pwr_smallbuttoncenter pwr_smallbuttoncenter62;
pwr_indsquare pwr_indsquare66;
pwr_indsquare pwr_indsquare67;
pwr_valvecontrol2 pwr_valvecontrol270;
pwr_mbup pwr_mbup71;
public JopcBasevalveincrdecr7( JopSession session, String instance, boolean scrollbar) {
super( session, instance);
this.scrollbar = scrollbar;
geInit();
}
public JopcBasevalveincrdecr7( JopSession session, String instance, boolean scrollbar, boolean noinit) {
super( session, instance);
this.scrollbar = scrollbar;
if ( !noinit)
geInit();
}
public void geInit() {
JopSpider.setSystemName( "äw›·Dó·Dó·p—uÄ›·ë · ã ·x6Ý¿çY˜·Dó·Dó·x—u ã ·");
engine.setAnimationScanTime( 500);
engine.setScanTime( 500);
size = new Dimension( 544, 733);
Dimension dsize = new Dimension(localPanel.original_width,localPanel.original_height);
this.addComponentListener(new AspectRatioListener(this,size));
contentPane = (JPanel) this.getContentPane();
contentPane.setLayout(borderLayout1);
if ( scrollbar)
contentPane.add( new JScrollPane(localPanel), BorderLayout.CENTER);
else
contentPane.add(localPanel, BorderLayout.CENTER);
contentPane.setOpaque(true);
localPanel.setLayout( new RatioLayout()); // scaletest
localPanel.setOpaque(true);
localPanel.setBackground(GeColor.getColor(31, GeColor.NO_COLOR));
this.setSize(size);
if ( engine.isInstance())
setTitle( engine.getInstance());
else
this.setTitle("JopcBasevalveincrdecr7");
pwr_valuelong5 = new pwr_valuelong(session);
pwr_valuelong5.setBounds(new Rectangle(17,47,383,20));
pwr_valuelong5.setFillColor(31);
pwr_valuelong5.setBorderColor(32);
localPanel.add(pwr_valuelong5, new Proportion(pwr_valuelong5.getBounds(), dsize));
pwr_menubar26 = new pwr_menubar2(session);
pwr_menubar26.setBounds(new Rectangle(1,1,534,22));
pwr_menubar26.setShadow(1);
localPanel.add(pwr_menubar26, new Proportion(pwr_menubar26.getBounds(), dsize));
pwr_pulldownmenu27 = new pwr_pulldownmenu2(session);
pwr_pulldownmenu27.setBounds(new Rectangle(11,1,67,22));
pwr_pulldownmenu27.setShadow(1);
localPanel.add(pwr_pulldownmenu27, new Proportion(pwr_pulldownmenu27.getBounds(), dsize));
pwr_pulldownmenu28 = new pwr_pulldownmenu2(session);
pwr_pulldownmenu28.setBounds(new Rectangle(446,1,67,22));
pwr_pulldownmenu28.setShadow(1);
localPanel.add(pwr_pulldownmenu28, new Proportion(pwr_pulldownmenu28.getBounds(), dsize));
pwr_mbopenobject9 = new pwr_mbopenobject(session);
pwr_mbopenobject9.setBounds(new Rectangle(195,25,18,18));
pwr_mbopenobject9.setShadow(1);
localPanel.add(pwr_mbopenobject9, new Proportion(pwr_mbopenobject9.getBounds(), dsize));
pwr_mbtrend10 = new pwr_mbtrend(session);
pwr_mbtrend10.setBounds(new Rectangle(56,25,18,18));
pwr_mbtrend10.setShadow(1);
localPanel.add(pwr_mbtrend10, new Proportion(pwr_mbtrend10.getBounds(), dsize));
pwr_mbfast11 = new pwr_mbfast(session);
pwr_mbfast11.setBounds(new Rectangle(76,25,18,18));
pwr_mbfast11.setShadow(1);
localPanel.add(pwr_mbfast11, new Proportion(pwr_mbfast11.getBounds(), dsize));
pwr_mbphoto12 = new pwr_mbphoto(session);
pwr_mbphoto12.setBounds(new Rectangle(96,25,18,18));
pwr_mbphoto12.setShadow(1);
localPanel.add(pwr_mbphoto12, new Proportion(pwr_mbphoto12.getBounds(), dsize));
pwr_mbdatasheet13 = new pwr_mbdatasheet(session);
pwr_mbdatasheet13.setBounds(new Rectangle(116,25,18,18));
pwr_mbdatasheet13.setShadow(1);
localPanel.add(pwr_mbdatasheet13, new Proportion(pwr_mbdatasheet13.getBounds(), dsize));
pwr_mbopenplc14 = new pwr_mbopenplc(session);
pwr_mbopenplc14.setBounds(new Rectangle(215,25,18,18));
pwr_mbopenplc14.setShadow(1);
localPanel.add(pwr_mbopenplc14, new Proportion(pwr_mbopenplc14.getBounds(), dsize));
pwr_mbcircuitdiagram15 = new pwr_mbcircuitdiagram(session);
pwr_mbcircuitdiagram15.setBounds(new Rectangle(235,25,18,18));
pwr_mbcircuitdiagram15.setShadow(1);
localPanel.add(pwr_mbcircuitdiagram15, new Proportion(pwr_mbcircuitdiagram15.getBounds(), dsize));
pwr_mbrtnavigator16 = new pwr_mbrtnavigator(session);
pwr_mbrtnavigator16.setBounds(new Rectangle(175,25,18,18));
pwr_mbrtnavigator16.setShadow(1);
localPanel.add(pwr_mbrtnavigator16, new Proportion(pwr_mbrtnavigator16.getBounds(), dsize));
pwr_mbhelpclass17 = new pwr_mbhelpclass(session);
pwr_mbhelpclass17.setBounds(new Rectangle(255,25,18,18));
pwr_mbhelpclass17.setShadow(1);
localPanel.add(pwr_mbhelpclass17, new Proportion(pwr_mbhelpclass17.getBounds(), dsize));
pwr_mbblockevents18 = new pwr_mbblockevents(session);
pwr_mbblockevents18.setBounds(new Rectangle(155,25,18,18));
pwr_mbblockevents18.setShadow(1);
localPanel.add(pwr_mbblockevents18, new Proportion(pwr_mbblockevents18.getBounds(), dsize));
pwr_mbhistevent19 = new pwr_mbhistevent(session);
pwr_mbhistevent19.setBounds(new Rectangle(136,25,18,18));
localPanel.add(pwr_mbhistevent19, new Proportion(pwr_mbhistevent19.getBounds(), dsize));
pwr_mbnote20 = new pwr_mbnote(session);
pwr_mbnote20.setBounds(new Rectangle(36,25,17,18));
localPanel.add(pwr_mbnote20, new Proportion(pwr_mbnote20.getBounds(), dsize));
pwr_mbhelp21 = new pwr_mbhelp(session);
pwr_mbhelp21.setBounds(new Rectangle(17,25,18,18));
localPanel.add(pwr_mbhelp21, new Proportion(pwr_mbhelp21.getBounds(), dsize));
pwr_smallbuttoncenter22 = new pwr_smallbuttoncenter(session);
pwr_smallbuttoncenter22.setBounds(new Rectangle(18,668,46,19));
pwr_smallbuttoncenter22.setBorderColor(37);
localPanel.add(pwr_smallbuttoncenter22, new Proportion(pwr_smallbuttoncenter22.getBounds(), dsize));
pwr_valuelong23 = new pwr_valuelong(session);
pwr_valuelong23.setBounds(new Rectangle(17,71,383,20));
pwr_valuelong23.setFillColor(31);
pwr_valuelong23.setBorderColor(32);
localPanel.add(pwr_valuelong23, new Proportion(pwr_valuelong23.getBounds(), dsize));
pwr_valuelong24 = new pwr_valuelong(session);
pwr_valuelong24.setBounds(new Rectangle(75,667,334,21));
pwr_valuelong24.setFillColor(31);
pwr_valuelong24.setBorderColor(31);
localPanel.add(pwr_valuelong24, new Proportion(pwr_valuelong24.getBounds(), dsize));
pwr_valuesmall26 = new pwr_valuesmall(session);
pwr_valuesmall26.setBounds(new Rectangle(451,392,48,15));
localPanel.add(pwr_valuesmall26, new Proportion(pwr_valuesmall26.getBounds(), dsize));
pwr_sliderbackground327 = new pwr_sliderbackground3(session);
pwr_sliderbackground327.setBounds(new Rectangle(448,133,63,241));
pwr_sliderbackground327.setFillColor(35);
localPanel.add(pwr_sliderbackground327, new Proportion(pwr_sliderbackground327.getBounds(), dsize));
pwr_valueinputreliefup28 = new pwr_valueinputreliefup(session);
pwr_valueinputreliefup28.setBounds(new Rectangle(384,132,49,16));
localPanel.add(pwr_valueinputreliefup28, new Proportion(pwr_valueinputreliefup28.getBounds(), dsize));
pwr_valueinputreliefup29 = new pwr_valueinputreliefup(session);
pwr_valueinputreliefup29.setBounds(new Rectangle(384,359,49,16));
localPanel.add(pwr_valueinputreliefup29, new Proportion(pwr_valueinputreliefup29.getBounds(), dsize));
pwr_pulldownmenu230 = new pwr_pulldownmenu2(session);
pwr_pulldownmenu230.setBounds(new Rectangle(268,1,67,22));
pwr_pulldownmenu230.setShadow(1);
localPanel.add(pwr_pulldownmenu230, new Proportion(pwr_pulldownmenu230.getBounds(), dsize));
pwr_pulldownmenu231 = new pwr_pulldownmenu2(session);
pwr_pulldownmenu231.setBounds(new Rectangle(70,1,67,22));
pwr_pulldownmenu231.setShadow(1);
localPanel.add(pwr_pulldownmenu231, new Proportion(pwr_pulldownmenu231.getBounds(), dsize));
jopBar37 = new JopBar(session);
jopBar37.setBounds(new Rectangle(467,134,20,238));
jopBar37.setFillColor(39);
jopBar37.setBorderColor(0);
jopBar37.setFillColorBar(167);
jopBar37.setBorderColorBar(161);
jopBar37.setDrawFill(1);
jopBar37.setDrawBorder(1);
jopBar37.setBarBorderWidth(1);
jopBar37.setLineWidth(1);
jopBar37.setMinValue(0F);
jopBar37.setMaxValue(100F);
jopBar37.setRotate(0);
localPanel.add(jopBar37, new Proportion(jopBar37.getBounds(), dsize));
jopAxis38 = new JopAxis();
jopAxis38.setBounds(new Rectangle(437,134,11,238));
jopAxis38.setBorderColor(0);
jopAxis38.setTextColor(0);
jopAxis38.setLineWidth(1);
jopAxis38.setMinValue(0F);
jopAxis38.setMaxValue(0F);
jopAxis38.setLines(51);
jopAxis38.setLongQuotient(5);
jopAxis38.setValueQuotient(5);
jopAxis38.setLineLength(11);
jopAxis38.setLineWidth(1);
jopAxis38.setRotate(0);
jopAxis38.setFont(new Font("Helvetica", Font.PLAIN, 10));
jopAxis38.setFormat("%3.0f");
localPanel.add(jopAxis38, new Proportion(jopAxis38.getBounds(), dsize));
pwr_mbsimulate40 = new pwr_mbsimulate(session);
pwr_mbsimulate40.setBounds(new Rectangle(509,25,18,18));
localPanel.add(pwr_mbsimulate40, new Proportion(pwr_mbsimulate40.getBounds(), dsize));
pwr_actuator41 = new pwr_actuator(session);
pwr_actuator41.setBounds(new Rectangle(261,454,130,82));
pwr_actuator41.setShadow(1);
localPanel.add(pwr_actuator41, new Proportion(pwr_actuator41.getBounds(), dsize));
pwr_basevalve42 = new pwr_basevalve(session);
pwr_basevalve42.setBounds(new Rectangle(286,534,78,120));
pwr_basevalve42.setShadow(1);
localPanel.add(pwr_basevalve42, new Proportion(pwr_basevalve42.getBounds(), dsize));
pwr_pulldownmenu245 = new pwr_pulldownmenu2(session);
pwr_pulldownmenu245.setBounds(new Rectangle(161,1,90,22));
pwr_pulldownmenu245.setShadow(1);
localPanel.add(pwr_pulldownmenu245, new Proportion(pwr_pulldownmenu245.getBounds(), dsize));
pwr_indsquare46 = new pwr_indsquare(session);
pwr_indsquare46.setBounds(new Rectangle(183,488,13,14));
pwr_indsquare46.setFillColor(114);
pwr_indsquare46.setShadow(1);
localPanel.add(pwr_indsquare46, new Proportion(pwr_indsquare46.getBounds(), dsize));
pwr_smallbuttoncenter49 = new pwr_smallbuttoncenter(session);
pwr_smallbuttoncenter49.setBounds(new Rectangle(174,339,60,19));
pwr_smallbuttoncenter49.setFillColor(32);
localPanel.add(pwr_smallbuttoncenter49, new Proportion(pwr_smallbuttoncenter49.getBounds(), dsize));
pwr_smallbuttoncenter50 = new pwr_smallbuttoncenter(session);
pwr_smallbuttoncenter50.setBounds(new Rectangle(38,338,46,19));
pwr_smallbuttoncenter50.setFillColor(32);
localPanel.add(pwr_smallbuttoncenter50, new Proportion(pwr_smallbuttoncenter50.getBounds(), dsize));
pwr_indround51 = new pwr_indround(session);
pwr_indround51.setBounds(new Rectangle(98,342,16,16));
pwr_indround51.setShadow(1);
localPanel.add(pwr_indround51, new Proportion(pwr_indround51.getBounds(), dsize));
pwr_indround52 = new pwr_indround(session);
pwr_indround52.setBounds(new Rectangle(98,364,16,16));
pwr_indround52.setShadow(1);
localPanel.add(pwr_indround52, new Proportion(pwr_indround52.getBounds(), dsize));
pwr_smallbuttoncenter53 = new pwr_smallbuttoncenter(session);
pwr_smallbuttoncenter53.setBounds(new Rectangle(174,363,60,19));
pwr_smallbuttoncenter53.setFillColor(32);
localPanel.add(pwr_smallbuttoncenter53, new Proportion(pwr_smallbuttoncenter53.getBounds(), dsize));
pwr_indround54 = new pwr_indround(session);
pwr_indround54.setBounds(new Rectangle(98,388,16,16));
pwr_indround54.setFillColor(114);
pwr_indround54.setShadow(1);
localPanel.add(pwr_indround54, new Proportion(pwr_indround54.getBounds(), dsize));
pwr_indround55 = new pwr_indround(session);
pwr_indround55.setBounds(new Rectangle(246,343,16,16));
pwr_indround55.setFillColor(294);
pwr_indround55.setShadow(1);
localPanel.add(pwr_indround55, new Proportion(pwr_indround55.getBounds(), dsize));
grp203_56 = new Grp203_(session);
grp203_56.setBounds(new Rectangle(40,389,35,16));
localPanel.add(grp203_56, new Proportion(grp203_56.getBounds(), dsize));
pwr_indround57 = new pwr_indround(session);
pwr_indround57.setBounds(new Rectangle(246,365,16,16));
pwr_indround57.setFillColor(294);
pwr_indround57.setShadow(1);
localPanel.add(pwr_indround57, new Proportion(pwr_indround57.getBounds(), dsize));
pwr_smallbuttoncenter58 = new pwr_smallbuttoncenter(session);
pwr_smallbuttoncenter58.setBounds(new Rectangle(174,386,60,19));
pwr_smallbuttoncenter58.setFillColor(32);
localPanel.add(pwr_smallbuttoncenter58, new Proportion(pwr_smallbuttoncenter58.getBounds(), dsize));
pwr_smallbuttoncenter59 = new pwr_smallbuttoncenter(session);
pwr_smallbuttoncenter59.setBounds(new Rectangle(174,363,60,19));
pwr_smallbuttoncenter59.setFillColor(32);
localPanel.add(pwr_smallbuttoncenter59, new Proportion(pwr_smallbuttoncenter59.getBounds(), dsize));
pwr_smallbuttoncenter60 = new pwr_smallbuttoncenter(session);
pwr_smallbuttoncenter60.setBounds(new Rectangle(174,339,60,19));
pwr_smallbuttoncenter60.setFillColor(32);
localPanel.add(pwr_smallbuttoncenter60, new Proportion(pwr_smallbuttoncenter60.getBounds(), dsize));
grp207_61 = new Grp207_(session);
grp207_61.setBounds(new Rectangle(40,364,39,16));
localPanel.add(grp207_61, new Proportion(grp207_61.getBounds(), dsize));
pwr_smallbuttoncenter62 = new pwr_smallbuttoncenter(session);
pwr_smallbuttoncenter62.setBounds(new Rectangle(38,363,46,19));
pwr_smallbuttoncenter62.setFillColor(32);
localPanel.add(pwr_smallbuttoncenter62, new Proportion(pwr_smallbuttoncenter62.getBounds(), dsize));
pwr_indsquare66 = new pwr_indsquare(session);
pwr_indsquare66.setBounds(new Rectangle(137,186,14,15));
pwr_indsquare66.setFillColor(294);
pwr_indsquare66.setShadow(1);
localPanel.add(pwr_indsquare66, new Proportion(pwr_indsquare66.getBounds(), dsize));
pwr_indsquare67 = new pwr_indsquare(session);
pwr_indsquare67.setBounds(new Rectangle(138,205,14,15));
pwr_indsquare67.setFillColor(294);
pwr_indsquare67.setShadow(1);
localPanel.add(pwr_indsquare67, new Proportion(pwr_indsquare67.getBounds(), dsize));
pwr_valvecontrol270 = new pwr_valvecontrol2(session);
pwr_valvecontrol270.setBounds(new Rectangle(169,116,64,41));
pwr_valvecontrol270.setShadow(1);
localPanel.add(pwr_valvecontrol270, new Proportion(pwr_valvecontrol270.getBounds(), dsize));
pwr_mbup71 = new pwr_mbup(session);
pwr_mbup71.setBounds(new Rectangle(489,25,18,18));
localPanel.add(pwr_mbup71, new Proportion(pwr_mbup71.getBounds(), dsize));
pwr_valuelong5.dd.setDynType(1025);
pwr_valuelong5.dd.setActionType(0);
pwr_valuelong5.dd.setElements(new GeDynElemIfc[] {
new GeDynValue(pwr_valuelong5.dd, "$object.Description##String80","%s")
});
pwr_menubar26.dd.setDynType(1);
pwr_menubar26.dd.setActionType(0);
pwr_pulldownmenu27.dd.setDynType(0);
pwr_pulldownmenu27.dd.setActionType(524288);
pwr_pulldownmenu27.dd.setAccess(65535);
pwr_pulldownmenu27.dd.setElements(new GeDynElemIfc[] {
new GeDynPulldownMenu(pwr_pulldownmenu27.dd, new String[] {
JopLang.transl("Print"),JopLang.transl("Close"),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null},
new GeDyn[] {
new GeDyn(pwr_pulldownmenu27,1,65,65535,new GeDynElemIfc[] {
new GeDynCommand(pwr_pulldownmenu27.dd, "print graph/class/inst=$object")
}),
new GeDyn(pwr_pulldownmenu27,1,262145,65535,new GeDynElemIfc[] {
new GeDynCloseGraph(pwr_pulldownmenu27.dd)
}),
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null
})
});
pwr_pulldownmenu27.setAnnot1("File");
pwr_pulldownmenu28.dd.setDynType(1);
pwr_pulldownmenu28.dd.setActionType(524288);
pwr_pulldownmenu28.dd.setAccess(65532);
pwr_pulldownmenu28.dd.setElements(new GeDynElemIfc[] {
new GeDynPulldownMenu(pwr_pulldownmenu28.dd, new String[] {
JopLang.transl("Help"),JopLang.transl("Help Class"),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null},
new GeDyn[] {
new GeDyn(pwr_pulldownmenu28,1,65,65535,new GeDynElemIfc[] {
new GeDynCommand(pwr_pulldownmenu28.dd, "call method/method=\"Help\"/object=$object")
}),
new GeDyn(pwr_pulldownmenu28,1,65,65532,new GeDynElemIfc[] {
new GeDynCommand(pwr_pulldownmenu28.dd, "call method/method=\"Help Class\"/object=$object")
}),
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null
})
});
pwr_pulldownmenu28.setAnnot1("Help");
pwr_mbopenobject9.dd.setDynType(129);
pwr_mbopenobject9.dd.setActionType(8256);
pwr_mbopenobject9.dd.setAccess(65532);
pwr_mbopenobject9.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbopenobject9.dd, "$cmd(check method/method=\"Open Object\"/object=$object)",1)
,new GeDynCommand(pwr_mbopenobject9.dd, "call method/method=\"Open Object\"/object=$object")
,new GeDynTipText(pwr_mbopenobject9.dd, JopLang.transl("Open Object"))
});
pwr_mbtrend10.dd.setDynType(129);
pwr_mbtrend10.dd.setActionType(8256);
pwr_mbtrend10.dd.setAccess(65532);
pwr_mbtrend10.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbtrend10.dd, "$cmd(check method/method=\"Trend\"/object=$object)",1)
,new GeDynCommand(pwr_mbtrend10.dd, "call method/method=\"Trend\"/object=$object")
,new GeDynTipText(pwr_mbtrend10.dd, JopLang.transl("Trend"))
});
pwr_mbfast11.dd.setDynType(129);
pwr_mbfast11.dd.setActionType(8256);
pwr_mbfast11.dd.setAccess(65532);
pwr_mbfast11.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbfast11.dd, "$cmd(check method/method=\"Fast\"/object=$object)",1)
,new GeDynCommand(pwr_mbfast11.dd, "call method/method=\"Fast\"/object=$object")
,new GeDynTipText(pwr_mbfast11.dd, JopLang.transl("Fast"))
});
pwr_mbphoto12.dd.setDynType(129);
pwr_mbphoto12.dd.setActionType(8256);
pwr_mbphoto12.dd.setAccess(65532);
pwr_mbphoto12.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbphoto12.dd, "$cmd(check method/method=\"Photo\"/object=$object)",1)
,new GeDynCommand(pwr_mbphoto12.dd, "call method/method=\"Photo\"/object=$object")
,new GeDynTipText(pwr_mbphoto12.dd, JopLang.transl("Photo"))
});
pwr_mbdatasheet13.dd.setDynType(129);
pwr_mbdatasheet13.dd.setActionType(8256);
pwr_mbdatasheet13.dd.setAccess(65532);
pwr_mbdatasheet13.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbdatasheet13.dd, "$cmd(check method/method=\"DataSheet\"/object=$object)",1)
,new GeDynCommand(pwr_mbdatasheet13.dd, "call method/method=\"DataSheet\"/object=$object")
,new GeDynTipText(pwr_mbdatasheet13.dd, JopLang.transl("DataSheet"))
});
pwr_mbopenplc14.dd.setDynType(129);
pwr_mbopenplc14.dd.setActionType(8256);
pwr_mbopenplc14.dd.setAccess(65532);
pwr_mbopenplc14.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbopenplc14.dd, "$cmd(check method/method=\"Open Plc\"/object=$object)",1)
,new GeDynCommand(pwr_mbopenplc14.dd, "call method/method=\"Open Plc\"/object=$object")
,new GeDynTipText(pwr_mbopenplc14.dd, JopLang.transl("Open Plc"))
});
pwr_mbcircuitdiagram15.dd.setDynType(129);
pwr_mbcircuitdiagram15.dd.setActionType(8256);
pwr_mbcircuitdiagram15.dd.setAccess(65535);
pwr_mbcircuitdiagram15.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbcircuitdiagram15.dd, "$cmd(check method/method=\"CircuitDiagram\"/object=$object)",1)
,new GeDynCommand(pwr_mbcircuitdiagram15.dd, "call method/method=\"CircuitDiagram\"/object=$object")
,new GeDynTipText(pwr_mbcircuitdiagram15.dd, JopLang.transl("CircuitDiagram"))
});
pwr_mbrtnavigator16.dd.setDynType(129);
pwr_mbrtnavigator16.dd.setActionType(8256);
pwr_mbrtnavigator16.dd.setAccess(65532);
pwr_mbrtnavigator16.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbrtnavigator16.dd, "$cmd(check method/method=\"RtNavigator\"/object=$object)",1)
,new GeDynCommand(pwr_mbrtnavigator16.dd, "call method/method=\"RtNavigator\"/object=$object")
,new GeDynTipText(pwr_mbrtnavigator16.dd, JopLang.transl("RtNavigator"))
});
pwr_mbhelpclass17.dd.setDynType(129);
pwr_mbhelpclass17.dd.setActionType(8256);
pwr_mbhelpclass17.dd.setAccess(65532);
pwr_mbhelpclass17.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbhelpclass17.dd, "$cmd(check method/method=\"Help Class\"/object=$object)",1)
,new GeDynCommand(pwr_mbhelpclass17.dd, "call method/method=\"Help Class\"/object=$object")
,new GeDynTipText(pwr_mbhelpclass17.dd, JopLang.transl("Help Class"))
});
pwr_mbblockevents18.dd.setDynType(129);
pwr_mbblockevents18.dd.setActionType(8256);
pwr_mbblockevents18.dd.setAccess(65532);
pwr_mbblockevents18.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbblockevents18.dd, "$cmd(check method/method=\"Block Events...\"/object=$object)",1)
,new GeDynCommand(pwr_mbblockevents18.dd, "call method/method=\"Block Events...\"/object=$object")
,new GeDynTipText(pwr_mbblockevents18.dd, JopLang.transl("Block Events"))
});
pwr_mbhistevent19.dd.setDynType(129);
pwr_mbhistevent19.dd.setActionType(8256);
pwr_mbhistevent19.dd.setAccess(65532);
pwr_mbhistevent19.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbhistevent19.dd, "$cmd(check method/method=\"Hist Event...\"/object=$object)",0)
,new GeDynCommand(pwr_mbhistevent19.dd, "call method/method=\"Hist Event...\"/object=$object")
,new GeDynTipText(pwr_mbhistevent19.dd, JopLang.transl("Hist Event"))
});
pwr_mbnote20.dd.setDynType(129);
pwr_mbnote20.dd.setActionType(8256);
pwr_mbnote20.dd.setAccess(65532);
pwr_mbnote20.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbnote20.dd, "$cmd(check method/method=\"Note\"/object=$object)",0)
,new GeDynCommand(pwr_mbnote20.dd, "call method/method=\"Note\"/object=$object")
,new GeDynTipText(pwr_mbnote20.dd, JopLang.transl("Note"))
});
pwr_mbhelp21.dd.setDynType(128);
pwr_mbhelp21.dd.setActionType(8256);
pwr_mbhelp21.dd.setAccess(65532);
pwr_mbhelp21.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbhelp21.dd, "$cmd(check method/method=\"Help\"/object=$object)",1)
,new GeDynCommand(pwr_mbhelp21.dd, "call method/method=\"Help\"/object=$object")
,new GeDynTipText(pwr_mbhelp21.dd, JopLang.transl("Help"))
});
pwr_smallbuttoncenter22.dd.setDynType(128);
pwr_smallbuttoncenter22.dd.setActionType(64);
pwr_smallbuttoncenter22.dd.setAccess(65532);
pwr_smallbuttoncenter22.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_smallbuttoncenter22.dd, "$object.Note##String80",0)
,new GeDynCommand(pwr_smallbuttoncenter22.dd, "call method/method=\"Note\"/object=$object")
});
pwr_smallbuttoncenter22.setAnnot1("Note !");
pwr_valuelong23.dd.setDynType(1025);
pwr_valuelong23.dd.setActionType(0);
pwr_valuelong23.dd.setElements(new GeDynElemIfc[] {
new GeDynValue(pwr_valuelong23.dd, "$object.Specification##String40","%s")
});
pwr_valuelong24.dd.setDynType(1025);
pwr_valuelong24.dd.setActionType(0);
pwr_valuelong24.dd.setElements(new GeDynElemIfc[] {
new GeDynValue(pwr_valuelong24.dd, "$object.Note##String80","%s")
});
pwr_valuesmall26.dd.setDynType(1025);
pwr_valuesmall26.dd.setActionType(2);
pwr_valuesmall26.dd.setAccess(65532);
pwr_valuesmall26.dd.setElements(new GeDynElemIfc[] {
new GeDynValue(pwr_valuesmall26.dd, "$object.Actuator.Position.ActualValue##Float32","%5.1f")
,new GeDynPopupMenu(pwr_valuesmall26.dd, "$object.Actuator.Position")
});
pwr_sliderbackground327.dd.setDynType(524289);
pwr_sliderbackground327.dd.setActionType(0);
pwr_valueinputreliefup28.dd.setDynType(1025);
pwr_valueinputreliefup28.dd.setActionType(4096);
pwr_valueinputreliefup28.dd.setAccess(65532);
pwr_valueinputreliefup28.dd.setElements(new GeDynElemIfc[] {
new GeDynValue(pwr_valueinputreliefup28.dd, "$object.Actuator.Position.PresMaxLimit##Float32","%5.1f")
,new GeDynValueInput(pwr_valueinputreliefup28.dd, 0,0,null,null)
});
pwr_valueinputreliefup28.setAnnot1Font(pwr_valueinputreliefup28.annotFont.deriveFont((float)10));
pwr_valueinputreliefup29.dd.setDynType(1025);
pwr_valueinputreliefup29.dd.setActionType(4096);
pwr_valueinputreliefup29.dd.setAccess(65532);
pwr_valueinputreliefup29.dd.setElements(new GeDynElemIfc[] {
new GeDynValue(pwr_valueinputreliefup29.dd, "$object.Actuator.Position.PresMinLimit##Float32","%5.1f")
,new GeDynValueInput(pwr_valueinputreliefup29.dd, 0,0,null,null)
});
pwr_valueinputreliefup29.setAnnot1Font(pwr_valueinputreliefup29.annotFont.deriveFont((float)10));
pwr_pulldownmenu230.dd.setDynType(1);
pwr_pulldownmenu230.dd.setActionType(524288);
pwr_pulldownmenu230.dd.setAccess(65535);
pwr_pulldownmenu230.dd.setElements(new GeDynElemIfc[] {
new GeDynPulldownMenu(pwr_pulldownmenu230.dd, new String[] {
JopLang.transl("Position Ai"),JopLang.transl("OrderIncr Do"),JopLang.transl("OrderDecr Do"),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null},
new GeDyn[] {
new GeDyn(pwr_pulldownmenu230,1,65,65535,new GeDynElemIfc[] {
new GeDynCommand(pwr_pulldownmenu230.dd, "open graph /class /inst=$object.Actuator.Position")
}),
new GeDyn(pwr_pulldownmenu230,1,65,65535,new GeDynElemIfc[] {
new GeDynCommand(pwr_pulldownmenu230.dd, "open graph /class /inst=$object.Actuator.OrderIncr")
}),
new GeDyn(pwr_pulldownmenu230,1,65,65535,new GeDynElemIfc[] {
new GeDynCommand(pwr_pulldownmenu230.dd, "open graph /class /inst=$object.Actuator.OrderDecr")
}),
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null
})
});
pwr_pulldownmenu230.setAnnot1("Signals");
pwr_pulldownmenu231.dd.setDynType(1);
pwr_pulldownmenu231.dd.setActionType(524288);
pwr_pulldownmenu231.dd.setAccess(65535);
pwr_pulldownmenu231.dd.setElements(new GeDynElemIfc[] {
new GeDynPulldownMenu(pwr_pulldownmenu231.dd, new String[] {
JopLang.transl("Help"),JopLang.transl("Note"),JopLang.transl("Trend"),JopLang.transl("Fast"),JopLang.transl("Photo"),JopLang.transl("DataSheet"),JopLang.transl("Hist Event..."),JopLang.transl("Block Events..."),JopLang.transl("RtNavigator"),JopLang.transl("Open Object"),JopLang.transl("Open Plc"),JopLang.transl("CircuitDiagram"),JopLang.transl("Help Class"),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null},
new GeDyn[] {
new GeDyn(pwr_pulldownmenu231,129,65,65535,new GeDynElemIfc[] {
new GeDynInvisible(pwr_pulldownmenu231.dd, "$cmd(check method/method=\"Help\"/object=$object)",0)
,new GeDynCommand(pwr_pulldownmenu231.dd, "call method/method=\"Help\"/object=$object")
}),
new GeDyn(pwr_pulldownmenu231,129,65,65532,new GeDynElemIfc[] {
new GeDynInvisible(pwr_pulldownmenu231.dd, "$cmd(check method/method=\"Note\"/object=$object)",0)
,new GeDynCommand(pwr_pulldownmenu231.dd, "call method/method=\"Note\"/object=$object")
}),
new GeDyn(pwr_pulldownmenu231,129,65,65532,new GeDynElemIfc[] {
new GeDynInvisible(pwr_pulldownmenu231.dd, "$cmd(check method/method=\"Trend\"/object=$object)",0)
,new GeDynCommand(pwr_pulldownmenu231.dd, "call method/method=\"Trend\"/object=$object")
}),
new GeDyn(pwr_pulldownmenu231,129,65,65532,new GeDynElemIfc[] {
new GeDynInvisible(pwr_pulldownmenu231.dd, "$cmd(check method/method=\"Fast\"/object=$object)",0)
,new GeDynCommand(pwr_pulldownmenu231.dd, "call method/method=\"Fast\"/object=$object")
}),
new GeDyn(pwr_pulldownmenu231,129,65,65532,new GeDynElemIfc[] {
new GeDynInvisible(pwr_pulldownmenu231.dd, "$cmd(check method/method=\"Photo\"/object=$object)",0)
,new GeDynCommand(pwr_pulldownmenu231.dd, "call method/method=\"Photo\"/object=$object")
}),
new GeDyn(pwr_pulldownmenu231,129,65,65532,new GeDynElemIfc[] {
new GeDynInvisible(pwr_pulldownmenu231.dd, "$cmd(check method/method=\"DataSheet\"/object=$object)",0)
,new GeDynCommand(pwr_pulldownmenu231.dd, "call method/method=\"DataSheet\"/object=$object")
}),
new GeDyn(pwr_pulldownmenu231,129,65,65532,new GeDynElemIfc[] {
new GeDynInvisible(pwr_pulldownmenu231.dd, "$cmd(check method/method=\"Hist Event...\"/object=$object)",0)
,new GeDynCommand(pwr_pulldownmenu231.dd, "call method/method=\"Hist Event...\"/object=$object")
}),
new GeDyn(pwr_pulldownmenu231,129,65,65532,new GeDynElemIfc[] {
new GeDynInvisible(pwr_pulldownmenu231.dd, "$cmd(check method/method=\"Block Events...\"/object=$object)",0)
,new GeDynCommand(pwr_pulldownmenu231.dd, "call method/method=\"Block Events...\"/object=$object")
}),
new GeDyn(pwr_pulldownmenu231,129,65,65532,new GeDynElemIfc[] {
new GeDynInvisible(pwr_pulldownmenu231.dd, "$cmd(check method/method=\"RtNavigator\"/object=$object)",0)
,new GeDynCommand(pwr_pulldownmenu231.dd, "call method/method=\"RtNavigator\"/object=$object")
}),
new GeDyn(pwr_pulldownmenu231,129,65,65532,new GeDynElemIfc[] {
new GeDynInvisible(pwr_pulldownmenu231.dd, "$cmd(check method/method=\"Open Object\"/object=$object)",0)
,new GeDynCommand(pwr_pulldownmenu231.dd, "call method/method=\"Open Object\"/object=$object")
}),
new GeDyn(pwr_pulldownmenu231,129,65,65532,new GeDynElemIfc[] {
new GeDynInvisible(pwr_pulldownmenu231.dd, "$cmd(check method/method=\"Open Plc\"/object=$object)",0)
,new GeDynCommand(pwr_pulldownmenu231.dd, "call method/method=\"Open Plc\"/object=$object")
}),
new GeDyn(pwr_pulldownmenu231,129,65,65532,new GeDynElemIfc[] {
new GeDynInvisible(pwr_pulldownmenu231.dd, "$cmd(check method/method=\"CircuitDiagram\"/object=$object)",0)
,new GeDynCommand(pwr_pulldownmenu231.dd, "call method/method=\"CircuitDiagram\"/object=$object")
}),
new GeDyn(pwr_pulldownmenu231,129,65,65532,new GeDynElemIfc[] {
new GeDynInvisible(pwr_pulldownmenu231.dd, "$cmd(check method/method=\"Help Class\"/object=$object)",0)
,new GeDynCommand(pwr_pulldownmenu231.dd, "call method/method=\"Help Class\"/object=$object")
}),
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null
})
});
pwr_pulldownmenu231.setAnnot1("Methods");
jopBar37.setPwrAttribute("$object.Actuator.Position.ActualValue##Float32");
jopBar37.setMinValueAttr("$object.Actuator.Order.PresMinLimit##Float32");
jopBar37.setMaxValueAttr("$object.Actuator.Order.PresMaxLimit##Float32");
pwr_mbsimulate40.dd.setDynType(129);
pwr_mbsimulate40.dd.setActionType(8256);
pwr_mbsimulate40.dd.setAccess(65532);
pwr_mbsimulate40.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbsimulate40.dd, "$cmd(check method/method=\"Simulate\"/object=$object)",0)
,new GeDynCommand(pwr_mbsimulate40.dd, "call method/method=\"Simulate\"/object=$object")
,new GeDynTipText(pwr_mbsimulate40.dd, JopLang.transl("Open simulate graph"))
});
pwr_actuator41.dd.setDynType(1);
pwr_actuator41.dd.setActionType(66);
pwr_actuator41.dd.setAccess(65532);
pwr_actuator41.dd.setElements(new GeDynElemIfc[] {
new GeDynPopupMenu(pwr_actuator41.dd, "$object.Actuator")
,new GeDynCommand(pwr_actuator41.dd, "open graph/class/inst=$object.Actuator")
});
pwr_basevalve42.dd.setDynType(16385);
pwr_basevalve42.dd.setActionType(66);
pwr_basevalve42.dd.setAccess(65532);
pwr_basevalve42.dd.setElements(new GeDynElemIfc[] {
new GeDynAnalogShift(pwr_basevalve42.dd, "$object.Actuator.PosEnum##Int32")
,new GeDynPopupMenu(pwr_basevalve42.dd, "$object.Valve")
,new GeDynCommand(pwr_basevalve42.dd, "open graph/class/inst=$object.Valve")
});
pwr_pulldownmenu245.dd.setDynType(1);
pwr_pulldownmenu245.dd.setActionType(524288);
pwr_pulldownmenu245.dd.setAccess(65535);
pwr_pulldownmenu245.dd.setElements(new GeDynElemIfc[] {
new GeDynPulldownMenu(pwr_pulldownmenu245.dd, new String[] {
JopLang.transl("Actuator"),JopLang.transl("Valve"),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null},
new GeDyn[] {
new GeDyn(pwr_pulldownmenu245,1,65,65535,new GeDynElemIfc[] {
new GeDynCommand(pwr_pulldownmenu245.dd, "open graph /class /inst=$object.Actuator")
}),
new GeDyn(pwr_pulldownmenu245,1,65,65535,new GeDynElemIfc[] {
new GeDynCommand(pwr_pulldownmenu245.dd, "open graph /class /inst=$object.Valve")
}),
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null
})
});
pwr_pulldownmenu245.setAnnot1("Components");
pwr_indsquare46.dd.setDynType(13);
pwr_indsquare46.dd.setActionType(0);
pwr_indsquare46.dd.setElements(new GeDynElemIfc[] {
new GeDynDigColor(pwr_indsquare46.dd, "$object.Actuator.IndError##Boolean",176)
,new GeDynDigLowColor(pwr_indsquare46.dd, "$object.Actuator.IndWarning##Boolean",29)
});
pwr_smallbuttoncenter49.dd.setDynType(129);
pwr_smallbuttoncenter49.dd.setActionType(34);
pwr_smallbuttoncenter49.dd.setAccess(65532);
pwr_smallbuttoncenter49.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_smallbuttoncenter49.dd, "!$object.Actuator.Mode.OpNoStopButton##Boolean",0)
,new GeDynInvisible(pwr_smallbuttoncenter49.dd, "$object.Actuator.Mode.ManOrdHide##Boolean",0)
,new GeDynInvisible(pwr_smallbuttoncenter49.dd, "$object.Actuator.Mode.ManOrdDim##Boolean",1)
,new GeDynPopupMenu(pwr_smallbuttoncenter49.dd, "$object.Actuator.Mode.OpManStart")
,new GeDynStoDig(pwr_smallbuttoncenter49.dd, "$object.Actuator.Mode.OpManIncr##Boolean")
});
pwr_smallbuttoncenter49.setAnnot1("Incr");
pwr_smallbuttoncenter50.dd.setDynType(129);
pwr_smallbuttoncenter50.dd.setActionType(6);
pwr_smallbuttoncenter50.dd.setAccess(65532);
pwr_smallbuttoncenter50.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_smallbuttoncenter50.dd, "$object.Actuator.Mode.ManAutoHide##Boolean",0)
,new GeDynInvisible(pwr_smallbuttoncenter50.dd, "$object.Actuator.Mode.ManModDim##Boolean",1)
,new GeDynPopupMenu(pwr_smallbuttoncenter50.dd, "$object.Actuator.Mode.OpMan")
,new GeDynSetDig(pwr_smallbuttoncenter50.dd, "$object.Actuator.Mode.OpMan##Boolean")
});
pwr_smallbuttoncenter50.setAnnot1("Man");
pwr_indround51.dd.setDynType(133);
pwr_indround51.dd.setActionType(0);
pwr_indround51.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_indround51.dd, "$object.Actuator.Mode.ManAutoHide##Boolean",0)
,new GeDynDigLowColor(pwr_indround51.dd, "!$object.Actuator.Mode.AutoMode##Boolean",29)
});
pwr_indround52.dd.setDynType(133);
pwr_indround52.dd.setActionType(0);
pwr_indround52.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_indround52.dd, "$object.Actuator.Mode.ExternOrdHide##Boolean",0)
,new GeDynDigLowColor(pwr_indround52.dd, "$object.Actuator.Mode.AutoMode##Boolean",29)
});
pwr_smallbuttoncenter53.dd.setDynType(129);
pwr_smallbuttoncenter53.dd.setActionType(34);
pwr_smallbuttoncenter53.dd.setAccess(65532);
pwr_smallbuttoncenter53.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_smallbuttoncenter53.dd, "!$object.Actuator.Mode.OpNoStopButton##Boolean",0)
,new GeDynInvisible(pwr_smallbuttoncenter53.dd, "$object.Actuator.Mode.ManOrdHide##Boolean",0)
,new GeDynInvisible(pwr_smallbuttoncenter53.dd, "$object.Actuator.Mode.ManOrdDim##Boolean",1)
,new GeDynPopupMenu(pwr_smallbuttoncenter53.dd, "$object.Actuator.Mode.OpManStop")
,new GeDynStoDig(pwr_smallbuttoncenter53.dd, "$object.Actuator.Mode.OpManDecr##Boolean")
});
pwr_smallbuttoncenter53.setAnnot1("Decr");
pwr_indround54.dd.setDynType(133);
pwr_indround54.dd.setActionType(0);
pwr_indround54.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_indround54.dd, "$object.Actuator.Mode.LocalModHide##Boolean",0)
,new GeDynDigLowColor(pwr_indround54.dd, "$object.Actuator.Mode.LocalMode##Boolean",29)
});
pwr_indround55.dd.setDynType(5);
pwr_indround55.dd.setActionType(0);
pwr_indround55.dd.setElements(new GeDynElemIfc[] {
new GeDynDigLowColor(pwr_indround55.dd, "$object.Actuator.Mode.FeedbackIncr##Boolean",29)
});
grp203_56.dd.setDynType(129);
grp203_56.dd.setActionType(0);
grp203_56.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(grp203_56.dd, "$object.Actuator.Mode.LocalModHide##Boolean",0)
});
pwr_indround57.dd.setDynType(5);
pwr_indround57.dd.setActionType(0);
pwr_indround57.dd.setElements(new GeDynElemIfc[] {
new GeDynDigLowColor(pwr_indround57.dd, "$object.Actuator.Mode.FeedbackDecr##Boolean",29)
});
pwr_smallbuttoncenter58.dd.setDynType(129);
pwr_smallbuttoncenter58.dd.setActionType(6);
pwr_smallbuttoncenter58.dd.setAccess(65532);
pwr_smallbuttoncenter58.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_smallbuttoncenter58.dd, "$object.Actuator.Mode.ManStopHide##Boolean",0)
,new GeDynInvisible(pwr_smallbuttoncenter58.dd, "$object.Actuator.Mode.ManOrdDim##Boolean",1)
,new GeDynPopupMenu(pwr_smallbuttoncenter58.dd, "$object.Actuator.Mode.OpManStop")
,new GeDynSetDig(pwr_smallbuttoncenter58.dd, "$object.Actuator.Mode.OpManStop##Boolean")
});
pwr_smallbuttoncenter58.setAnnot1("Stop");
pwr_smallbuttoncenter59.dd.setDynType(129);
pwr_smallbuttoncenter59.dd.setActionType(6);
pwr_smallbuttoncenter59.dd.setAccess(65532);
pwr_smallbuttoncenter59.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_smallbuttoncenter59.dd, "$object.Actuator.Mode.OpNoStopButton##Boolean",0)
,new GeDynInvisible(pwr_smallbuttoncenter59.dd, "$object.Actuator.Mode.ManOrdHide##Boolean",0)
,new GeDynInvisible(pwr_smallbuttoncenter59.dd, "$object.Actuator.Mode.ManOrdDim##Boolean",1)
,new GeDynPopupMenu(pwr_smallbuttoncenter59.dd, "$object.Actuator.Mode.OpManStop")
,new GeDynSetDig(pwr_smallbuttoncenter59.dd, "$object.Actuator.Mode.OpManDecr##Boolean")
});
pwr_smallbuttoncenter59.setAnnot1("Decr");
pwr_smallbuttoncenter60.dd.setDynType(129);
pwr_smallbuttoncenter60.dd.setActionType(6);
pwr_smallbuttoncenter60.dd.setAccess(65532);
pwr_smallbuttoncenter60.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_smallbuttoncenter60.dd, "$object.Actuator.Mode.OpNoStopButton##Boolean",0)
,new GeDynInvisible(pwr_smallbuttoncenter60.dd, "$object.Actuator.Mode.ManOrdHide##Boolean",0)
,new GeDynInvisible(pwr_smallbuttoncenter60.dd, "$object.Actuator.Mode.ManOrdDim##Boolean",1)
,new GeDynPopupMenu(pwr_smallbuttoncenter60.dd, "$object.Actuator.Mode.OpManStart")
,new GeDynSetDig(pwr_smallbuttoncenter60.dd, "$object.Actuator.Mode.OpManIncr##Boolean")
});
pwr_smallbuttoncenter60.setAnnot1("Incr");
grp207_61.dd.setDynType(129);
grp207_61.dd.setActionType(0);
grp207_61.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(grp207_61.dd, "$object.ExternOrdHide##Boolean",0)
});
pwr_smallbuttoncenter62.dd.setDynType(129);
pwr_smallbuttoncenter62.dd.setActionType(6);
pwr_smallbuttoncenter62.dd.setAccess(65532);
pwr_smallbuttoncenter62.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_smallbuttoncenter62.dd, "$object.Actuator.Mode.ManAutoHide##Boolean",0)
,new GeDynInvisible(pwr_smallbuttoncenter62.dd, "$object.Actuator.Mode.AutoModDim##Boolean",1)
,new GeDynPopupMenu(pwr_smallbuttoncenter62.dd, "$object.Actuator.Mode.OpAuto")
,new GeDynSetDig(pwr_smallbuttoncenter62.dd, "$object.Actuator.Mode.OpAuto##Boolean")
});
pwr_smallbuttoncenter62.setAnnot1("Auto");
pwr_indsquare66.dd.setDynType(5);
pwr_indsquare66.dd.setActionType(2);
pwr_indsquare66.dd.setAccess(65532);
pwr_indsquare66.dd.setElements(new GeDynElemIfc[] {
new GeDynDigLowColor(pwr_indsquare66.dd, "$object.Actuator.OrderIncr.ActualValue##Boolean",29)
,new GeDynPopupMenu(pwr_indsquare66.dd, "$object.Actuator.OrderIncr")
});
pwr_indsquare67.dd.setDynType(5);
pwr_indsquare67.dd.setActionType(2);
pwr_indsquare67.dd.setAccess(65532);
pwr_indsquare67.dd.setElements(new GeDynElemIfc[] {
new GeDynDigLowColor(pwr_indsquare67.dd, "$object.Actuator.OrderDecr.ActualValue##Boolean",29)
,new GeDynPopupMenu(pwr_indsquare67.dd, "$object.Actuator.OrderDecr")
});
pwr_valvecontrol270.dd.setDynType(1034);
pwr_valvecontrol270.dd.setActionType(0);
pwr_valvecontrol270.dd.setElements(new GeDynElemIfc[] {
new GeDynDigColor(pwr_valvecontrol270.dd, "$object.Actuator.IndError##Boolean",41)
,new GeDynDigColor(pwr_valvecontrol270.dd, "$object.Actuator.IndWarning##Boolean",30)
,new GeDynValue(pwr_valvecontrol270.dd, "$object.Mode.IndMode##String8","%s")
});
pwr_mbup71.dd.setDynType(129);
pwr_mbup71.dd.setActionType(8256);
pwr_mbup71.dd.setAccess(33619967);
pwr_mbup71.dd.setElements(new GeDynElemIfc[] {
new GeDynInvisible(pwr_mbup71.dd, "$cmd(check isattribute/object=$object)",0)
,new GeDynCommand(pwr_mbup71.dd, "open graph/class/parent/instance=$object")
,new GeDynTipText(pwr_mbup71.dd, JopLang.transl("Open parent object graph"))
});
engine.setFrameReady();
}
class LocalPanel extends JPanel {
public LocalPanel() {}
int fillColor = 9999;
int originalFillColor = 9999;
int textColor = 9999;
int originalTextColor = 9999;
int borderColor = 9999;
int colorTone = 0;
int originalColorTone = 0;
int colorShift = 0;
int originalColorShift = 0;
int colorBrightness = 0;
int originalColorBrightness = 0;
int colorIntensity = 0;
int originalColorIntensity = 0;
int colorInverse = 0;
int originalColorInverse = 0;
int shadow = 0;
boolean dimmed = false;
public void setColorTone( int colorTone) {
this.colorTone = colorTone;
originalColorTone = colorTone;
}
public int getColorTone() {
return colorTone;
}
public void setColorShift( int colorShift) {
this.colorShift = colorShift;
originalColorShift = colorShift;
}
public int getColorShift() {
return colorShift;
}
public void setColorBrightness( int colorBrightness) {
this.colorBrightness = colorBrightness;
originalColorBrightness = colorBrightness;
}
public int getColorBrightness() {
return colorBrightness;
}
public void setColorIntensity( int colorIntensity) {
this.colorIntensity = colorIntensity;
originalColorIntensity = colorIntensity;
}
public int getColorIntensity() {
return colorIntensity;
}
public void setFillColor( int fillColor) {
this.fillColor = fillColor;
this.originalFillColor = fillColor;
}
public void resetFillColor() {
fillColor = originalFillColor;
}
public int getFillColor() {
return fillColor;
}
public void setBorderColor( int borderColor) {
this.borderColor = borderColor;
}
public int getBorderColor() {
return borderColor;
}
public int original_width = 536;
public int original_height = 689;
double rotate;
public void setRotate( double rotate) {
if ( rotate < 0)
this.rotate = rotate % 360 + 360;
else
this.rotate = rotate % 360;
}
public double getRotate() { return rotate;}
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2.00003F, 22.5515F, 532.841F, 22.4305F),
new Line2D.Float( 360.844F, 329.042F, 17.5983F, 329.042F),
new Rectangle2D.Float(16.9999F, 304.139F, 348.236F, 121.555F),
new Polygon( new int[] { 17, 365, 365, 18, 18, 17}, new int[] { 304, 304, 305, 305, 425, 426}, 6),
new Polygon( new int[] { 365, 365, 365, 365, 18, 17}, new int[] { 426, 304, 305, 425, 425, 426}, 6),
new Rectangle2D.Float(370.942F, 98.9998F, 154.683F, 327.444F),
new Polygon( new int[] { 371, 526, 525, 372, 372, 371}, new int[] { 99, 99, 100, 100, 426, 426}, 6),
new Polygon( new int[] { 526, 526, 525, 525, 372, 371}, new int[] { 426, 99, 100, 426, 426, 426}, 6),
new Rectangle2D.Float(16.9999F, 98.9982F, 348.236F, 197.211F),
new Polygon( new int[] { 17, 365, 364, 18, 18, 17}, new int[] { 99, 99, 100, 100, 295, 296}, 6),
new Polygon( new int[] { 365, 365, 364, 364, 18, 17}, new int[] { 296, 99, 100, 295, 295, 296}, 6),
new Line2D.Float( 509.956F, 181F, 447.87F, 181F),
new Line2D.Float( 509.956F, 229F, 447.87F, 229F),
new Line2D.Float( 509.956F, 276F, 447.87F, 276F),
new Line2D.Float( 509.956F, 325F, 447.87F, 325F),
new Line2D.Float( 151.003F, 425.199F, 151.003F, 327.921F),
new Rectangle2D.Float(90F, 144F, 82F, 6F),
new Polygon( new int[] { 90, 172, 170, 92, 92, 90}, new int[] { 144, 144, 146, 146, 148, 150}, 6),
new Polygon( new int[] { 172, 172, 170, 170, 92, 90}, new int[] { 150, 144, 146, 148, 148, 150}, 6),
new Rectangle2D.Float(209F, 144F, 82F, 6F),
new Polygon( new int[] { 209, 291, 289, 211, 211, 209}, new int[] { 144, 144, 146, 146, 148, 150}, 6),
new Polygon( new int[] { 291, 291, 289, 289, 211, 209}, new int[] { 150, 144, 146, 148, 148, 150}, 6),
};
public void paint(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
Component c;
Point p;
paintComponent(g);
for ( int i = 0; i < getComponentCount(); i++) {
AffineTransform save = g.getTransform();
c = getComponent(i);
p = c.getLocation();
g.translate((int)p.getX(), (int)p.getY());
c.paint(g);
g.setTransform(save);
}
}
public void paintComponent(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
double scaleWidth = (1.0*width/original_width);
double scaleHeight = (1.0*height/original_height);
AffineTransform save = g.getTransform();
g.setColor(getBackground());
g.fill(new Rectangle(0,0,getWidth(),getHeight()));
g.transform( AffineTransform.getScaleInstance( scaleWidth, scaleHeight)); // scaletest
AffineTransform save_tmp;
{
GradientPaint gp = new GradientPaint( 2.00003F,44.982F, GeColor.getColor(31,colorTone,colorShift,colorIntensity,0, colorInverse, fillColor, dimmed),
2.00003F,22.5515F,GeColor.getColor(31,colorTone,colorShift,colorIntensity,-1, colorInverse, fillColor, dimmed),true);
g.setPaint(gp);
}
g.fill( shapes[0]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(35, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[1]);
{
int fcolor = GeColor.getDrawtype(31, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[3]);
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[4]);
}
{
int fcolor = GeColor.getDrawtype(31, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[6]);
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[7]);
}
{
int fcolor = GeColor.getDrawtype(31, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[9]);
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[10]);
}
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont(new Font("Helvetica", Font.PLAIN, 12));
g.drawString( JopLang.transl("Position"),454, 119);
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont(new Font("Helvetica", Font.PLAIN, 12));
g.drawString( JopLang.transl("%"),410, 165);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[11]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[12]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[13]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[14]);
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont(new Font("Helvetica", Font.PLAIN, 12));
g.drawString( JopLang.transl("Mode"),37, 324);
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont(new Font("Helvetica", Font.BOLD, 12));
g.drawString( JopLang.transl("Actuator"),97, 500);
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont(new Font("Helvetica", Font.BOLD, 12));
g.drawString( JopLang.transl("Valve"),97, 601);
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont(new Font("Helvetica", Font.BOLD, 12));
g.drawString( JopLang.transl("Decr"),188, 375);
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont(new Font("Helvetica", Font.BOLD, 12));
g.drawString( JopLang.transl("Incr"),188, 352);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[15]);
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont(new Font("Helvetica", Font.PLAIN, 12));
g.drawString( JopLang.transl("Order incr"),38, 199);
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont(new Font("Helvetica", Font.PLAIN, 12));
g.drawString( JopLang.transl("Order decr"),38, 219);
{
int fcolor = GeColor.getDrawtype(74, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[16]);
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[17]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[18]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[16]);
{
int fcolor = GeColor.getDrawtype(74, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[19]);
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[20]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[21]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[19]);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_indsquare extends GeComponent {
// Dimension size;
public pwr_indsquare( JopSession session)
{
super( session);
size = new Dimension( 16, 17);
}
public int original_width = 16;
public int original_height = 17;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 12F, 13F),
new Polygon( new int[] { 2, 14, 12, 4, 4, 2}, new int[] { 2, 2, 4, 4, 13, 15}, 6),
new Polygon( new int[] { 14, 14, 12, 12, 4, 2}, new int[] { 15, 2, 4, 13, 13, 15}, 6),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(293, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,12F,13F, false,293, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_indround extends GeComponent {
// Dimension size;
public pwr_indround( JopSession session)
{
super( session);
size = new Dimension( 18, 18);
}
public int original_width = 18;
public int original_height = 18;
Shape[] shapes = new Shape[] {
new Arc2D.Float(2F, 2F, 14F, 14F, 35F, 140F, Arc2D.PIE),
new Arc2D.Float(2F, 2F, 14F, 14F, 215F, 140F, Arc2D.PIE),
new Arc2D.Float(2F, 2F, 14F, 14F, -5F, 40F, Arc2D.PIE),
new Arc2D.Float(2F, 2F, 14F, 14F, 175F, 40F, Arc2D.PIE),
new Arc2D.Float(4.1F, 4.1F, 9.8F, 9.8F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(2F, 2F, 14F, 14F, 0F, 360F, Arc2D.PIE),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
((Arc2D)shapes[0]).setArcType(Arc2D.PIE);
((Arc2D)shapes[1]).setArcType(Arc2D.PIE);
((Arc2D)shapes[2]).setArcType(Arc2D.PIE);
((Arc2D)shapes[3]).setArcType(Arc2D.PIE);
((Arc2D)shapes[4]).setArcType(Arc2D.PIE);
{
int fcolor = GeColor.getDrawtype(293, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( shadow != 0) {
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[0]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[2]);
g.fill( shapes[3]);
g.fill( shapes[4]);
} else {
GeGradient.paint( g, 9,2,-2,2F,2F,14F,14F, false,293, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[5]);
GeGradient.paint( g, gradient,2,-2,2F,2F,14F,14F, false,293, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[4]);
}
} else {
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[5]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,14F,14F, false,293, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[5]);
}
}
}
((Arc2D)shapes[5]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[5]);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_valuelong extends GeComponent {
// Dimension size;
public pwr_valuelong( JopSession session)
{
super( session);
size = new Dimension( 536, 18);
annot1Font = new Font("Helvetica", Font.BOLD, 10);
}
int annot1Color = 0;
public String getAnnot1() { return annot1;}
public void setAnnot1( String s) { annot1 = JopLang.transl(s);}
public void setAnnot1Font( Font font) { annot1Font = font;}
public Font getAnnot1Font() { return annot1Font;}
public void setAnnot1Color( int color) { annot1Color = color;}
public int original_width = 536;
public int original_height = 18;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 532F, 14F),
new Polygon( new int[] { 2, 534, 533, 3, 3, 2}, new int[] { 2, 2, 3, 3, 15, 16}, 6),
new Polygon( new int[] { 534, 534, 533, 533, 3, 2}, new int[] { 16, 2, 3, 15, 15, 16}, 6),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(41, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,532F,14F, false,41, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
g.setColor(GeColor.getColor( annot1Color , colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont( annot1Font);
save_tmp = g.getTransform();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF);
g.transform( AffineTransform.getScaleInstance( original_width/width *
height/original_height, 1));
if ( annot1 != null)
g.drawString( annot1, 7 * original_height / height * width / original_width, 13F);
g.setTransform( save_tmp);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_valuesmall extends GeComponent {
// Dimension size;
public pwr_valuesmall( JopSession session)
{
super( session);
size = new Dimension( 50, 18);
annot1Font = new Font("Helvetica", Font.BOLD, 10);
}
int annot1Color = 0;
public String getAnnot1() { return annot1;}
public void setAnnot1( String s) { annot1 = JopLang.transl(s);}
public void setAnnot1Font( Font font) { annot1Font = font;}
public Font getAnnot1Font() { return annot1Font;}
public void setAnnot1Color( int color) { annot1Color = color;}
public int original_width = 50;
public int original_height = 18;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 46F, 14F),
new Polygon( new int[] { 2, 48, 47, 3, 3, 2}, new int[] { 2, 2, 3, 3, 15, 16}, 6),
new Polygon( new int[] { 48, 48, 47, 47, 3, 2}, new int[] { 16, 2, 3, 15, 15, 16}, 6),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(41, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,46F,14F, false,41, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
g.setColor(GeColor.getColor( annot1Color , colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont( annot1Font);
save_tmp = g.getTransform();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF);
g.transform( AffineTransform.getScaleInstance( original_width/width *
height/original_height, 1));
if ( annot1 != null)
g.drawString( annot1, 7 * original_height / height * width / original_width, 13F);
g.setTransform( save_tmp);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_valueinputreliefup extends GeTextField {
public pwr_valueinputreliefup( JopSession session)
{
super( session);
setFont( annotFont);
setFillColor( 41);
}
int original_width = 50;
int original_height = 18;
boolean fontSet = false;
public void paintComponent(Graphics g1) {
if ( !fontSet) {
float width = getWidth();
float height = getHeight();
setFont( annotFont.deriveFont((float)(height / original_height * annotFont.getSize())));
fontSet = true;
}
super.paintComponent( g1);
}
}
protected class pwr_sliderbackground3 extends GeComponent {
// Dimension size;
public pwr_sliderbackground3( JopSession session)
{
super( session);
size = new Dimension( 64, 244);
}
public int original_width = 64;
public int original_height = 244;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 60F, 240F),
new Polygon( new int[] { 2, 62, 61, 3, 3, 2}, new int[] { 2, 2, 3, 3, 241, 242}, 6),
new Polygon( new int[] { 62, 62, 61, 61, 3, 2}, new int[] { 242, 2, 3, 241, 241, 242}, 6),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(35, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,60F,240F, false,35, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[2]);
}
}
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_actuator extends GeComponent {
// Dimension size;
public pwr_actuator( JopSession session)
{
super( session);
size = new Dimension( 84, 54);
}
public int original_width = 84;
public int original_height = 54;
Shape[] shapes = new Shape[] {
new Polygon( new int[] { 72, 82, 82, 72, 72}, new int[] {30, 30, 40, 40, 30}, 5),
new Polygon( new int[] { 72, 82, 82, 72, 72}, new int[] {18, 18, 30, 30, 18}, 5),
new Polygon( new int[] { 72, 82, 82, 72, 72}, new int[] {8, 8, 18, 18, 8}, 5),
new Polygon( new int[] { 2, 12, 12, 2, 2}, new int[] {30, 30, 40, 40, 30}, 5),
new Polygon( new int[] { 2, 12, 12, 2, 2}, new int[] {18, 18, 30, 30, 18}, 5),
new Polygon( new int[] { 2, 12, 12, 2, 2}, new int[] {8, 8, 18, 18, 8}, 5),
new Rectangle2D.Float(2F, 8F, 10F, 32F),
new Rectangle2D.Float(44F, 46F, 8F, 6F),
new Rectangle2D.Float(32F, 46F, 12F, 6F),
new Rectangle2D.Float(34F, 46F, 4F, 6F),
new Rectangle2D.Float(32F, 46F, 20F, 6F),
new Rectangle2D.Float(12F, 2F, 60F, 44F),
new Polygon( new int[] { 12, 72, 69, 15, 15, 12}, new int[] { 2, 2, 5, 5, 43, 46}, 6),
new Polygon( new int[] { 72, 72, 69, 69, 15, 12}, new int[] { 46, 2, 5, 43, 43, 46}, 6),
new Rectangle2D.Float(72F, 8F, 10F, 32F),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity,-2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
}
{
int fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[1]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity,2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[2]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity,-2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[3]);
}
{
int fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[4]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity,2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[5]);
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[6]);
}
{
int fcolor = GeColor.getDrawtype(37, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[7]);
}
{
int fcolor = GeColor.getDrawtype(33, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[8]);
}
{
int fcolor = GeColor.getDrawtype(30, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[9]);
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[10]);
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[11]);
} else {
GeGradient.paint( g, gradient,2,-2,12F,2F,60F,44F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[11]);
}
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[12]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[13]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[11]);
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[14]);
}
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_basevalve extends GeComponent {
// Dimension size;
public pwr_basevalve( JopSession session)
{
super( session);
size = new Dimension( 52, 77);
pages = 3;
}
public int original_width = 52;
public int original_height = 77;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(20F, 6F, 12F, 14F),
new Polygon( new int[] { 20, 24, 24, 20, 20}, new int[] {6, 6, 20, 20, 6}, 5),
new Polygon( new int[] { 28, 32, 32, 28, 28}, new int[] {6, 6, 20, 20, 6}, 5),
new Rectangle2D.Float(20F, 6F, 12F, 14F),
new Polygon( new int[] { 20, 20, 18, 18, 34, 34, 32, 32, 20}, new int[] {64, 72, 72, 76, 76, 72, 72, 64, 64}, 9),
new Polygon( new int[] { 28, 28, 30, 30, 34, 34, 32, 32, 28}, new int[] {64, 72, 72, 76, 76, 72, 72, 64, 64}, 9),
new Polygon( new int[] { 24, 24, 22, 22, 18, 18, 20, 20, 24}, new int[] {64, 72, 72, 76, 76, 72, 72, 64, 64}, 9),
new Polygon( new int[] { 20, 20, 18, 18, 34, 34, 32, 32, 20}, new int[] {64, 72, 72, 76, 76, 72, 72, 64, 64}, 9),
new Arc2D.Float(2F, 18F, 48F, 48F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(2F, 18F, 48F, 48F, 0F, 120F, Arc2D.PIE),
new Arc2D.Float(2F, 18F, 48F, 48F, 200F, 40F, Arc2D.PIE),
new Arc2D.Float(2F, 18F, 48F, 48F, 0F, 360F, Arc2D.OPEN),
new Arc2D.Float(10F, 26F, 32F, 32F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(16F, 26F, 18F, 32F, 35F, 140F, Arc2D.PIE),
new Arc2D.Float(16F, 26F, 18F, 32F, 215F, 140F, Arc2D.PIE),
new Arc2D.Float(16F, 26F, 18F, 32F, -5F, 40F, Arc2D.PIE),
new Arc2D.Float(16F, 26F, 18F, 32F, 175F, 40F, Arc2D.PIE),
new Arc2D.Float(16.9F, 26.9F, 16.2F, 30.2F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(16F, 26F, 18F, 32F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(16F, 26F, 18F, 32F, 200F, 90F, Arc2D.PIE),
new Arc2D.Float(18.245F, 26.4901F, 20F, 32F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(24F, 32F, 12F, 24F, 0F, 360F, Arc2D.PIE),
new Polygon( new int[] { 28, 28, 30, 30, 32, 34, 36, 36, 30, 28}, new int[] {30, 56, 56, 40, 38, 38, 40, 34, 30, 30}, 10),
new Rectangle2D.Float(28F, 2F, 8F, 4.44445F),
new Rectangle2D.Float(16F, 2F, 12F, 4.44445F),
new Rectangle2D.Float(18F, 2F, 4F, 4.44445F),
new Rectangle2D.Float(16F, 2F, 20F, 4.44445F),
};
int original_width_p2 = 52;
int original_height_p2 = 77;
Shape[] shapes_p2 = new Shape[] {
new Rectangle2D.Float(20F, 6F, 12F, 14F),
new Polygon( new int[] { 20, 24, 24, 20, 20}, new int[] {6, 6, 20, 20, 6}, 5),
new Polygon( new int[] { 28, 32, 32, 28, 28}, new int[] {6, 6, 20, 20, 6}, 5),
new Rectangle2D.Float(20F, 6F, 12F, 14F),
new Polygon( new int[] { 20, 20, 18, 18, 34, 34, 32, 32, 20}, new int[] {64, 72, 72, 76, 76, 72, 72, 64, 64}, 9),
new Polygon( new int[] { 28, 28, 30, 30, 34, 34, 32, 32, 28}, new int[] {64, 72, 72, 76, 76, 72, 72, 64, 64}, 9),
new Polygon( new int[] { 24, 24, 22, 22, 18, 18, 20, 20, 24}, new int[] {64, 72, 72, 76, 76, 72, 72, 64, 64}, 9),
new Polygon( new int[] { 20, 20, 18, 18, 34, 34, 32, 32, 20}, new int[] {64, 72, 72, 76, 76, 72, 72, 64, 64}, 9),
new Arc2D.Float(2F, 18F, 48F, 48F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(2F, 18F, 48F, 48F, 0F, 120F, Arc2D.PIE),
new Arc2D.Float(2F, 18F, 48F, 48F, 200F, 40F, Arc2D.PIE),
new Arc2D.Float(2F, 18F, 48F, 48F, 0F, 360F, Arc2D.OPEN),
new Arc2D.Float(10F, 26F, 32F, 32F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(10.3107F, 26F, 27.2727F, 32F, 35F, 140F, Arc2D.PIE),
new Arc2D.Float(10.3107F, 26F, 27.2727F, 32F, 215F, 140F, Arc2D.PIE),
new Arc2D.Float(10.3107F, 26F, 27.2727F, 32F, -5F, 40F, Arc2D.PIE),
new Arc2D.Float(10.3107F, 26F, 27.2727F, 32F, 175F, 40F, Arc2D.PIE),
new Arc2D.Float(11.6744F, 27.3636F, 24.5454F, 29.2727F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(10.3107F, 26F, 27.2727F, 32F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(10.3107F, 26F, 27.2727F, 32F, 200F, 90F, Arc2D.PIE),
new Arc2D.Float(11.4244F, 26.4901F, 30.303F, 32F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(20.144F, 32F, 18.1818F, 24F, 0F, 360F, Arc2D.PIE),
new Polygon( new int[] { 26, 26, 29, 29, 32, 35, 38, 38, 29, 26}, new int[] {30, 56, 56, 40, 38, 38, 40, 34, 30, 30}, 10),
new Rectangle2D.Float(28F, 2F, 8F, 4.44445F),
new Rectangle2D.Float(16F, 2F, 12F, 4.44445F),
new Rectangle2D.Float(18F, 2F, 4F, 4.44445F),
new Rectangle2D.Float(16F, 2F, 20F, 4.44445F),
};
int original_width_p3 = 52;
int original_height_p3 = 77;
Shape[] shapes_p3 = new Shape[] {
new Rectangle2D.Float(20F, 6F, 12F, 14F),
new Polygon( new int[] { 20, 24, 24, 20, 20}, new int[] {6, 6, 20, 20, 6}, 5),
new Polygon( new int[] { 28, 32, 32, 28, 28}, new int[] {6, 6, 20, 20, 6}, 5),
new Rectangle2D.Float(20F, 6F, 12F, 14F),
new Polygon( new int[] { 20, 20, 18, 18, 34, 34, 32, 32, 20}, new int[] {64, 72, 72, 76, 76, 72, 72, 64, 64}, 9),
new Polygon( new int[] { 28, 28, 30, 30, 34, 34, 32, 32, 28}, new int[] {64, 72, 72, 76, 76, 72, 72, 64, 64}, 9),
new Polygon( new int[] { 24, 24, 22, 22, 18, 18, 20, 20, 24}, new int[] {64, 72, 72, 76, 76, 72, 72, 64, 64}, 9),
new Polygon( new int[] { 20, 20, 18, 18, 34, 34, 32, 32, 20}, new int[] {64, 72, 72, 76, 76, 72, 72, 64, 64}, 9),
new Arc2D.Float(2F, 18F, 48F, 48F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(2F, 18F, 48F, 48F, 0F, 120F, Arc2D.PIE),
new Arc2D.Float(2F, 18F, 48F, 48F, 200F, 40F, Arc2D.PIE),
new Arc2D.Float(2F, 18F, 48F, 48F, 0F, 360F, Arc2D.OPEN),
new Arc2D.Float(10F, 26F, 32F, 32F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(21.0463F, 26F, 7.02749F, 32F, 35F, 140F, Arc2D.PIE),
new Arc2D.Float(21.0463F, 26F, 7.02749F, 32F, 215F, 140F, Arc2D.PIE),
new Arc2D.Float(21.0463F, 26F, 7.02749F, 32F, -5F, 40F, Arc2D.PIE),
new Arc2D.Float(21.0463F, 26F, 7.02749F, 32F, 175F, 40F, Arc2D.PIE),
new Arc2D.Float(21.3977F, 26.3514F, 6.32474F, 31.2973F, 360F, 360F, Arc2D.PIE),
new Arc2D.Float(21.0463F, 26F, 7.02749F, 32F, 360F, 360F, Arc2D.PIE),
new Arc2D.Float(21.0463F, 26F, 7.02749F, 32F, 560F, 90F, Arc2D.PIE),
new Arc2D.Float(23.9369F, 26.4901F, 5.12422F, 32F, 360F, 360F, Arc2D.PIE),
new Arc2D.Float(24.7658F, 32F, 3.07453F, 24F, 360F, 360F, Arc2D.PIE),
new Polygon( new int[] { 26, 26, 26, 26, 27, 27, 28, 28, 26, 26}, new int[] {30, 56, 56, 40, 38, 38, 40, 34, 30, 30}, 10),
new Rectangle2D.Float(28F, 2F, 8F, 4.44445F),
new Rectangle2D.Float(16F, 2F, 12F, 4.44445F),
new Rectangle2D.Float(18F, 2F, 4F, 4.44445F),
new Rectangle2D.Float(16F, 2F, 20F, 4.44445F),
};
public void paintComponent(Graphics g1) {
switch ( page) {
case 2 :
paintComponent_p2(g1);
return;
case 3 :
paintComponent_p3(g1);
return;
default:
;
}
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity,2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[1]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity,-2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[2]);
}
{
int fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
}
{
int fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[4]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity,-2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[5]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity,2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[6]);
}
{
int fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[7]);
}
g.setColor(GeColor.getColor(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes[8]);
g.setColor(GeColor.getColor(37, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes[9]);
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes[10]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[11]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[11]);
((Arc2D)shapes[12]).setArcType(Arc2D.PIE);
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes[12]);
((Arc2D)shapes[12]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[12]);
((Arc2D)shapes[12]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[12]);
((Arc2D)shapes[13]).setArcType(Arc2D.PIE);
((Arc2D)shapes[14]).setArcType(Arc2D.PIE);
((Arc2D)shapes[15]).setArcType(Arc2D.PIE);
((Arc2D)shapes[16]).setArcType(Arc2D.PIE);
((Arc2D)shapes[17]).setArcType(Arc2D.PIE);
{
int fcolor = GeColor.getDrawtype(31, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( shadow != 0) {
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[13]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[14]);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[15]);
g.fill( shapes[16]);
g.fill( shapes[17]);
} else {
GeGradient.paint( g, 9,2,-2,16F,26F,18F,32F, false,31, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[18]);
GeGradient.paint( g, gradient,2,-2,16F,26F,18F,32F, false,31, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[17]);
}
} else {
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[18]);
} else {
GeGradient.paint( g, gradient,2,-2,16F,26F,18F,32F, false,31, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[18]);
}
}
}
((Arc2D)shapes[18]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[18]);
((Arc2D)shapes[19]).setArcType(Arc2D.PIE);
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes[19]);
((Arc2D)shapes[19]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[19]);
((Arc2D)shapes[19]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[19]);
((Arc2D)shapes[20]).setArcType(Arc2D.PIE);
g.setColor(GeColor.getColor(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes[20]);
((Arc2D)shapes[20]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[20]);
((Arc2D)shapes[20]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[20]);
g.setColor(GeColor.getColor(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes[21]);
{
int fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[22]);
}
{
int fcolor = GeColor.getDrawtype(37, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[23]);
}
{
int fcolor = GeColor.getDrawtype(33, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[24]);
}
{
int fcolor = GeColor.getDrawtype(30, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[25]);
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[26]);
}
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public void paintComponent_p2(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p2[0]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity,2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p2[1]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity,-2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p2[2]);
}
{
int fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p2[3]);
}
{
int fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p2[4]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity,-2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p2[5]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity,2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p2[6]);
}
{
int fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p2[7]);
}
g.setColor(GeColor.getColor(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes_p2[8]);
g.setColor(GeColor.getColor(37, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes_p2[9]);
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes_p2[10]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p2[11]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p2[11]);
((Arc2D)shapes_p2[12]).setArcType(Arc2D.PIE);
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes_p2[12]);
((Arc2D)shapes_p2[12]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p2[12]);
((Arc2D)shapes_p2[12]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p2[12]);
((Arc2D)shapes_p2[13]).setArcType(Arc2D.PIE);
((Arc2D)shapes_p2[14]).setArcType(Arc2D.PIE);
((Arc2D)shapes_p2[15]).setArcType(Arc2D.PIE);
((Arc2D)shapes_p2[16]).setArcType(Arc2D.PIE);
((Arc2D)shapes_p2[17]).setArcType(Arc2D.PIE);
{
int fcolor = GeColor.getDrawtype(31, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( shadow != 0) {
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes_p2[13]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes_p2[14]);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p2[15]);
g.fill( shapes_p2[16]);
g.fill( shapes_p2[17]);
} else {
GeGradient.paint( g, 9,2,-2,10.3107F,26F,27.2727F,32F, false,31, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes_p2[18]);
GeGradient.paint( g, gradient,2,-2,10.3107F,26F,27.2727F,32F, false,31, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes_p2[17]);
}
} else {
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p2[18]);
} else {
GeGradient.paint( g, gradient,2,-2,10.3107F,26F,27.2727F,32F, false,31, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes_p2[18]);
}
}
}
((Arc2D)shapes_p2[18]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p2[18]);
((Arc2D)shapes_p2[19]).setArcType(Arc2D.PIE);
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes_p2[19]);
((Arc2D)shapes_p2[19]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p2[19]);
((Arc2D)shapes_p2[19]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p2[19]);
((Arc2D)shapes_p2[20]).setArcType(Arc2D.PIE);
g.setColor(GeColor.getColor(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes_p2[20]);
((Arc2D)shapes_p2[20]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p2[20]);
((Arc2D)shapes_p2[20]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p2[20]);
g.setColor(GeColor.getColor(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes_p2[21]);
{
int fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p2[22]);
}
{
int fcolor = GeColor.getDrawtype(37, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p2[23]);
}
{
int fcolor = GeColor.getDrawtype(33, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p2[24]);
}
{
int fcolor = GeColor.getDrawtype(30, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p2[25]);
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p2[26]);
}
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public void paintComponent_p3(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p3[0]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity,2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p3[1]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity,-2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p3[2]);
}
{
int fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p3[3]);
}
{
int fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p3[4]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity,-2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p3[5]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity,2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p3[6]);
}
{
int fcolor = GeColor.getDrawtype(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p3[7]);
}
g.setColor(GeColor.getColor(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes_p3[8]);
g.setColor(GeColor.getColor(37, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes_p3[9]);
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes_p3[10]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p3[11]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p3[11]);
((Arc2D)shapes_p3[12]).setArcType(Arc2D.PIE);
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes_p3[12]);
((Arc2D)shapes_p3[12]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p3[12]);
((Arc2D)shapes_p3[12]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p3[12]);
((Arc2D)shapes_p3[13]).setArcType(Arc2D.PIE);
((Arc2D)shapes_p3[14]).setArcType(Arc2D.PIE);
((Arc2D)shapes_p3[15]).setArcType(Arc2D.PIE);
((Arc2D)shapes_p3[16]).setArcType(Arc2D.PIE);
((Arc2D)shapes_p3[17]).setArcType(Arc2D.PIE);
{
int fcolor = GeColor.getDrawtype(31, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( shadow != 0) {
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes_p3[13]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes_p3[14]);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p3[15]);
g.fill( shapes_p3[16]);
g.fill( shapes_p3[17]);
} else {
GeGradient.paint( g, 9,2,-2,21.0463F,26F,7.02749F,32F, false,31, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes_p3[18]);
GeGradient.paint( g, gradient,2,-2,21.0463F,26F,7.02749F,32F, false,31, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes_p3[17]);
}
} else {
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p3[18]);
} else {
GeGradient.paint( g, gradient,2,-2,21.0463F,26F,7.02749F,32F, false,31, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes_p3[18]);
}
}
}
((Arc2D)shapes_p3[18]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p3[18]);
((Arc2D)shapes_p3[19]).setArcType(Arc2D.PIE);
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes_p3[19]);
((Arc2D)shapes_p3[19]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p3[19]);
((Arc2D)shapes_p3[19]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p3[19]);
((Arc2D)shapes_p3[20]).setArcType(Arc2D.PIE);
g.setColor(GeColor.getColor(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes_p3[20]);
((Arc2D)shapes_p3[20]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p3[20]);
((Arc2D)shapes_p3[20]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p3[20]);
g.setColor(GeColor.getColor(34, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed));
g.fill( shapes_p3[21]);
{
int fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p3[22]);
}
{
int fcolor = GeColor.getDrawtype(37, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p3[23]);
}
{
int fcolor = GeColor.getDrawtype(33, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p3[24]);
}
{
int fcolor = GeColor.getDrawtype(30, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes_p3[25]);
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes_p3[26]);
}
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_smallbuttoncenter extends GeComponent {
// Dimension size;
public pwr_smallbuttoncenter( JopSession session)
{
super( session);
size = new Dimension( 47, 21);
annot1Font = new Font("Helvetica", Font.BOLD, 12);
}
int annot1Color = 0;
public String getAnnot1() { return annot1;}
public void setAnnot1( String s) { annot1 = JopLang.transl(s);}
public void setAnnot1Font( Font font) { annot1Font = font;}
public Font getAnnot1Font() { return annot1Font;}
public void setAnnot1Color( int color) { annot1Color = color;}
public int original_width = 47;
public int original_height = 21;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 44F, 17F),
new Polygon( new int[] { 2, 46, 43, 5, 5, 2}, new int[] { 2, 2, 5, 5, 16, 19}, 6),
new Polygon( new int[] { 46, 46, 43, 43, 5, 2}, new int[] { 19, 2, 5, 16, 16, 19}, 6),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(102, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,1,-1,2F,2F,44F,17F, false,102, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
FontRenderContext frc = g.getFontRenderContext();
g.setColor(GeColor.getColor( annot1Color , colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont( annot1Font);
save_tmp = g.getTransform();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF);
g.transform( AffineTransform.getScaleInstance( original_width/width *
height/original_height, 1));
if ( annot1 != null)
g.drawString( annot1, 24 * original_height / height * width / original_width- (float)g.getFont().getStringBounds(annot1, frc).getWidth()/2, 15F);
g.setTransform( save_tmp);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_menubar2 extends GeComponent {
// Dimension size;
public pwr_menubar2( JopSession session)
{
super( session);
size = new Dimension( 554, 24);
}
public int original_width = 554;
public int original_height = 24;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 550F, 20F),
new Polygon( new int[] { 2, 2, 552, 552, 2}, new int[] {22, 20, 20, 22, 22}, 5),
new Line2D.Float( 552F, 22F, 2F, 22F),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(31, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(31, colorTone,
colorShift, colorIntensity,-2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(31, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[1]);
}
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[2]);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_pulldownmenu2 extends GeComponent {
// Dimension size;
public pwr_pulldownmenu2( JopSession session)
{
super( session);
size = new Dimension( 64, 24);
annot1Font = new Font("Helvetica", Font.PLAIN, 12);
}
int annot1Color = 0;
public String getAnnot1() { return annot1;}
public void setAnnot1( String s) { annot1 = JopLang.transl(s);}
public void setAnnot1Font( Font font) { annot1Font = font;}
public Font getAnnot1Font() { return annot1Font;}
public void setAnnot1Color( int color) { annot1Color = color;}
public int original_width = 64;
public int original_height = 24;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 60F, 20F),
new Polygon( new int[] { 2, 2, 62, 62, 2}, new int[] {20, 22, 22, 20, 20}, 5),
new Line2D.Float( 62F, 22F, 2F, 22F),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(31, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
}
{
int fcolor;
if ( shadow != 0)
fcolor = GeColor.getDrawtype(31, colorTone,
colorShift, colorIntensity,-2, colorInverse, fillColor, dimmed);
else
fcolor = GeColor.getDrawtype(31, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[1]);
}
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[2]);
g.setColor(GeColor.getColor( annot1Color , colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont( annot1Font);
save_tmp = g.getTransform();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF);
g.transform( AffineTransform.getScaleInstance( original_width/width *
height/original_height, 1));
if ( annot1 != null)
g.drawString( annot1, 7 * original_height / height * width / original_width, 17F);
g.setTransform( save_tmp);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbopenobject extends GeComponent {
// Dimension size;
public pwr_mbopenobject( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Rectangle2D.Float(6F, 6F, 8F, 8F),
new Polygon( new int[] { 6, 14, 14, 6, 6, 6}, new int[] { 6, 6, 6, 6, 14, 14}, 6),
new Polygon( new int[] { 14, 14, 14, 14, 6, 6}, new int[] { 14, 6, 6, 14, 14, 14}, 6),
new Line2D.Float( 14F, 8F, 6F, 8F),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
{
int fcolor = GeColor.getDrawtype(38, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[4]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[5]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
}
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[6]);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbtrend extends GeComponent {
// Dimension size;
public pwr_mbtrend( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Line2D.Float( 14F, 14F, 6F, 14F),
new Line2D.Float( 14F, 6F, 14F, 14F),
new Polygon( new int[] { 14, 12, 10, 7, 5, 7, 10, 12}, new int[] {11, 11, 9, 11, 9, 11, 9, 11}, 8),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[4]);
{
int fcolor = GeColor.getDrawtype(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[5]);
}
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbfast extends GeComponent {
// Dimension size;
public pwr_mbfast( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Line2D.Float( 15.4286F, 14F, 5.99999F, 14F),
new Line2D.Float( 6F, 6F, 6F, 14F),
new Polygon( new int[] { 6, 8, 11, 13, 15, 13, 11, 8}, new int[] {10, 9, 12, 11, 12, 11, 12, 9}, 8),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[4]);
{
int fcolor = GeColor.getDrawtype(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[5]);
}
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbphoto extends GeComponent {
// Dimension size;
public pwr_mbphoto( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Rectangle2D.Float(6F, 6F, 8F, 8F),
new Polygon( new int[] { 6, 14, 14, 6, 6, 6}, new int[] { 6, 6, 6, 6, 14, 14}, 6),
new Polygon( new int[] { 14, 14, 14, 14, 6, 6}, new int[] { 14, 6, 6, 14, 14, 14}, 6),
new Arc2D.Float(9F, 8F, 3F, 3F, 35F, 140F, Arc2D.PIE),
new Arc2D.Float(9F, 8F, 3F, 3F, 215F, 140F, Arc2D.PIE),
new Arc2D.Float(9F, 8F, 3F, 3F, -5F, 40F, Arc2D.PIE),
new Arc2D.Float(9F, 8F, 3F, 3F, 175F, 40F, Arc2D.PIE),
new Arc2D.Float(9.15F, 8.15F, 2.7F, 2.7F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(9F, 8F, 3F, 3F, 0F, 360F, Arc2D.PIE),
new Polygon( new int[] { 9, 9, 14, 14, 9}, new int[] {14, 10, 10, 14, 14}, 5),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
{
int fcolor = GeColor.getDrawtype(2, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[4]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[5]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
}
{
int fcolor = GeColor.getDrawtype(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( shadow != 0) {
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[6]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[7]);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[8]);
g.fill( shapes[9]);
g.fill( shapes[10]);
} else {
GeGradient.paint( g, 9,2,-2,9F,8F,3F,3F, false,39, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[11]);
GeGradient.paint( g, gradient,2,-2,9F,8F,3F,3F, false,39, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[10]);
}
} else {
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[11]);
} else {
GeGradient.paint( g, gradient,2,-2,9F,8F,3F,3F, false,39, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[11]);
}
}
}
{
int fcolor = GeColor.getDrawtype(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[12]);
}
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbdatasheet extends GeComponent {
// Dimension size;
public pwr_mbdatasheet( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Rectangle2D.Float(7F, 6F, 6F, 8F),
new Polygon( new int[] { 7, 13, 13, 7, 7, 7}, new int[] { 6, 6, 6, 6, 14, 14}, 6),
new Polygon( new int[] { 13, 13, 13, 13, 7, 7}, new int[] { 14, 6, 6, 14, 14, 14}, 6),
new Polygon( new int[] { 7, 9, 7, 7}, new int[] {10, 6, 6, 10}, 4),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
{
int fcolor = GeColor.getDrawtype(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[4]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[5]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
}
{
int fcolor = GeColor.getDrawtype(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[6]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[6]);
}
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbopenplc extends GeComponent {
// Dimension size;
public pwr_mbopenplc( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Rectangle2D.Float(8F, 6F, 4F, 8F),
new Polygon( new int[] { 8, 12, 12, 8, 8, 8}, new int[] { 6, 6, 6, 6, 14, 14}, 6),
new Polygon( new int[] { 12, 12, 12, 12, 8, 8}, new int[] { 14, 6, 6, 14, 14, 14}, 6),
new Line2D.Float( 8F, 8F, 6F, 8F),
new Line2D.Float( 8F, 12F, 6F, 12F),
new Line2D.Float( 14F, 8F, 12F, 8F),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
{
int fcolor = GeColor.getDrawtype(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[4]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[5]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
}
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[6]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[7]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[8]);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbcircuitdiagram extends GeComponent {
// Dimension size;
public pwr_mbcircuitdiagram( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Rectangle2D.Float(5F, 7F, 10F, 7F),
new Polygon( new int[] { 5, 15, 15, 5, 5, 5}, new int[] { 7, 7, 7, 7, 14, 14}, 6),
new Polygon( new int[] { 15, 15, 15, 15, 5, 5}, new int[] { 14, 7, 7, 14, 14, 14}, 6),
new Line2D.Float( 15F, 13F, 5F, 13F),
new Line2D.Float( 11F, 9F, 5F, 9F),
new Line2D.Float( 11F, 11F, 11F, 9F),
new Rectangle2D.Float(7F, 11F, 4F, 1F),
new Polygon( new int[] { 7, 11, 11, 7, 7, 7}, new int[] { 11, 11, 11, 11, 12, 12}, 6),
new Polygon( new int[] { 11, 11, 11, 11, 7, 7}, new int[] { 12, 11, 11, 12, 12, 12}, 6),
new Line2D.Float( 15F, 10F, 11F, 10F),
new Line2D.Float( 15F, 8F, 11F, 8F),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
{
int fcolor = GeColor.getDrawtype(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[4]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[5]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
}
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[6]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[7]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[8]);
{
int fcolor = GeColor.getDrawtype(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[9]);
} else {
GeGradient.paint( g, gradient,2,-2,7F,11F,4F,1F, false,39, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[9]);
}
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[10]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[11]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[9]);
}
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[12]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[13]);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbrtnavigator extends GeComponent {
// Dimension size;
public pwr_mbrtnavigator( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Rectangle2D.Float(6F, 6F, 4F, 3F),
new Polygon( new int[] { 6, 10, 10, 6, 6, 6}, new int[] { 6, 6, 6, 6, 9, 9}, 6),
new Polygon( new int[] { 10, 10, 10, 10, 6, 6}, new int[] { 9, 6, 6, 9, 9, 9}, 6),
new Rectangle2D.Float(8F, 10F, 4F, 5F),
new Polygon( new int[] { 8, 12, 12, 8, 8, 8}, new int[] { 10, 10, 10, 10, 15, 15}, 6),
new Polygon( new int[] { 12, 12, 12, 12, 8, 8}, new int[] { 15, 10, 10, 15, 15, 15}, 6),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
{
int fcolor = GeColor.getDrawtype(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[3]);
} else {
GeGradient.paint( g, gradient,2,-2,6F,6F,4F,3F, false,39, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[3]);
}
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[4]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[5]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
}
{
int fcolor = GeColor.getDrawtype(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[6]);
} else {
GeGradient.paint( g, gradient,2,-2,8F,10F,4F,5F, false,39, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[6]);
}
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[7]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[8]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[6]);
}
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbhelpclass extends GeComponent {
// Dimension size;
public pwr_mbhelpclass( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Polygon( new int[] { 8, 8, 12, 12, 10, 10, 10, 12, 12, 8}, new int[] {8, 7, 7, 10, 10, 12, 10, 10, 7, 7}, 10),
new Line2D.Float( 10F, 13.772F, 10F, 13F),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
{
int fcolor = GeColor.getDrawtype(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
}
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[4]);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbblockevents extends GeComponent {
// Dimension size;
public pwr_mbblockevents( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Line2D.Float( 10F, 13.772F, 10F, 13F),
new Line2D.Float( 10F, 11F, 10F, 6F),
new Line2D.Float( 14F, 14F, 6F, 6F),
new Line2D.Float( 14F, 6F, 6F, 14F),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[4]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[5]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[6]);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbhistevent extends GeComponent {
// Dimension size;
public pwr_mbhistevent( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Line2D.Float( 10F, 13.772F, 10F, 13F),
new Polygon( new int[] { 8, 6, 10, 14, 12, 14, 10, 6}, new int[] {14, 14, 6, 14, 14, 14, 6, 14}, 8),
new Line2D.Float( 10F, 11F, 10F, 8F),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
{
int fcolor = GeColor.getDrawtype(36, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[4]);
}
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[5]);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbnote extends GeComponent {
// Dimension size;
public pwr_mbnote( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Line2D.Float( 10F, 13.772F, 10F, 13F),
new Line2D.Float( 10F, 11F, 10F, 6F),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[4]);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbhelp extends GeComponent {
// Dimension size;
public pwr_mbhelp( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Line2D.Float( 10F, 6.772F, 10F, 6F),
new Line2D.Float( 10.8199F, 13F, 8.81989F, 13F),
new Polygon( new int[] { 10, 10, 9, 10}, new int[] {13, 9, 9, 9}, 4),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[4]);
{
int fcolor = GeColor.getDrawtype(2, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[5]);
}
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbsimulate extends GeComponent {
// Dimension size;
public pwr_mbsimulate( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Polygon( new int[] { 12, 7, 6, 14, 13, 5, 13, 14, 6, 7}, new int[] {6, 6, 8, 12, 14, 14, 14, 12, 8, 6}, 10),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
{
int fcolor = GeColor.getDrawtype(23, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[3]);
}
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_mbup extends GeComponent {
// Dimension size;
public pwr_mbup( JopSession session)
{
super( session);
size = new Dimension( 20, 20);
}
public int original_width = 20;
public int original_height = 20;
Shape[] shapes = new Shape[] {
new Rectangle2D.Float(2F, 2F, 16F, 16F),
new Polygon( new int[] { 2, 18, 16, 4, 4, 2}, new int[] { 2, 2, 4, 4, 16, 18}, 6),
new Polygon( new int[] { 18, 18, 16, 16, 4, 2}, new int[] { 18, 2, 4, 16, 16, 18}, 6),
new Polygon( new int[] { 4, 10, 16, 4}, new int[] {14, 5, 14, 14}, 4),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,2F,16F,16F, false,32, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
{
int fcolor = GeColor.getDrawtype(39, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[3]);
}
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class pwr_valvecontrol2 extends GeComponent {
// Dimension size;
public pwr_valvecontrol2( JopSession session)
{
super( session);
size = new Dimension( 66, 43);
annot1Font = new Font("Helvetica", Font.BOLD, 14);
}
int annot1Color = 0;
public String getAnnot1() { return annot1;}
public void setAnnot1( String s) { annot1 = JopLang.transl(s);}
public void setAnnot1Font( Font font) { annot1Font = font;}
public Font getAnnot1Font() { return annot1Font;}
public void setAnnot1Color( int color) { annot1Color = color;}
public int original_width = 66;
public int original_height = 43;
Shape[] shapes = new Shape[] {
new Polygon( new int[] { 2, 2, 22, 2}, new int[] {22, 42, 32, 22}, 4),
new Polygon( new int[] { 2, 4, 4, 2}, new int[] { 22, 25, 39,42}, 4),
new Polygon( new int[] { 2, 4, 18, 22}, new int[] { 42, 39, 32,32}, 4),
new Polygon( new int[] { 22, 18, 4, 2}, new int[] { 32, 32, 25,22}, 4),
new Polygon( new int[] { 2, 4, 74, -6}, new int[] { 22, 25, -1219915337,-16}, 4),
new Polygon( new int[] { 42, 42, 22, 42}, new int[] {22, 42, 32, 22}, 4),
new Polygon( new int[] { 42, 40, 40, 42}, new int[] { 22, 25, 39,42}, 4),
new Polygon( new int[] { 42, 40, 26, 22}, new int[] { 42, 39, 32,32}, 4),
new Polygon( new int[] { 22, 26, 40, 42}, new int[] { 32, 32, 25,22}, 4),
new Polygon( new int[] { 42, 40, 74, -6}, new int[] { 22, 25, -1219915337,-16}, 4),
new Arc2D.Float(12F, 2F, 20F, 20F, 35F, 140F, Arc2D.PIE),
new Arc2D.Float(12F, 2F, 20F, 20F, 215F, 140F, Arc2D.PIE),
new Arc2D.Float(12F, 2F, 20F, 20F, -5F, 40F, Arc2D.PIE),
new Arc2D.Float(12F, 2F, 20F, 20F, 175F, 40F, Arc2D.PIE),
new Arc2D.Float(14F, 4F, 16F, 16F, 0F, 360F, Arc2D.PIE),
new Arc2D.Float(12F, 2F, 20F, 20F, 0F, 360F, Arc2D.PIE),
new Rectangle2D.Float(44.3132F, 12.049F, 20F, 16F),
new Line2D.Float( 22F, 32F, 22F, 22F),
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
{
int fcolor = GeColor.getDrawtype(74, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[0]);
} else {
GeGradient.paint( g, gradient,2,-2,2F,22F,20F,20F, false,74, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[0]);
}
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[1]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[2]);
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[3]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[0]);
}
{
int fcolor = GeColor.getDrawtype(74, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[5]);
} else {
GeGradient.paint( g, gradient,2,-2,22F,22F,20F,20F, false,74, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[5]);
}
if ( shadow != 0) {
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[6]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[7]);
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[8]);
}
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[5]);
}
((Arc2D)shapes[10]).setArcType(Arc2D.PIE);
((Arc2D)shapes[11]).setArcType(Arc2D.PIE);
((Arc2D)shapes[12]).setArcType(Arc2D.PIE);
((Arc2D)shapes[13]).setArcType(Arc2D.PIE);
((Arc2D)shapes[14]).setArcType(Arc2D.PIE);
{
int fcolor = GeColor.getDrawtype(74, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, dimmed);
if ( shadow != 0) {
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.shiftColor( fcolor, -2, colorInverse));
g.fill( shapes[10]);
g.setColor(GeColor.shiftColor( fcolor, 2, colorInverse));
g.fill( shapes[11]);
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[12]);
g.fill( shapes[13]);
g.fill( shapes[14]);
} else {
GeGradient.paint( g, 9,2,-2,12F,2F,20F,20F, false,74, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[15]);
GeGradient.paint( g, gradient,2,-2,12F,2F,20F,20F, false,74, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[14]);
}
} else {
if ( gradient == GeGradient.eGradient_No) {
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[15]);
} else {
GeGradient.paint( g, gradient,2,-2,12F,2F,20F,20F, false,74, colorTone, colorShift, colorIntensity, colorInverse, fillColor, dimmed);
g.fill( shapes[15]);
}
}
}
((Arc2D)shapes[15]).setArcType(Arc2D.OPEN);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[15]);
{
int fcolor = 300;
g.setColor(GeColor.getColor( fcolor));
g.fill( shapes[16]);
}
g.setColor(GeColor.getColor( annot1Color , colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont( annot1Font);
save_tmp = g.getTransform();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF);
g.transform( AffineTransform.getScaleInstance( original_width/width *
height/original_height, 1));
if ( annot1 != null)
g.drawString( annot1, 44 * original_height / height * width / original_width, 27F);
g.setTransform( save_tmp);
g.setStroke( new BasicStroke(1F, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, dimmed));
g.draw( shapes[17]);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class Grp203_ extends GeComponent {
// Dimension size;
public Grp203_( JopSession session)
{
super( session);
size = new Dimension( 37, 18);
}
public int original_width = 37;
public int original_height = 18;
Shape[] shapes = new Shape[] {
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont(new Font("Helvetica", Font.BOLD, 12));
g.drawString( JopLang.transl("Local"),2, 13);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
protected class Grp207_ extends GeComponent {
// Dimension size;
public Grp207_( JopSession session)
{
super( session);
size = new Dimension( 40, 18);
}
public int original_width = 40;
public int original_height = 18;
Shape[] shapes = new Shape[] {
};
public void paintComponent(Graphics g1) {
animationCount = 1;
if ( !visible)
return;
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
if ( (dd.dynType & GeDyn.mDynType_Rotate) != 0 && dd.rotate != 0) {
g.rotate( Math.PI * dd.rotate/180,
(dd.x0 - getX())*original_width/width,
(dd.y0 - getY()) * original_height / height);
}
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
int rounds = 1;
if ( fillLevel != 1F)
rounds = 2;
int oldColor = 0;
for ( int i = 0; i < rounds; i++) {
if ( rounds == 2) {
switch ( i) {
case 0:
if ( levelColorTone != GeColor.COLOR_TONE_NO) {
oldColor = colorTone;
colorTone = levelColorTone;
}
else if ( levelFillColor != GeColor.COLOR_NO) {
oldColor = fillColor;
fillColor = levelFillColor;
}
break;
case 1:
if ( levelColorTone != GeColor.COLOR_TONE_NO)
colorTone = oldColor;
else if ( levelFillColor != GeColor.COLOR_NO)
fillColor = oldColor;
break;
}
switch ( levelDirection) {
case Ge.DIRECTION_UP:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,fillLevel*original_height+Ge.cJBean_Offset,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,original_width,fillLevel * original_height+Ge.cJBean_Offset));
break;
case Ge.DIRECTION_DOWN:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,original_width,(1-fillLevel)*original_height+Ge.cJBean_Offset));
else
g.setClip(new Rectangle2D.Float(0F,(1-fillLevel)*original_height+Ge.cJBean_Offset,original_width,original_height));
break;
case Ge.DIRECTION_RIGHT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(fillLevel*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
else
g.setClip(new Rectangle2D.Float(0F,0F,fillLevel*width+Ge.cJBean_Offset,height));
break;
case Ge.DIRECTION_LEFT:
if ( i == 0)
g.setClip(new Rectangle2D.Float(0F,0F,(1-fillLevel)*original_width+Ge.cJBean_Offset,original_height));
else
g.setClip(new Rectangle2D.Float((1-fillLevel)*original_width+Ge.cJBean_Offset,0F,original_width,original_height));
break;
}
}
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, textColor, dimmed));
g.setFont(new Font("Helvetica", Font.BOLD, 12));
g.drawString( JopLang.transl("Extern"),2, 13);
}
if ( rounds == 2)
g.setClip(null);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
public int getUtilityType() {
return JopUtility.GRAPH;
}
public PwrtObjid getUtilityObjid() {
if ( utilityAref != null)
return utilityAref.getObjid();
else
return null;
}
public PwrtAttrRef getUtilityAttrRef() {
return utilityAref;
}
public String getUtilityName() {
return this.getClass().getName();
}
}
| [
"claes.sjofors@proview.se"
] | claes.sjofors@proview.se |
9814b437953f736ce307f1c1f7666c8575ef1127 | 90a88709a5d9d61c3a63ae812374b17bb303b479 | /cn/ficos/Compiler/AST/AST.java | 97cf1d1232206e0047fc8992ae1d3763733c981c | [
"MIT"
] | permissive | YurongYou/MangoCompiler | 3e340d22390a7f0c8830d7e864692f5e02028edb | e878ffa957b4429cdb0e1ed186ca6e9fbb6edf0b | refs/heads/master | 2020-12-31T04:56:13.420610 | 2017-11-17T19:08:54 | 2017-11-17T19:12:45 | 58,605,659 | 3 | 0 | null | 2017-08-28T07:06:10 | 2016-05-12T03:50:42 | Java | UTF-8 | Java | false | false | 303 | java | package cn.ficos.Compiler.AST;
import cn.ficos.Compiler.Gadgets.Position;
/**
* The abstract node class in AST
*/
public abstract class AST {
private Position position;
AST(Position _pos) {
position = _pos;
}
public Position getPosition() {
return position;
}
} | [
"yurongyou@sjtu.edu.cn"
] | yurongyou@sjtu.edu.cn |
c35e7773ea22c477002650e95ee9950c6b809b12 | bc165cf4dd622ac83f95e107072ecb6e3eca3252 | /TextFactory/src/editorframework/TextVerifier.java | dec26323c6c8e59c9048c4bb3329bf4a8db98400 | [] | no_license | mjunior89/inf011-editor-framework | 0cd6652e3f96e2cf1be0bcb017b2cfcb7c81f2c9 | 38de2b3c53bd625160808a4dbfd741197d58e57c | refs/heads/master | 2021-01-10T06:45:54.593204 | 2016-02-25T03:59:17 | 2016-02-25T03:59:17 | 49,547,878 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | /*
* 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.
*/
package editorframework;
import editorframework.interfaces.IVerifier;
/**
*
* @author aluno
*/
public class TextVerifier implements IVerifier {
}
| [
"junior.finalfantasy@gmail.com"
] | junior.finalfantasy@gmail.com |
bc247883249c02a81cd3664dd9d8f1d651d56904 | a1e849b1e0e43833e63b546ed08c7a910907635e | /SR03-SOAP-Client-Create/src/beans/CategorieBean.java | 61a6c80b6ef1ef3ccc74d953ca26b1bb3d956d0c | [] | no_license | VincentKeller/SR03 | dec6782cc6fa8cea65775bad7f611ad5808b436f | 49b2ac2358a4d5c24d56df35dc8c627f4b6722e5 | refs/heads/master | 2021-01-18T17:26:58.286679 | 2016-06-17T12:09:18 | 2016-06-17T12:09:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,689 | java | /**
* CategorieBean.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package beans;
public class CategorieBean implements java.io.Serializable {
private beans.AnnonceBean[] anonces;
private int id;
private java.lang.String nom;
public CategorieBean() {
}
public CategorieBean(
beans.AnnonceBean[] anonces,
int id,
java.lang.String nom) {
this.anonces = anonces;
this.id = id;
this.nom = nom;
}
/**
* Gets the anonces value for this CategorieBean.
*
* @return anonces
*/
public beans.AnnonceBean[] getAnonces() {
return anonces;
}
/**
* Sets the anonces value for this CategorieBean.
*
* @param anonces
*/
public void setAnonces(beans.AnnonceBean[] anonces) {
this.anonces = anonces;
}
/**
* Gets the id value for this CategorieBean.
*
* @return id
*/
public int getId() {
return id;
}
/**
* Sets the id value for this CategorieBean.
*
* @param id
*/
public void setId(int id) {
this.id = id;
}
/**
* Gets the nom value for this CategorieBean.
*
* @return nom
*/
public java.lang.String getNom() {
return nom;
}
/**
* Sets the nom value for this CategorieBean.
*
* @param nom
*/
public void setNom(java.lang.String nom) {
this.nom = nom;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof CategorieBean)) return false;
CategorieBean other = (CategorieBean) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
((this.anonces==null && other.getAnonces()==null) ||
(this.anonces!=null &&
java.util.Arrays.equals(this.anonces, other.getAnonces()))) &&
this.id == other.getId() &&
((this.nom==null && other.getNom()==null) ||
(this.nom!=null &&
this.nom.equals(other.getNom())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getAnonces() != null) {
for (int i=0;
i<java.lang.reflect.Array.getLength(getAnonces());
i++) {
java.lang.Object obj = java.lang.reflect.Array.get(getAnonces(), i);
if (obj != null &&
!obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
_hashCode += getId();
if (getNom() != null) {
_hashCode += getNom().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(CategorieBean.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://beans", "CategorieBean"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("anonces");
elemField.setXmlName(new javax.xml.namespace.QName("http://beans", "anonces"));
elemField.setXmlType(new javax.xml.namespace.QName("http://beans", "AnnonceBean"));
elemField.setNillable(true);
elemField.setItemQName(new javax.xml.namespace.QName("http://DAO", "item"));
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("id");
elemField.setXmlName(new javax.xml.namespace.QName("http://beans", "id"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("nom");
elemField.setXmlName(new javax.xml.namespace.QName("http://beans", "nom"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
| [
"vincent-keller@hotmail.fr"
] | vincent-keller@hotmail.fr |
b19c75ee9e4ecb52c4983cc068f807c14005b17b | 9712719aa7118e18dfe8b7284b5985bbe53b187e | /kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1WebhookConversion.java | 8791ca9e21a76e61c152021e56fb97ce54f9e7c5 | [
"Apache-2.0"
] | permissive | infa-vdasaraj/java | d8a8f22b74d9f1fbc967f454ed5530aabb6a0294 | 1cf980f74314973e8e0f219aeb39e018dbbb85ab | refs/heads/master | 2022-06-19T10:41:29.940566 | 2020-05-06T23:52:51 | 2020-05-06T23:52:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,044 | java | /*
* Kubernetes
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: release-1.16
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.kubernetes.client.openapi.models;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.kubernetes.client.openapi.models.ApiextensionsV1WebhookClientConfig;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* WebhookConversion describes how to call a conversion webhook
*/
@ApiModel(description = "WebhookConversion describes how to call a conversion webhook")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-04-29T07:27:12.312Z[Etc/UTC]")
public class V1WebhookConversion {
public static final String SERIALIZED_NAME_CLIENT_CONFIG = "clientConfig";
@SerializedName(SERIALIZED_NAME_CLIENT_CONFIG)
private ApiextensionsV1WebhookClientConfig clientConfig;
public static final String SERIALIZED_NAME_CONVERSION_REVIEW_VERSIONS = "conversionReviewVersions";
@SerializedName(SERIALIZED_NAME_CONVERSION_REVIEW_VERSIONS)
private List<String> conversionReviewVersions = new ArrayList<String>();
public V1WebhookConversion clientConfig(ApiextensionsV1WebhookClientConfig clientConfig) {
this.clientConfig = clientConfig;
return this;
}
/**
* Get clientConfig
* @return clientConfig
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public ApiextensionsV1WebhookClientConfig getClientConfig() {
return clientConfig;
}
public void setClientConfig(ApiextensionsV1WebhookClientConfig clientConfig) {
this.clientConfig = clientConfig;
}
public V1WebhookConversion conversionReviewVersions(List<String> conversionReviewVersions) {
this.conversionReviewVersions = conversionReviewVersions;
return this;
}
public V1WebhookConversion addConversionReviewVersionsItem(String conversionReviewVersionsItem) {
this.conversionReviewVersions.add(conversionReviewVersionsItem);
return this;
}
/**
* conversionReviewVersions is an ordered list of preferred `ConversionReview` versions the Webhook expects. The API server will use the first version in the list which it supports. If none of the versions specified in this list are supported by API server, conversion will fail for the custom resource. If a persisted Webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail.
* @return conversionReviewVersions
**/
@ApiModelProperty(required = true, value = "conversionReviewVersions is an ordered list of preferred `ConversionReview` versions the Webhook expects. The API server will use the first version in the list which it supports. If none of the versions specified in this list are supported by API server, conversion will fail for the custom resource. If a persisted Webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail.")
public List<String> getConversionReviewVersions() {
return conversionReviewVersions;
}
public void setConversionReviewVersions(List<String> conversionReviewVersions) {
this.conversionReviewVersions = conversionReviewVersions;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V1WebhookConversion v1WebhookConversion = (V1WebhookConversion) o;
return Objects.equals(this.clientConfig, v1WebhookConversion.clientConfig) &&
Objects.equals(this.conversionReviewVersions, v1WebhookConversion.conversionReviewVersions);
}
@Override
public int hashCode() {
return Objects.hash(clientConfig, conversionReviewVersions);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class V1WebhookConversion {\n");
sb.append(" clientConfig: ").append(toIndentedString(clientConfig)).append("\n");
sb.append(" conversionReviewVersions: ").append(toIndentedString(conversionReviewVersions)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"291271447@qq.com"
] | 291271447@qq.com |
4619e10b327b94a156968e3e32068c786c85f1dd | 9f67393fb3d152a6325145094ec66680aa34341f | /src/com/creditease/eas/accountr/dao/GeneratFileMapper.java | 6836c792bb0041083b29bcceae856ae1aae3676a | [] | no_license | liveqmock/EASExt | 11021a2c129ace517b909ada9dd5be9eacb47dd4 | 1458aabad8f21d524794633ba60c19f12daf5f26 | refs/heads/master | 2021-01-18T08:47:35.792953 | 2015-01-15T07:16:18 | 2015-01-15T07:16:18 | 37,263,974 | 1 | 2 | null | 2015-06-11T13:52:46 | 2015-06-11T13:52:46 | null | UTF-8 | Java | false | false | 965 | java | package com.creditease.eas.accountr.dao;
import java.util.List;
import java.util.Map;
public interface GeneratFileMapper {
/**
*
* 描述:添加文件信息
* 2014-7-23 下午04:26:22 by sunxiaofeng
* @version
* @param map
*/
public void insertFile(Map map);
/**
*
* 描述:查询文件数量
* 2014-7-23 下午05:09:38 by sunxiaofeng
* @version
* @param map
* @return
*/
public int getFileCountsByParams(Map map);
/**
*
* 描述:查询文件信息
* 2014-7-23 下午05:16:14 by sunxiaofeng
* @version
* @param mapTo
* @return
*/
public List<Map> queryPageByParamsFile(Map mapTo);
/**
*
* 描述:删除文件信息
* 2014-7-23 下午07:18:48 by sunxiaofeng
* @version
* @param parseInt
*/
public void deleteFile(int fid);
/**
*
* 描述:查询文件信息
* 2014-7-23 下午01:43:55 by sunxiaofeng
* @version
* @param fid
* @return
*/
public Map findFileInfo(int fid);
}
| [
"18610364019@163.com"
] | 18610364019@163.com |
98d0abcf1a62acc73d948f90d4754d5978b3b15b | e5baa5ba65c5cb80b38203b28c064a475aa63693 | /src/cn/edustar/jitar/service/TemplateProcessor.java | 76f8038d9d6fb637916ff9ec237e38806f1237d8 | [] | no_license | yxxcrtd/jitar2012 | bbe00b1eb2e505400dcfec396201752c3888199c | ccae07ff44a3cb9dc3d0b75673cbca699fa66b80 | refs/heads/master | 2020-05-31T15:26:40.107486 | 2019-06-05T08:05:22 | 2019-06-05T08:05:22 | 190,352,419 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,588 | java | package cn.edustar.jitar.service;
import java.io.IOException;
import java.io.Writer;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
/**
* 模板执行器组件. 负责使用指定的数据和模板产生模板输出结果.
*
*
*/
public interface TemplateProcessor {
/**
* 使用指定的数据和模板产生输出,其中模板相对于 WEB 应用路径,如 '/WEB-INF/ftl/xxx.ftl'
* 表示网站根目录下 '/WEB-INF/ftl/xxx.ftl' 文件.
* @param root_map - 根数据模型.
* @param template_name - 模板名字,位于 WEB 应用路径下.
* @return
*/
public String processTemplate(Object root_map, String template_name, String encoding);
/**
* 使用指定的数据和模板产生输出,其中模板相对于 WEB 应用路径,如 '/WEB-INF/ftl/xxx.ftl'.
* 表示网站根目录下 '/WEB-INF/ftl/xxx.ftl' 文件.
* @param root_map - 根数据模型.
* @param writer - 结果输出到这里.
* @param template_name - 模板名字,位于 WEB 应用路径下.
* @param encoding - 模板文件编码,缺省为 UTF-8.
* @return
*/
public void processTemplate(Object root_map, Writer writer, String template_name, String encoding)
throws IOException;
public String processStringTemplate(Object root_map, String template_text);
/**
* 为指定的 request, map 产生一个 Template 使用的 root_map 对象.
* @param request
* @param map
* @return
*/
@SuppressWarnings("rawtypes")
public Object createRootMap(HttpServletRequest request,Map map);
}
| [
"yxxcrtd@gmail.com"
] | yxxcrtd@gmail.com |
82c435fa1f5d98b613fd294c48765ae55461f55d | d984052a5cf4013b445e52f54ba539c6c1ddc335 | /hibernate-relaciones/src/com/trifulcas/hibernate/entidades/Categorias.java | cf87f87952d2b15ef1a479fd22bc4a7a43164c64 | [] | no_license | juanpablofuentes/Java | 427c053fb52e61a1601fac62f185f4468bb80ac5 | d871592ffb8fea2474f8c2779e1a52a49bc71190 | refs/heads/master | 2022-12-23T05:24:55.417447 | 2019-12-22T19:59:35 | 2019-12-22T19:59:35 | 207,276,380 | 0 | 10 | null | 2022-12-15T23:30:13 | 2019-09-09T09:44:28 | HTML | UTF-8 | Java | false | false | 1,724 | java | package com.trifulcas.hibernate.entidades;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name = "categorias")
public class Categorias {
@Id
@Column(name = "idcategoria")
@GeneratedValue(strategy=GenerationType.IDENTITY)
private int idcategoria;
@Column(name = "nombre")
private String nombre;
@OneToMany(mappedBy="categoria",
cascade= {CascadeType.PERSIST,CascadeType.MERGE, CascadeType.DETACH, CascadeType.REFRESH})
private List<Productos> productos;
public List<Productos> getProductos() {
return productos;
}
public void setProductos(List<Productos> productos) {
this.productos = productos;
}
public void addProductos(Productos producto) {
if (productos==null) {
productos=new ArrayList<Productos>();
}
productos.add(producto);
producto.setCategoria(this);
}
public Categorias() {
}
public Categorias(String nombre) {
super();
this.nombre = nombre;
}
public int getIdcategoria() {
return idcategoria;
}
public void setIdcategoria(int idcategoria) {
this.idcategoria = idcategoria;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
@Override
public String toString() {
String prods="";
for(Productos p:productos) {
prods+=p.getNombre()+"|";
}
return "Categorias [idcategoria=" + idcategoria + ", nombre=" + nombre+", productos="+prods + "]";
}
}
| [
"51440192+juanpablofuentes@users.noreply.github.com"
] | 51440192+juanpablofuentes@users.noreply.github.com |
b8998d25ff72a0ef7d4d4a239a92842b9e92d985 | 215f84d7823ceab9946b95220e2d3f87553444b5 | /src/main/java/weididi/community/community/controller/NotificationController.java | bb018ca79d33c0c5887617c992625f146654a10a | [] | no_license | 326800277/community | 4f8974719977632556669f1e2af126b5246ccc70 | 098aaa93f706572ade93ac2b13906191445de98a | refs/heads/master | 2022-06-23T05:32:22.714558 | 2019-09-12T04:09:34 | 2019-09-12T04:09:34 | 199,184,913 | 2 | 0 | null | 2022-06-21T01:35:49 | 2019-07-27T15:52:22 | Java | UTF-8 | Java | false | false | 1,442 | java | package weididi.community.community.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import weididi.community.community.dto.NotificationDTO;
import weididi.community.community.enums.NotificationEnum;
import weididi.community.community.model.User;
import weididi.community.community.service.NotificationService;
import javax.servlet.http.HttpServletRequest;
@Controller
public class NotificationController {
@Autowired
private NotificationService notificationService;
@GetMapping("/notification/{id}")
public String profile(@PathVariable(name="id") Integer id,
HttpServletRequest request) {
User user = (User) request.getSession().getAttribute("user");
if (user == null) {
return "redirect:/";
}
//这里是用户读过通知之后,后台做的操作
NotificationDTO notificationDTO = notificationService.read(id, user);
if (NotificationEnum.REPLY_COMMENT.getStatus() == notificationDTO.getTypeId()
|| NotificationEnum.REPLY_QUESTION.getStatus() == notificationDTO.getTypeId()) {
return "redirect:/question/" + notificationDTO.getOuterId();
} else {
return "redirect:/";
}
}
}
| [
"52119506+326800277@users.noreply.github.com"
] | 52119506+326800277@users.noreply.github.com |
936dc958b7b3c1263b03f95bae8895a5105d36a7 | 9cf3b89d90b7d66b2e3b7cbcecd0433345e7805a | /cassandra/src/main/java/cn/xlink/cassandra/db/repository/device/online/DeviceOnlineByDeviceIdRepository.java | 9eadfafd0c79878b78c68b792b9fe089e1e750a6 | [] | no_license | knightsss/xlink-datagetway | 7b892c4fb3b01bffb48a88e16bf9fd759d8a35b4 | f126d2317c1ff5e73db2cf60d913c443b146bb58 | refs/heads/master | 2021-05-06T07:53:49.926321 | 2017-12-04T09:55:08 | 2017-12-04T09:55:08 | 113,975,917 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 457 | java | package cn.xlink.cassandra.db.repository.device.online;
import cn.xlink.cassandra.db.CassandraConstants;
import com.datastax.driver.core.Session;
public class DeviceOnlineByDeviceIdRepository extends SuperDeviceOnlineRepository {
public DeviceOnlineByDeviceIdRepository(Session session) {
super(session, CassandraConstants.T_DEVICE_ONLINE);
}
@Override
protected String firstConditionKey() {
return "device_id";
}
}
| [
"nhstljh302@gmail.com"
] | nhstljh302@gmail.com |
149adc599e95534886ad75be75dfc9b8433c4219 | c4c01164501dbc29865243e76e56a9e1423166f8 | /src/main/java/ro/msg/learning/shop/repositories/RoleRepository.java | f6dc4080f5c504307a0808fa17972fa221f3827b | [] | no_license | AndreiSold/OnlineShop | 9801e6734bdd0537961d1993c9393fd737f4820a | 3ab3c8b6c0dc90d3e8d9e8108a73eed22d1ebb52 | refs/heads/master | 2022-07-16T20:07:20.326153 | 2018-11-16T13:03:06 | 2018-11-16T13:03:06 | 147,817,043 | 0 | 1 | null | 2022-06-29T17:00:55 | 2018-09-07T11:54:33 | Java | UTF-8 | Java | false | false | 264 | java | package ro.msg.learning.shop.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import ro.msg.learning.shop.entities.Role;
public interface RoleRepository extends JpaRepository<Role, Integer> {
Role findByNameEquals(String name);
}
| [
"sold_andrei@yahoo.com"
] | sold_andrei@yahoo.com |
779bbd9b88b94193e2ded3b3d2c4cefaace2e3e9 | e9e3aaa3a181ebc9b224b4ac4accf97172c06666 | /src/main/java/com/atd/official/service/ConfigService.java | 7089c6c6a63c8c1b1fc5be9f287e24481b25b402 | [
"MIT"
] | permissive | HarsonYoung/atd-website-backend | 1099193bf02755223d5f08f4b2176d7bd1aa8689 | c32be10b4d9f2dfa3fa20635cbbeb3ad682fd3ff | refs/heads/master | 2023-03-31T22:39:15.008599 | 2021-04-09T13:04:45 | 2021-04-09T13:04:45 | 260,110,751 | 0 | 1 | MIT | 2020-04-30T04:09:33 | 2020-04-30T04:09:32 | null | UTF-8 | Java | false | false | 150 | java | package com.atd.official.service;
import com.alibaba.fastjson.JSONObject;
public interface ConfigService {
JSONObject getConfig(String name);
}
| [
"YoungHarson.s@gmail.com"
] | YoungHarson.s@gmail.com |
b611a926585b295c62254a77c3da2379d5b78708 | 197a087063cc202a66cc4d5f35ad4507b7d12026 | /backend/src/main/java/com/maiacare/serverside/web/service/IdoctorService.java | 1891006080aa82752419dbb5731ebb4db1078f44 | [] | no_license | HussamNujaim/MAIA-EYE-Care-Web-Platform | 5100b409326cae22f64e18ae8e123191e00b00fe | 5ad14dcbdc544a7b69f0e2aef3952e79d049582b | refs/heads/main | 2023-08-11T02:19:09.856738 | 2021-10-10T15:52:05 | 2021-10-10T15:52:05 | 415,627,567 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 311 | java | package com.maiacare.serverside.web.service;
import com.maiacare.serverside.web.entity.Doctor;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface IdoctorService extends MongoRepository<Doctor,Long> {
}
| [
"noreply@github.com"
] | HussamNujaim.noreply@github.com |
fb44ac89a294f9f227d625d8622c3416fbe8501e | f0619c96cb9dc92b6c44ae12aad4f4d6bb334312 | /silver-hammer-core/src/main/java/ru/silverhammer/core/Location.java | 6d0cc8b8f93a576c55848b41af7f54ab78fd7418 | [
"BSD-2-Clause"
] | permissive | ValeryVolkov/Silver-Hammer | 10d892cbb22e5074fb937ccdfc01aef7e28db89d | 731a23d52c44f1f42808cd3725e448474c0af40f | refs/heads/master | 2020-04-14T16:54:19.220174 | 2019-01-03T11:57:39 | 2019-01-03T11:57:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,463 | java | /*
* Copyright (c) 2017, Dmitriy Shchekotin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
package ru.silverhammer.core;
public enum Location {
Left,
Top,
Right,
Bottom
}
| [
"dimjob2000@mail.ru"
] | dimjob2000@mail.ru |
352de763b9785c9d44d41b503887eb9692a94b93 | ec13fd6ad41661e1b2f578819f3b0b0474edbb5f | /org/jooq/impl/Floor.java | 477b38560819109fcc612aa4a2caf3b1d1371d72 | [] | no_license | BukkitReborn/Mineplexer | 80afaa667a91624712906b29a0fbbc9380a6e1b2 | e1038978a1baa9ae88613923842834c4561f0628 | refs/heads/master | 2020-12-02T22:37:49.522092 | 2017-01-17T18:51:53 | 2017-01-17T18:51:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 722 | java | package org.jooq.impl;
import org.jooq.Configuration;
import org.jooq.Field;
import org.jooq.QueryPart;
class Floor<T extends Number>
extends AbstractFunction<T>
{
private static final long serialVersionUID = -7273879239726265322L;
private final Field<T> argument;
Floor(Field<T> argument)
{
super("floor", argument.getDataType(), new Field[] { argument });
this.argument = argument;
}
final Field<T> getFunction0(Configuration configuration)
{
switch (configuration.dialect())
{
case SQLITE:
return DSL.round(this.argument.sub(Double.valueOf(0.499999999999999D)));
}
return DSL.field("{floor}({0})", getDataType(), new QueryPart[] { this.argument });
}
}
| [
"H4nSolo@gmx.de"
] | H4nSolo@gmx.de |
2075ec77aceebc42607e20a516a62a3c2a262ac3 | 98e5b3aec60935f6768cb4e2a24b21da0b528b6d | /datalayer/message/src/main/java/com/waben/stock/datalayer/message/repository/impl/MethodDesc.java | cde1a62a1fa5ec2bb9d4194fee7cb9155fcc3098 | [] | no_license | sunliang123/zhongbei-zhonghang-zhongzi-yidian | 3eb95a77658d7ad9de1cdf9c3f85714ee007a871 | 54fed94b9784f5e392b4b9517cb5fe19c1b34443 | refs/heads/master | 2020-03-29T05:26:02.515289 | 2018-09-20T09:11:48 | 2018-09-20T09:11:48 | 149,582,090 | 1 | 5 | null | null | null | null | UTF-8 | Java | false | false | 525 | java | package com.waben.stock.datalayer.message.repository.impl;
public class MethodDesc {
private String name;
private Class<?>[] paramTypes;
public MethodDesc(String name, Class<?>[] paramTypes) {
super();
this.name = name;
this.paramTypes = paramTypes;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Class<?>[] getParamTypes() {
return paramTypes;
}
public void setParamTypes(Class<?>[] paramTypes) {
this.paramTypes = paramTypes;
}
}
| [
"sunliang_s666@163.com"
] | sunliang_s666@163.com |
5e42e01a056ddca766c3456d19f90da3afcb7977 | 842dee0aaca1e24bed893db63263b2291e32f7d6 | /network/src/main/java/com/cat/study/demo/file/package-info.java | 22ffcced7383669c65246261cbb3f9cdd9dc01c8 | [] | no_license | zhsyk34/zsxy | ec5135a10797ad4480fd31926fee5eb8b6e5937d | 0b24ae31333a30cad7d52628555b60e8483989d9 | refs/heads/master | 2021-01-20T18:45:09.216058 | 2016-09-28T10:59:09 | 2016-09-28T10:59:10 | 60,462,223 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,072 | java | /**
* 说明:本包主要是要演示了文件服务器的功能.
* 客户端启动时,会指定一个文件要保存的路径,本例为“D:/reciveFile.txt”。
* 客户端发送文件的请求,需在控制台输入所请求文件的路径(当然为了简单演示,该文件是服务器上的文件),
* 而后,服务器会将该文件传送给客户端端,客户端将文件内容写入“D:/reciveFile.txt”
*
* @author <a href="http://www.waylau.com">waylau.com</a> 2015年11月6日
*/
/**
* 说明:本包主要是要演示了文件服务器的功能.
* 客户端启动时,会指定一个文件要保存的路径,本例为“D:/reciveFile.txt”。
* 客户端发送文件的请求,需在控制台输入所请求文件的路径(当然为了简单演示,该文件是服务器上的文件),
* 而后,服务器会将该文件传送给客户端端,客户端将文件内容写入“D:/reciveFile.txt”
*
*
* @author <a href="http://www.waylau.com">waylau.com</a> 2015年11月6日
*/
package com.cat.study.demo.file; | [
"zhsy1985@sina.com"
] | zhsy1985@sina.com |
71b0ce6b01f21a84c36fef2bcf7178f9534c5f2c | d31532a44fc82346c0f4ac6a2ec963172e8cffc6 | /DATN_TrangNT_1529758_Sourcecode/TPCP/src/com/seatech/tp/banletraiphieutw/action/BanLeTraiPhieuTwAction.java | 2bfee3ec13a8de58db1f2558b348e647c766c944 | [] | no_license | vubaquang243/DATN_TRANG58PM1 | 66fe491a606b122a50d88ddcc574b26ea6293123 | 6a5e005a0aa64fb6f3567d5a2e64cbb32706afaa | refs/heads/master | 2021-05-14T16:30:37.548747 | 2018-01-02T14:10:26 | 2018-01-02T14:10:26 | 116,021,605 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 36,794 | java | package com.seatech.tp.banletraiphieutw.action;
import com.seatech.framework.AppConstants;
import com.seatech.framework.common.jsp.PagingBean;
import com.seatech.framework.exception.TPCPException;
import com.seatech.framework.strustx.AppAction;
import com.seatech.framework.utils.StringUtil;
import com.seatech.tp.banletraiphieutw.form.BanLeTraiPhieuTwChiTietForm;
import com.seatech.tp.banletraiphieutw.form.BanLeTraiPhieuTwForm;
import com.seatech.tp.banletraiphieutw.vo.BanLeTraiPhieuTwChiTietVO;
import com.seatech.tp.banletraiphieutw.vo.BanLeTraiPhieuTwVO;
import com.seatech.tp.dmkyhan.action.DMKyHanDelegate;
import com.seatech.tp.dmtraichu.action.DMTraiChuDelegate;
import com.seatech.tp.dmtraichu.vo.DMTraiChuVO;
import com.seatech.tp.qlytp.action.QuanLyTPCPDelegate;
import com.seatech.tp.qlytp.vo.QuanLyTPCPVO;
import com.seatech.tp.ttindthau.action.QLyTTinDauThauDelegate;
import com.seatech.tp.ttindthau.vo.ThongTinDauThauVO;
import com.seatech.tp.user.UserHistoryVO;
import java.math.BigDecimal;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang.time.FastDateFormat;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class BanLeTraiPhieuTwAction extends AppAction {
private static String SUCCESS = "success";
private static String FAILURE = "failure";
public ActionForward list(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
Connection conn = null;
try {
BanLeTraiPhieuTwForm f = (BanLeTraiPhieuTwForm)form;
f.reset(mapping, request);
} catch (Exception e) {
conn.rollback();
throw e;
} finally {
close(conn);
}
return search(mapping, form, request, response);
}
public ActionForward search(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
//check quyen
Connection conn = null;
try {
conn = getConnection(request);
BanLeTraiPhieuTwForm f = (BanLeTraiPhieuTwForm)form;
int phantrang = (AppConstants.APP_NUMBER_ROW_ON_PAGE);
// khai bao bien phan trang.
String page = f.getPageNumber();
if (page == null)
page = "1";
Integer currentPage = new Integer(page);
Integer numberRowOnPage = phantrang;
Integer totalCount[] = new Integer[1];
BanLeTraiPhieuTwVO vo = new BanLeTraiPhieuTwVO();
BeanUtils.copyProperties(vo, f);
// get list ma_tpcp
QuanLyTPCPDelegate delegatetpcp = new QuanLyTPCPDelegate(conn);
List listTPCP = new ArrayList();
listTPCP = (List)delegatetpcp.getAllListTPCP_Ban_Le();
request.setAttribute("listTPCP", listTPCP);
BanLeTraiPhieuTwDelegate delegate = new BanLeTraiPhieuTwDelegate(conn);
List lstBanLeTraiPhieuTw = null;
lstBanLeTraiPhieuTw = (List)delegate.getListBanLeTraiPhieuTwPaging(vo, currentPage, numberRowOnPage, totalCount);
Iterator ito = lstBanLeTraiPhieuTw.iterator();
Collection resultBanLe = new ArrayList();
while (ito.hasNext()) {
vo = (BanLeTraiPhieuTwVO)ito.next();
if (vo.getKhoi_luong() != null) {
String khoiLuong = vo.getKhoi_luong();
vo.setKhoi_luong(StringUtil.convertNumberToString(khoiLuong, "VND"));
}
resultBanLe.add(vo);
}
PagingBean pagingBean = new PagingBean();
pagingBean.setCurrentPage(currentPage);
pagingBean.setNumberOfRow((totalCount[0] == null) ? 0 : totalCount[0].intValue());
pagingBean.setRowOnPage(numberRowOnPage);
request.setAttribute("PAGE_KEY", pagingBean);
request.setAttribute("lstBanLeTraiPhieuTw", resultBanLe);
} catch (Exception e) {
conn.rollback();
throw e;
} finally {
close(conn);
}
return mapping.findForward(SUCCESS);
}
public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
Connection conn = null;
try {
conn = getConnection(request);
BanLeTraiPhieuTwForm f = (BanLeTraiPhieuTwForm)form;
QuanLyTPCPDelegate delegate = new QuanLyTPCPDelegate(conn);
List listTPCP = new ArrayList();
listTPCP = (List)delegate.getAllListTPCP_Ban_Le();
request.setAttribute("listTPCP", listTPCP);
//get list ky han
DMKyHanDelegate dmKyHanDelegate = new DMKyHanDelegate(conn);
HashMap<String, Object> map = new HashMap<String, Object>();
List lstKyHan = (List)dmKyHanDelegate.getDMKyHan(map);
request.setAttribute("lstKyHan", lstKyHan);
// String kh = "1";
// request.setAttribute("kh", kh);
// set ky han khi addExc Failure
QuanLyTPCPDelegate delegateTP = new QuanLyTPCPDelegate(conn);
Map<String, Object> mapTP = new HashMap();
if (!"".equals(f.getMa_tpcp())) {
mapTP.put("MA_TP", f.getMa_tpcp());
QuanLyTPCPVO tpcpVo = delegateTP.getTTDTObject(mapTP);
if (tpcpVo != null) {
f.setKy_han(tpcpVo.getKy_han());
}
}
//get list don vi so huuu
DMTraiChuDelegate dmTraiChuDelegate = new DMTraiChuDelegate(conn);
HashMap<String, Object> map_DVSH = new HashMap<String, Object>();
map_DVSH.put("TRANG_THAI", "00");
List lstDVSH = (List)dmTraiChuDelegate.getDMTraiChu(map_DVSH);
request.setAttribute("lstDVSH", lstDVSH);
if (f.getNgay_dao_han() == null || "".equals(f.getNgay_dao_han())) {
//end get list don vi so huuu
BanLeTraiPhieuTwChiTietForm formCTiet = new BanLeTraiPhieuTwChiTietForm();
formCTiet.setStt("1");
Collection lst = new ArrayList();
lst.add(formCTiet);
f.setLstKQBanLe_CTiet(lst);
} else {
BanLeTraiPhieuTwVO voBanLeTraiPhieuTwVO = new BanLeTraiPhieuTwVO();
f.setStt("1");
Collection listBanLe = new ArrayList();
//Add ban le chi tiet
String[] sMa_dvi_so_huu = request.getParameterValues("ma_dvi_so_huu");
String[] sSoluongtraiphieu = request.getParameterValues("sl_dky_mua");
String[] sKl_dky_mua = request.getParameterValues("kl_dky_mua");
String[] sSotienthanhtoan = request.getParameterValues("so_tien_tt");
if (sMa_dvi_so_huu.length > 0) {
for (int i = 0; i < sMa_dvi_so_huu.length; i++) {
BanLeTraiPhieuTwChiTietVO voChiTiet = new BanLeTraiPhieuTwChiTietVO();
String ma_dvi_so_huu = "";
if (!sMa_dvi_so_huu[i].toString().trim().equals("")) {
ma_dvi_so_huu = sMa_dvi_so_huu[i].toString().trim();
}
String soluongtraiphieu = "";
if (!sSoluongtraiphieu[i].toString().trim().equals("")) {
soluongtraiphieu = sSoluongtraiphieu[i].toString().trim();
}
String sotienthanhtoan = "";
if (!sSotienthanhtoan[i].toString().trim().equals("")) {
sotienthanhtoan = sSotienthanhtoan[i].toString().trim();
}
String kl_dky_mua = "";
if (!sKl_dky_mua[i].toString().trim().equals("")) {
kl_dky_mua = sKl_dky_mua[i].toString().trim();
}
voChiTiet.setMa_dvi_so_huu(ma_dvi_so_huu);
voChiTiet.setDvi_so_huu(getTenDonViSoHuuByGuid(ma_dvi_so_huu, conn));
voChiTiet.setSl_dky_mua(soluongtraiphieu);
voChiTiet.setKl_dky_mua(kl_dky_mua);
voChiTiet.setSo_tien_tt(sotienthanhtoan);
listBanLe.add(voChiTiet);
}
voBanLeTraiPhieuTwVO.setLstKQBanLe_CTiet(listBanLe);
}
f.setLstKQBanLe_CTiet(voBanLeTraiPhieuTwVO.getLstKQBanLe_CTiet());
}
} catch (Exception e) {
conn.rollback();
throw e;
} finally {
conn.close();
}
return mapping.findForward(SUCCESS);
}
public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
Connection conn = null;
try {
conn = getConnection();
BanLeTraiPhieuTwForm f = (BanLeTraiPhieuTwForm)form;
String guid = "";
if ("".equals(f.getDot_ph())) {
guid = request.getParameter("longid").trim();
} else {
guid = f.getGuid();
}
//check xem TPCP tồn tại?
BanLeTraiPhieuTwDelegate delegate = new BanLeTraiPhieuTwDelegate(conn);
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("GUID", guid);
BanLeTraiPhieuTwVO voBanLeTraiPhieuTw = delegate.getBanLeTraiPhieuTwObject(map);
if (voBanLeTraiPhieuTw == null) {
saveMessage(request, new TPCPException("BanLeTraiPhieuTw.list.norecord"));
return mapping.findForward(FAILURE);
}
String kh = voBanLeTraiPhieuTw.getKy_tt_lai();
request.setAttribute("kh", kh);
if (voBanLeTraiPhieuTw.getLai_suat() != null) {
voBanLeTraiPhieuTw.setLai_suat(StringUtil.convertNumberToString(voBanLeTraiPhieuTw.getLai_suat(), "VND"));
}
if (voBanLeTraiPhieuTw.getKhoi_luong() != null) {
String khoiluong = voBanLeTraiPhieuTw.getKhoi_luong();
voBanLeTraiPhieuTw.setKhoi_luong(StringUtil.convertNumberToString(khoiluong, "VND"));
}
if (voBanLeTraiPhieuTw.getSo_luong() != null) {
String soluong = voBanLeTraiPhieuTw.getSo_luong();
voBanLeTraiPhieuTw.setSo_luong(StringUtil.convertNumberToString(soluong, "VND"));
}
if (voBanLeTraiPhieuTw.getMenh_gia() != null) {
String menhgia = voBanLeTraiPhieuTw.getMenh_gia();
voBanLeTraiPhieuTw.setMenh_gia(StringUtil.convertNumberToString(menhgia, "VND"));
}
if (voBanLeTraiPhieuTw.getTong_so_tt() != null) {
String tong_so_tt = voBanLeTraiPhieuTw.getTong_so_tt();
voBanLeTraiPhieuTw.setTong_so_tt(StringUtil.convertNumberToString(tong_so_tt, "VND"));
}
BeanUtils.copyProperties(f, voBanLeTraiPhieuTw);
//get list TPCP
QuanLyTPCPDelegate delegateTPCP = new QuanLyTPCPDelegate(conn);
List listTPCP = new ArrayList();
listTPCP = (List)delegateTPCP.getAllListTPCP_Ban_Le();
request.setAttribute("listTPCP", listTPCP);
//Ky Han
DMKyHanDelegate dmKyHanDelegate = new DMKyHanDelegate(conn);
//get list ky han
HashMap<String, Object> map_kyhan = new HashMap<String, Object>();
// map_kyhan.put("LOAI_TPCP", "TRAI_PHIEU");
List lstKyHan = (List)dmKyHanDelegate.getDMKyHan(map_kyhan);
request.setAttribute("lstKyHan", lstKyHan);
//
//get list don vi so huuu
DMTraiChuDelegate dmTraiChuDelegate = new DMTraiChuDelegate(conn);
HashMap<String, Object> map_DVSH = new HashMap<String, Object>();
map_DVSH.put("TRANG_THAI", "00");
List lstDVSH = (List)dmTraiChuDelegate.getDMTraiChu(map_DVSH);
request.setAttribute("lstDVSH", lstDVSH);
//end get list don vi so huuu
//Chi tiet
BanLeTraiPhieuTwChiTietDelegate delegateChiTiet = new BanLeTraiPhieuTwChiTietDelegate(conn);
HashMap<String, Object> map_chitiet = new HashMap<String, Object>();
map_chitiet.put("KQPH_BAN_LE_ID", guid);
Collection lstCTietVO = null;
lstCTietVO = delegateChiTiet.getListBanLeTraiPhieuChiTietTw(map_chitiet, 0);
Collection lstCTietForm = new ArrayList();
Iterator ito2 = lstCTietVO.iterator();
BanLeTraiPhieuTwChiTietVO ctietVO = null;
BanLeTraiPhieuTwChiTietForm ctietForm = null;
int dem = 0;
while (ito2.hasNext()) {
ctietForm = new BanLeTraiPhieuTwChiTietForm();
dem++;
ctietVO = (BanLeTraiPhieuTwChiTietVO)ito2.next();
ctietForm.setStt(dem + "");
if (ctietVO.getSl_dky_mua() != null) {
String Sl_dky_mua = ctietVO.getSl_dky_mua();
ctietVO.setSl_dky_mua(StringUtil.convertNumberToString(Sl_dky_mua, "VND"));
}
if (ctietVO.getKl_dky_mua() != null) {
String Kl_dky_mua = ctietVO.getKl_dky_mua();
ctietVO.setKl_dky_mua(StringUtil.convertNumberToString(Kl_dky_mua, "VND"));
}
if (ctietVO.getSo_tien_tt() != null) {
String So_tien_tt = ctietVO.getSo_tien_tt();
ctietVO.setSo_tien_tt(StringUtil.convertNumberToString(So_tien_tt, "VND"));
}
BeanUtils.copyProperties(ctietForm, ctietVO);
lstCTietForm.add(ctietForm);
}
f.setLstKQBanLe_CTiet(lstCTietForm);
//End Chitiet
} catch (Exception e) {
conn.rollback();
throw e;
} finally {
close(conn);
}
return mapping.findForward(SUCCESS);
}
public String getTenDonViSoHuuByGuid(String Ma, Connection conn) throws Exception {
String ten = "";
DMTraiChuDelegate dmTraiChuDelegate = new DMTraiChuDelegate(conn);
HashMap<String, Object> map_DVSH = new HashMap<String, Object>();
map_DVSH.put("MA_CHU_SO_HUU", Ma);
DMTraiChuVO voDMTraiChu = dmTraiChuDelegate.getDMTraiChuVO(map_DVSH);
if (voDMTraiChu.getTen_dvi_so_huu() != null) {
ten = voDMTraiChu.getTen_dvi_so_huu().toString().trim();
}
return ten;
}
public void XuLyPhanBanLeChiTiet(HttpServletRequest request, Connection conn, BanLeTraiPhieuTwVO voBanLeTraiPhieuTwVO) throws Exception {
{
Collection listBanLe = new ArrayList();
//Add ban le chi tiet
String[] sMa_dvi_so_huu = request.getParameterValues("ma_dvi_so_huu");
String loai_tien = request.getParameter("loai_tien");
String[] sSoluongtraiphieu = request.getParameterValues("sl_dky_mua");
String[] sKl_dky_mua = request.getParameterValues("kl_dky_mua");
String[] sSotienthanhtoan = request.getParameterValues("so_tien_tt");
if (sMa_dvi_so_huu.length > 0) {
for (int i = 0; i < sMa_dvi_so_huu.length; i++) {
BanLeTraiPhieuTwChiTietVO voChiTiet = new BanLeTraiPhieuTwChiTietVO();
String ma_dvi_so_huu = "";
if (!sMa_dvi_so_huu[i].toString().trim().equals("")) {
ma_dvi_so_huu = sMa_dvi_so_huu[i].toString().trim();
}
String soluongtraiphieu = "";
if (!sSoluongtraiphieu[i].toString().trim().equals("")) {
soluongtraiphieu = sSoluongtraiphieu[i].toString().trim();
}
String sotienthanhtoan = "";
if (!sSotienthanhtoan[i].toString().trim().equals("")) {
sotienthanhtoan = sSotienthanhtoan[i].toString().trim();
}
String kl_dky_mua = "";
if (!sKl_dky_mua[i].toString().trim().equals("")) {
kl_dky_mua = sKl_dky_mua[i].toString().trim();
}
voChiTiet.setMa_dvi_so_huu(ma_dvi_so_huu);
voChiTiet.setDvi_so_huu(getTenDonViSoHuuByGuid(ma_dvi_so_huu, conn));
voChiTiet.setLoai_tien(loai_tien);
voChiTiet.setSl_dky_mua(soluongtraiphieu);
voChiTiet.setKl_dky_mua(kl_dky_mua);
voChiTiet.setSo_tien_tt(sotienthanhtoan);
listBanLe.add(voChiTiet);
}
voBanLeTraiPhieuTwVO.setLstKQBanLe_CTiet(listBanLe);
}
}
//End add ban le chi tiet
}
public ActionForward addExc(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
Connection conn = null;
String errMess = "";
try {
conn = getConnection(request);
getInt(request);
BanLeTraiPhieuTwForm f = (BanLeTraiPhieuTwForm)form;
BanLeTraiPhieuTwDelegate delegate = new BanLeTraiPhieuTwDelegate(conn);
HashMap<String, Object> map_BL = new HashMap<String, Object>();
map_BL.put("DOT_PH", f.getDot_ph());
BanLeTraiPhieuTwVO voBanLe = delegate.getBanLeTraiPhieuTwObjectHienThi(map_BL);
if (voBanLe != null) {
throw new TPCPException().createException("TPCP-0013", f.getDot_ph());
}
// check ma_tpcp
if ("".equals(f.getDot_bo_sung())) {
Map<String, Object> maptpcp = new HashMap();
maptpcp.put("MA_TPCP", f.getMa_tpcp());
List ma_tpcpbl = (List)delegate.getAllBanLe(maptpcp);
if (ma_tpcpbl.size() >= 1) {
throw new TPCPException().createException("TPCP-0020", f.getMa_tpcp());
}
}
//check dot bo sung
if (f.getDot_bo_sung() != null && !f.getDot_bo_sung().equals("")) {
Map<String, Object> map2 = new HashMap();
map2.put("DOT_PH", f.getDot_bo_sung());
map2.put("TRANG_THAI", "02");
map2.put("MA_TPCP", f.getMa_tpcp());
BanLeTraiPhieuTwVO voBanLe2 = delegate.getBanLeTraiPhieuTwObject(map2);
if (voBanLe2 == null) {
throw new TPCPException().createException("TPCP-0031", f.getDot_bo_sung());
}
}
BanLeTraiPhieuTwVO vo = new BanLeTraiPhieuTwVO();
HttpSession session = request.getSession();
String nUserID = session.getAttribute(AppConstants.APP_USER_ID_SESSION).toString();
BeanUtils.copyProperties(vo, f);
vo.setNguoi_tao(nUserID);
if ("".equals(vo.getTrang_thai())) {
vo.setTrang_thai("00");
}
//Add ban le chi tiet
XuLyPhanBanLeChiTiet(request, conn, vo);
//End add ban le chi tiet
long idAdd = delegate.update(vo);
//insert history
UserHistoryVO userHisVO = new UserHistoryVO();
userHisVO.setNguoi_tdoi(new Long(nUserID));
userHisVO.setNoi_dung_thaydoi("Them moi ma ban le trai phieu tw" + idAdd);
userHisVO.setNsd_id(idAdd);
delegate.insertHistoryUser(userHisVO);
f.reset(mapping, request);
errMess = "BanLeTraiPhieuTw.add.succ";
saveMessage(request, new TPCPException(errMess));
} catch (Exception e) {
conn.rollback();
throw e;
} finally {
close(conn);
}
return mapping.findForward(SUCCESS);
}
public ActionForward updateExc(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
Connection conn = null;
String errMess = "";
try {
conn = getConnection(request);
BanLeTraiPhieuTwForm f = (BanLeTraiPhieuTwForm)form;
BanLeTraiPhieuTwVO vo = new BanLeTraiPhieuTwVO();
BanLeTraiPhieuTwDelegate delegate = new BanLeTraiPhieuTwDelegate(conn);
HttpSession session = request.getSession();
String nUserID = session.getAttribute(AppConstants.APP_USER_ID_SESSION).toString();
//check dot bo sung
if (f.getDot_bo_sung() != null && !f.getDot_bo_sung().equals("")) {
Map<String, Object> map2 = new HashMap();
map2.put("DOT_PH", f.getDot_bo_sung());
map2.put("TRANG_THAI", "02");
map2.put("MA_TPCP", f.getMa_tpcp());
BanLeTraiPhieuTwVO voBanLe = delegate.getBanLeTraiPhieuTwObject(map2);
if (voBanLe == null) {
throw new TPCPException().createException("TPCP-0031", f.getDot_bo_sung());
}
}else{
//check neu cap nhap ma TPCP
if (f.getMa_tpcp_old() != null && !f.getMa_tpcp_old().equals(f.getMa_tpcp())) {
Map<String, Object> map = new HashMap();
map.put("MA_TPCP", f.getMa_tpcp());
BanLeTraiPhieuTwVO voCheckTien = new BanLeTraiPhieuTwVO();
voCheckTien = delegate.getBanLeTraiPhieuTwObject(map);
if (voCheckTien != null) {
throw new TPCPException().createException("TPCP-0020", f.getMa_tpcp());
}
}
}
BeanUtils.copyProperties(vo, f);
vo.setNgay_sua_cuoi(getDate());
vo.setNguoi_sua_cuoi(nUserID);
//Add ban le chi tiet
XuLyPhanBanLeChiTiet(request, conn, vo);
//End add ban le chi tiet
long idAdd = delegate.update(vo);
UserHistoryVO userHisVO = new UserHistoryVO();
userHisVO.setNguoi_tdoi(new Long(nUserID));
userHisVO.setNoi_dung_thaydoi("Update ban le trai phieu tw" + idAdd);
userHisVO.setNsd_id(idAdd);
delegate.insertHistoryUser(userHisVO);
f.reset(mapping, request);
if ("00".equals(vo.getTrang_thai())) {
errMess = "BanLeTraiPhieuTw.update.succ";
} else {
errMess = "BanLeTraiPhieuTw.updatesub.succ";
}
saveMessage(request, new TPCPException(errMess));
} catch (Exception e) {
conn.rollback();
throw e;
} finally {
close(conn);
}
return mapping.findForward(SUCCESS);
}
public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
Connection conn = null;
String errMess = "";
try {
conn = getConnection();
HttpSession session = request.getSession();
String nUserID = session.getAttribute(AppConstants.APP_USER_ID_SESSION).toString();
String guid = request.getParameter("longid").trim();
//check xem TPCP tồn tại?
BanLeTraiPhieuTwDelegate delegate = new BanLeTraiPhieuTwDelegate(conn);
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("GUID", guid);
BanLeTraiPhieuTwVO voBanLe = delegate.getBanLeTraiPhieuTwObject(map);
if (voBanLe == null) {
saveMessage(request, new TPCPException("BanLeTraiPhieuTw.list.norecord"));
return mapping.findForward(FAILURE);
} else {
BanLeTraiPhieuTwForm f = (BanLeTraiPhieuTwForm)form;
long idAdd = delegate.deleteBanLeTraiPhieuTw(voBanLe);
//insert history
UserHistoryVO userHisVO = new UserHistoryVO();
userHisVO.setNguoi_tdoi(new Long(nUserID));
userHisVO.setNoi_dung_thaydoi("Xoa ma banletraiphieutw " + idAdd);
userHisVO.setNsd_id(idAdd);
delegate.insertHistoryUser(userHisVO);
f.reset(mapping, request);
if (idAdd != 0) {
errMess = "BanLeTraiPhieuTw.delete.succ";
} else {
errMess = "BanLeTraiPhieuTw.delete.error";
}
saveMessage(request, new TPCPException(errMess));
}
} catch (Exception e) {
conn.rollback();
throw e;
} finally {
close(conn);
}
return mapping.findForward(SUCCESS);
}
public ActionForward trinhAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
Connection conn = null;
String errMess = "";
try {
conn = getConnection(request);
BanLeTraiPhieuTwForm f = (BanLeTraiPhieuTwForm)form;
BanLeTraiPhieuTwVO vo = new BanLeTraiPhieuTwVO();
HttpSession session = request.getSession();
String nUserID = session.getAttribute(AppConstants.APP_USER_ID_SESSION).toString();
BeanUtils.copyProperties(vo, f);
vo.setTrang_thai("01");
BanLeTraiPhieuTwDelegate delegate = new BanLeTraiPhieuTwDelegate(conn);
long idAdd = delegate.update(vo);
//insert history
UserHistoryVO userHisVO = new UserHistoryVO();
userHisVO.setNguoi_tdoi(new Long(nUserID));
userHisVO.setNoi_dung_thaydoi("Trinh ket qua ban le trai phieu tw" + idAdd);
userHisVO.setNsd_id(idAdd);
delegate.insertHistoryUser(userHisVO);
f.reset(mapping, request);
if (idAdd != 0) {
errMess = "BanLeTraiPhieuTw.trinhkq.succ";
} else
errMess = "BanLeTraiPhieuTw.trinhkq.error";
saveMessage(request, new TPCPException(errMess));
} catch (Exception e) {
conn.rollback();
throw e;
} finally {
close(conn);
}
return mapping.findForward(SUCCESS);
}
public ActionForward view(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
Connection conn = null;
try {
conn = getConnection();
String guid = request.getParameter("longid").trim();
//check xem TPCP tồn tại?
BanLeTraiPhieuTwDelegate delegate = new BanLeTraiPhieuTwDelegate(conn);
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("GUID", guid);
BanLeTraiPhieuTwVO voBanLeTraiPhieuTw = delegate.getBanLeTraiPhieuTwObject(map);
String kh = voBanLeTraiPhieuTw.getKy_tt_lai();
request.setAttribute("kh", kh);
if (voBanLeTraiPhieuTw == null) {
saveMessage(request, new TPCPException("BanLeTraiPhieuTw.list.norecord"));
return mapping.findForward(FAILURE);
}
if (voBanLeTraiPhieuTw.getLai_suat() != null) {
// String laisuat = voBanLeTraiPhieuTw.getLai_suat().replace(".", ",");
voBanLeTraiPhieuTw.setLai_suat(StringUtil.convertNumberToString(voBanLeTraiPhieuTw.getLai_suat(), "VND"));
}
if (voBanLeTraiPhieuTw.getKhoi_luong() != null) {
String khoiluong = voBanLeTraiPhieuTw.getKhoi_luong();
voBanLeTraiPhieuTw.setKhoi_luong(StringUtil.convertNumberToString(khoiluong, "VND"));
}
if (voBanLeTraiPhieuTw.getSo_luong() != null) {
String soluong = voBanLeTraiPhieuTw.getSo_luong();
voBanLeTraiPhieuTw.setSo_luong(StringUtil.convertNumberToString(soluong, "VND"));
}
if (voBanLeTraiPhieuTw.getMenh_gia() != null) {
String menhgia = voBanLeTraiPhieuTw.getMenh_gia();
voBanLeTraiPhieuTw.setMenh_gia(StringUtil.convertNumberToString(menhgia, "VND"));
}
if (voBanLeTraiPhieuTw.getTong_so_tt() != null) {
String tong_so_tt = voBanLeTraiPhieuTw.getTong_so_tt();
voBanLeTraiPhieuTw.setTong_so_tt(StringUtil.convertNumberToString(tong_so_tt, "VND"));
}
BanLeTraiPhieuTwForm f = (BanLeTraiPhieuTwForm)form;
BeanUtils.copyProperties(f, voBanLeTraiPhieuTw);
//get list TPCP
QuanLyTPCPDelegate delegateTPCP = new QuanLyTPCPDelegate(conn);
List listTPCP = new ArrayList();
listTPCP = (List)delegateTPCP.getAllListTPCP();
request.setAttribute("listTPCP", listTPCP);
//Ky Han
DMKyHanDelegate dmKyHanDelegate = new DMKyHanDelegate(conn);
//get list ky han
HashMap<String, Object> map_kyhan = new HashMap<String, Object>();
// map_kyhan.put("LOAI_TPCP", "TRAI_PHIEU");
// List lstKyHan = (List)dmKyHanDelegate.getDMKyHan(map_kyhan);
// request.setAttribute("lstKyHan", lstKyHan);
List lstKyHan = (List)dmKyHanDelegate.getDMKyHan(map_kyhan);
request.setAttribute("lstKyHan", lstKyHan);
//
BeanUtils.copyProperties(f, voBanLeTraiPhieuTw);
//
//Chi tiet
BanLeTraiPhieuTwChiTietDelegate delegateChiTiet = new BanLeTraiPhieuTwChiTietDelegate(conn);
HashMap<String, Object> map_chitiet = new HashMap<String, Object>();
map_chitiet.put("KQPH_BAN_LE_ID", guid);
Collection lstCTietVO = null; // goi DAO lay dl tu bang chi tiet theo GUID
//
lstCTietVO = delegateChiTiet.getListBanLeTraiPhieuChiTietTw(map_chitiet, 1);
Collection lstCTietForm = new ArrayList();
Iterator ito2 = lstCTietVO.iterator();
BanLeTraiPhieuTwChiTietVO ctietVO = null;
BanLeTraiPhieuTwChiTietForm ctietForm = null;
int dem = 0;
while (ito2.hasNext()) {
ctietForm = new BanLeTraiPhieuTwChiTietForm();
dem++;
ctietVO = (BanLeTraiPhieuTwChiTietVO)ito2.next();
ctietForm.setStt(dem + "");
if (ctietVO.getSl_dky_mua() != null) {
String Sl_dky_mua = ctietVO.getSl_dky_mua();
ctietVO.setSl_dky_mua(StringUtil.convertNumberToString(Sl_dky_mua, "VND"));
}
if (ctietVO.getKl_dky_mua() != null) {
String Kl_dky_mua = ctietVO.getKl_dky_mua();
ctietVO.setKl_dky_mua(StringUtil.convertNumberToString(Kl_dky_mua, "VND"));
}
if (ctietVO.getSo_tien_tt() != null) {
String So_tien_tt = ctietVO.getSo_tien_tt();
ctietVO.setSo_tien_tt(StringUtil.convertNumberToString(So_tien_tt, "VND"));
}
BeanUtils.copyProperties(ctietForm, ctietVO);
lstCTietForm.add(ctietForm);
}
f.setLstKQBanLe_CTiet(lstCTietForm);
//End Chitiet
} catch (Exception e) {
conn.rollback();
throw e;
} finally {
close(conn);
}
return mapping.findForward(SUCCESS);
}
public String getDate() {
String date = FastDateFormat.getInstance("dd/MM/yyyy").format(System.currentTimeMillis());
return date;
}
public ActionForward pheDuyetAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
Connection conn = null;
String errMess = "";
try {
conn = getConnection(request);
BanLeTraiPhieuTwForm f = (BanLeTraiPhieuTwForm)form;
BanLeTraiPhieuTwVO vo = new BanLeTraiPhieuTwVO();
HttpSession session = request.getSession();
String nUserID = session.getAttribute(AppConstants.APP_USER_ID_SESSION).toString();
BeanUtils.copyProperties(vo, f);
vo.setTrang_thai("02");
vo.setNgay_duyet(getDate());
vo.setNguoi_duyet(nUserID);
BanLeTraiPhieuTwDelegate delegate = new BanLeTraiPhieuTwDelegate(conn);
long idAdd = delegate.update(vo);
//insert history
UserHistoryVO userHisVO = new UserHistoryVO();
userHisVO.setNguoi_tdoi(new Long(nUserID));
userHisVO.setNoi_dung_thaydoi("Phe duyet ban le trai phieu tw" + idAdd);
userHisVO.setNsd_id(idAdd);
delegate.insertHistoryUser(userHisVO);
f.reset(mapping, request);
if (idAdd != 0) {
errMess = "BanLeTraiPhieuTw.pheduyet.succ";
} else
errMess = "BanLeTraiPhieuTw.pheduyet.error";
saveMessage(request, new TPCPException(errMess));
} catch (Exception e) {
conn.rollback();
throw e;
} finally {
close(conn);
}
return mapping.findForward(SUCCESS);
}
public ActionForward tuchoiAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
Connection conn = null;
String errMess = "";
try {
conn = getConnection(request);
BanLeTraiPhieuTwForm f = (BanLeTraiPhieuTwForm)form;
BanLeTraiPhieuTwVO vo = new BanLeTraiPhieuTwVO();
HttpSession session = request.getSession();
String nUserID = session.getAttribute(AppConstants.APP_USER_ID_SESSION).toString();
BeanUtils.copyProperties(vo, f);
vo.setTrang_thai("03");
vo.setNgay_duyet(getDate());
vo.setNguoi_duyet(nUserID);
BanLeTraiPhieuTwDelegate delegate = new BanLeTraiPhieuTwDelegate(conn);
long idAdd = delegate.update(vo);
//insert history
UserHistoryVO userHisVO = new UserHistoryVO();
userHisVO.setNguoi_tdoi(new Long(nUserID));
userHisVO.setNoi_dung_thaydoi("Tu choi ban le trai phieu tw" + idAdd);
userHisVO.setNsd_id(idAdd);
delegate.insertHistoryUser(userHisVO);
f.reset(mapping, request);
if (idAdd != 0) {
errMess = "BanLeTraiPhieuTw.tuchoi.succ";
} else
errMess = "BanLeTraiPhieuTw.tuchoi.error";
saveMessage(request, new TPCPException(errMess));
} catch (Exception e) {
conn.rollback();
throw e;
} finally {
close(conn);
}
return mapping.findForward(SUCCESS);
}
public void getInt(HttpServletRequest request) throws Exception {
Connection conn = null;
try {
conn = getConnection(request);
QuanLyTPCPDelegate delegate = new QuanLyTPCPDelegate(conn);
List listTPCP = new ArrayList();
listTPCP = (List)delegate.getLstTPCP_TIN_PHIEU();
request.setAttribute("lstAllTPCP", listTPCP);
//
//QuanLyTPCPDelegate qlyTPCPDelegate = new QuanLyTPCPDelegate(conn);
// Map<String ,Object> mapTPCP = new HashMap();
//mapTPCP.put("",)
DMKyHanDelegate khDelegate = new DMKyHanDelegate(conn);
Map<String, Object> map = new HashMap<String, Object>();
map.put("loai_tpcp", "TIN_PHIEU");
List listKyHan = null;
listKyHan = (List)khDelegate.getDMKyHan(map);
request.setAttribute("listKyHan", listKyHan);
} catch (Exception e) {
throw e;
} finally {
close(conn);
}
}
}
| [
"vubaquang123@gmail.com"
] | vubaquang123@gmail.com |
80150cf670508d6bc34073ee773600f629fc077b | 318d358553a41168bd971cc239311eda92bfdbdd | /herddb-mock/src/main/java/com/jayway/jsonpath/spi/json/JsonProvider.java | 93011fc09b66eb9cd371eaacb1b5ee24c8a3b87f | [
"Apache-2.0"
] | permissive | diennea/herddb | 3dfd5bc6bdd77e2c4799b4844c33acdb72b6735e | 47d992f1171af8e6344d4cd5812b73908b333870 | refs/heads/master | 2023-07-08T23:41:05.958875 | 2023-06-28T11:40:22 | 2023-06-28T11:40:22 | 52,507,351 | 300 | 58 | Apache-2.0 | 2023-09-06T08:17:37 | 2016-02-25T08:01:32 | Java | UTF-8 | Java | false | false | 909 | java | /*
Licensed to Diennea S.r.l. under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. Diennea S.r.l. 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
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
package com.jayway.jsonpath.spi.json;
/**
* This is only a dummy class to allow us to not depend on JSONPath.
*/
public interface JsonProvider {
}
| [
"noreply@github.com"
] | diennea.noreply@github.com |
1b9ef2eafda23b2ce7ca8b41e3a3c576ab6a9e01 | c424b465461b8f03f855df3e6fa8b93a26f6eb1c | /Binary Search Tree/DriverClass.java | c1cf05b15c32a6abb697f1bb9b8b1ef668bfc1a0 | [] | no_license | amurark/algosCode | fde5bd7f615b5deb2b5bd882e81382f8481509cb | 4219bc55029aa4a702878ebe704dcc8a2aaab811 | refs/heads/master | 2021-03-24T10:03:34.107312 | 2016-02-18T01:55:17 | 2016-02-18T01:55:17 | 51,799,828 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,148 | java | import java.util.Scanner;
/**
* Binary Search Tree - search, show, insert.
* Input Format: ArrayLength followed by array elements
* @author Ankit
* 02-16-2016
*/
public class DriverClass {
public static void main(String[] args) {
int length = Integer.parseInt(args[0]);
int[] arr = new int[length];
/**
* Initializing the tree.
*/
BinaryTree tree = new BinaryTree();
/**
* Setting the first element in the array as the root of the tree.
*/
tree.setRoot(new Node(Integer.parseInt(args[1])));
for(int i = 0; i < length; i++) {
arr[i] = Integer.parseInt(args[i+1]);
}
/**
* Insert to tree
*/
for(int i = 0; i < length; i++) {
tree.insert(arr[i]);
}
/**
* Show the tree in ascending order.
*/
tree.show();
System.out.println("Enter the number you want to search");
Scanner sc = new Scanner(System.in);
// int srch = sc.nextInt();
// tree.search(srch);
System.out.println("Enter the number you want to delete");
int del = sc.nextInt();
tree.delete(del);
System.out.println("=======================================");
tree.show();
sc.close();
}
}
| [
"amurark@ncsu.edu"
] | amurark@ncsu.edu |
8d5dc72a23471a7030b2c1235e2f77e8cac99369 | e26a8434566b1de6ea6cbed56a49fdb2abcba88b | /model-seev-mx/src/generated/java/com/prowidesoftware/swift/model/mx/MxSeev04200109.java | ae4d58e4184b8eb19c8a3cf88c46f3c1c5b532a0 | [
"Apache-2.0"
] | permissive | adilkangerey/prowide-iso20022 | 6476c9eb8fafc1b1c18c330f606b5aca7b8b0368 | 3bbbd6804eb9dc4e1440680e5f9f7a1726df5a61 | refs/heads/master | 2023-09-05T21:41:47.480238 | 2021-10-03T20:15:26 | 2021-10-03T20:15:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,865 | java |
package com.prowidesoftware.swift.model.mx;
import com.prowidesoftware.swift.model.mx.dic.*;
import com.prowidesoftware.swift.model.mx.AbstractMX;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.prowidesoftware.swift.model.MxSwiftMessage;
import com.prowidesoftware.swift.model.mx.AbstractMX;
import com.prowidesoftware.swift.model.mx.MxRead;
import com.prowidesoftware.swift.model.mx.MxReadImpl;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* Class for seev.042.001.09 ISO 20022 message.
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Document", propOrder = {
"corpActnInstrStmtRpt"
})
@XmlRootElement(name = "Document", namespace = "urn:iso:std:iso:20022:tech:xsd:seev.042.001.09")
public class MxSeev04200109
extends AbstractMX
{
@XmlElement(name = "CorpActnInstrStmtRpt", required = true)
protected CorporateActionInstructionStatementReportV09 corpActnInstrStmtRpt;
public final static transient String BUSINESS_PROCESS = "seev";
public final static transient int FUNCTIONALITY = 42;
public final static transient int VARIANT = 1;
public final static transient int VERSION = 9;
@SuppressWarnings("rawtypes")
public final static transient Class[] _classes = new Class[] {AccountIdentification53 .class, ActiveCurrencyAnd13DecimalAmount.class, AmountPrice3 .class, AmountPriceType1Code.class, BalanceFormat5Choice.class, CancelledReason8Choice.class, CancelledStatus12Choice.class, CancelledStatusReason11 .class, CancelledStatusReason6Code.class, CorporateActionBalance41 .class, CorporateActionEventAndBalance17 .class, CorporateActionEventDeadlines3 .class, CorporateActionEventType29Code.class, CorporateActionEventType85Choice.class, CorporateActionInstructionStatementReportV09 .class, CorporateActionMandatoryVoluntary1Code.class, CorporateActionMandatoryVoluntary3Choice.class, CorporateActionOption11Code.class, CorporateActionOption30Choice.class, CorporateActionStatementReportingType1Code.class, CorporateActionStatementType2Code.class, DateAndDateTime2Choice.class, DateCode19Choice.class, DateCode21Choice.class, DateCodeAndTimeFormat3 .class, DateFormat43Choice.class, DateFormat44Choice.class, DateOrDateTimePeriod1Choice.class, DatePeriod2 .class, DateTimePeriod1 .class, DateType7Code.class, DateType8Code.class, DefaultProcessingOrStandingInstruction1Choice.class, DeliveryReceiptType2Code.class, EventFrequency4Code.class, EventInformation13 .class, FinancialInstrumentQuantity1Choice.class, Frequency25Choice.class, GenericIdentification30 .class, GenericIdentification36 .class, GenericIdentification78 .class, IdentificationSource3Choice.class, InstructedBalance11 .class, InstructedCorporateActionOption12 .class, InstructionProcessingStatus32Choice.class, MxSeev04200109 .class, NoReasonCode.class, NoSpecifiedReason1 .class, NotificationIdentification5 .class, OptionInstructionDetails3 .class, OriginalAndCurrentQuantities6 .class, OtherIdentification1 .class, Pagination1 .class, PartyIdentification127Choice.class, PendingBalance5 .class, PendingCancellationReason5Choice.class, PendingCancellationReason5Code.class, PendingCancellationStatus7Choice.class, PendingCancellationStatusReason7 .class, PercentagePrice1 .class, PriceFormat45Choice.class, PriceRateType3Code.class, PriceValueType10Code.class, ProprietaryQuantity7 .class, ProprietaryQuantity8 .class, ProtectTransactionType2Code.class, Quantity17Choice.class, Quantity18Choice.class, Quantity19Choice.class, RejectedReason25Choice.class, RejectedStatus26Choice.class, RejectedStatusReason24 .class, RejectionReason49Code.class, SafekeepingPlace1Code.class, SafekeepingPlace2Code.class, SafekeepingPlaceFormat28Choice.class, SafekeepingPlaceTypeAndIdentification1 .class, SafekeepingPlaceTypeAndText6 .class, SecurityIdentification19 .class, SettlementTypeAndIdentification25 .class, ShortLong1Code.class, SignedQuantityFormat6 .class, SignedQuantityFormat7 .class, Statement72 .class, StatementUpdateType1Code.class, SupplementaryData1 .class, SupplementaryDataEnvelope1 .class, UpdateType15Choice.class };
public final static transient String NAMESPACE = "urn:iso:std:iso:20022:tech:xsd:seev.042.001.09";
public MxSeev04200109() {
super();
}
/**
* Creates the MX object parsing the parameter String with the XML content
*
*/
public MxSeev04200109(final String xml) {
this();
MxSeev04200109 tmp = parse(xml);
corpActnInstrStmtRpt = tmp.getCorpActnInstrStmtRpt();
}
/**
* Creates the MX object parsing the raw content from the parameter MxSwiftMessage
*
*/
public MxSeev04200109(final MxSwiftMessage mxSwiftMessage) {
this(mxSwiftMessage.message());
}
/**
* Gets the value of the corpActnInstrStmtRpt property.
*
* @return
* possible object is
* {@link CorporateActionInstructionStatementReportV09 }
*
*/
public CorporateActionInstructionStatementReportV09 getCorpActnInstrStmtRpt() {
return corpActnInstrStmtRpt;
}
/**
* Sets the value of the corpActnInstrStmtRpt property.
*
* @param value
* allowed object is
* {@link CorporateActionInstructionStatementReportV09 }
*
*/
public MxSeev04200109 setCorpActnInstrStmtRpt(CorporateActionInstructionStatementReportV09 value) {
this.corpActnInstrStmtRpt = value;
return this;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
}
@Override
public boolean equals(Object that) {
return EqualsBuilder.reflectionEquals(this, that);
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
@Override
public String getBusinessProcess() {
return BUSINESS_PROCESS;
}
@Override
public int getFunctionality() {
return FUNCTIONALITY;
}
@Override
public int getVariant() {
return VARIANT;
}
@Override
public int getVersion() {
return VERSION;
}
/**
* Creates the MX object parsing the raw content from the parameter XML
*
*/
public static MxSeev04200109 parse(String xml) {
return ((MxSeev04200109) MxReadImpl.parse(MxSeev04200109 .class, xml, _classes));
}
/**
* Creates the MX object parsing the raw content from the parameter XML with injected read implementation
* @since 9.0.1
*
* @param parserImpl an MX unmarshall implementation
*/
public static MxSeev04200109 parse(String xml, MxRead parserImpl) {
return ((MxSeev04200109) parserImpl.read(MxSeev04200109 .class, xml, _classes));
}
@Override
public String getNamespace() {
return NAMESPACE;
}
@Override
@SuppressWarnings("rawtypes")
public Class[] getClasses() {
return _classes;
}
/**
* Creates an MxSeev04200109 messages from its JSON representation.
* <p>
* For generic conversion of JSON into the corresponding MX instance
* see {@link AbstractMX#fromJson(String)}
*
* @since 7.10.2
*
* @param json a JSON representation of an MxSeev04200109 message
* @return
* a new instance of MxSeev04200109
*/
public final static MxSeev04200109 fromJson(String json) {
return AbstractMX.fromJson(json, MxSeev04200109 .class);
}
}
| [
"sebastian@prowidesoftware.com"
] | sebastian@prowidesoftware.com |
f28f82d886c01bee8bf14423ed0a82f7c008d202 | b55f1244e81888a693232d69fcf0f10664584b02 | /HsCalendarLib/src/main/java/kr/co/hs/HsCalendar/WeekView.java | 8d00624c76803bc488229807d2ff455352bfb862 | [] | no_license | hsbaewa/HsCalendar | 0878a91f9ee665691e1f5178235e274a9b80a87c | e2455526c4168f6b0eda1de02c72f1ec17bc69f9 | refs/heads/master | 2021-01-12T04:18:58.195707 | 2016-12-29T08:30:20 | 2016-12-29T08:30:20 | 77,584,321 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,817 | java | package kr.co.hs.HsCalendar;
import android.content.Context;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.CardView;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.text.SimpleDateFormat;
import java.util.Calendar;
/**
* Created by Bae on 2016-12-28.
*/
public class WeekView extends LinearLayout implements View.OnClickListener {
private Calendar mCurrentCalendar;
private OnClickWeekListener mOnClickWeekListener;
public WeekView(Context context) {
super(context);
init();
}
public WeekView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public WeekView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
private TextView[][] tvDate;
private CardView[] mCardView;
private void init(){
View view = LayoutInflater.from(getContext()).inflate(R.layout.view_calendar, null);
tvDate = new TextView[6][7];
tvDate[0][0] = (TextView) view.findViewById(R.id.TextView00);
tvDate[0][1] = (TextView) view.findViewById(R.id.TextView01);
tvDate[0][2] = (TextView) view.findViewById(R.id.TextView02);
tvDate[0][3] = (TextView) view.findViewById(R.id.TextView03);
tvDate[0][4] = (TextView) view.findViewById(R.id.TextView04);
tvDate[0][5] = (TextView) view.findViewById(R.id.TextView05);
tvDate[0][6] = (TextView) view.findViewById(R.id.TextView06);
tvDate[1][0] = (TextView) view.findViewById(R.id.TextView10);
tvDate[1][1] = (TextView) view.findViewById(R.id.TextView11);
tvDate[1][2] = (TextView) view.findViewById(R.id.TextView12);
tvDate[1][3] = (TextView) view.findViewById(R.id.TextView13);
tvDate[1][4] = (TextView) view.findViewById(R.id.TextView14);
tvDate[1][5] = (TextView) view.findViewById(R.id.TextView15);
tvDate[1][6] = (TextView) view.findViewById(R.id.TextView16);
tvDate[2][0] = (TextView) view.findViewById(R.id.TextView20);
tvDate[2][1] = (TextView) view.findViewById(R.id.TextView21);
tvDate[2][2] = (TextView) view.findViewById(R.id.TextView22);
tvDate[2][3] = (TextView) view.findViewById(R.id.TextView23);
tvDate[2][4] = (TextView) view.findViewById(R.id.TextView24);
tvDate[2][5] = (TextView) view.findViewById(R.id.TextView25);
tvDate[2][6] = (TextView) view.findViewById(R.id.TextView26);
tvDate[3][0] = (TextView) view.findViewById(R.id.TextView30);
tvDate[3][1] = (TextView) view.findViewById(R.id.TextView31);
tvDate[3][2] = (TextView) view.findViewById(R.id.TextView32);
tvDate[3][3] = (TextView) view.findViewById(R.id.TextView33);
tvDate[3][4] = (TextView) view.findViewById(R.id.TextView34);
tvDate[3][5] = (TextView) view.findViewById(R.id.TextView35);
tvDate[3][6] = (TextView) view.findViewById(R.id.TextView36);
tvDate[4][0] = (TextView) view.findViewById(R.id.TextView40);
tvDate[4][1] = (TextView) view.findViewById(R.id.TextView41);
tvDate[4][2] = (TextView) view.findViewById(R.id.TextView42);
tvDate[4][3] = (TextView) view.findViewById(R.id.TextView43);
tvDate[4][4] = (TextView) view.findViewById(R.id.TextView44);
tvDate[4][5] = (TextView) view.findViewById(R.id.TextView45);
tvDate[4][6] = (TextView) view.findViewById(R.id.TextView46);
tvDate[5][0] = (TextView) view.findViewById(R.id.TextView50);
tvDate[5][1] = (TextView) view.findViewById(R.id.TextView51);
tvDate[5][2] = (TextView) view.findViewById(R.id.TextView52);
tvDate[5][3] = (TextView) view.findViewById(R.id.TextView53);
tvDate[5][4] = (TextView) view.findViewById(R.id.TextView54);
tvDate[5][5] = (TextView) view.findViewById(R.id.TextView55);
tvDate[5][6] = (TextView) view.findViewById(R.id.TextView56);
mCardView = new CardView[6];
mCardView[0] = (CardView) view.findViewById(R.id.CardView0);
mCardView[0].setTag(0);
mCardView[1] = (CardView) view.findViewById(R.id.CardView1);
mCardView[1].setTag(1);
mCardView[2] = (CardView) view.findViewById(R.id.CardView2);
mCardView[2].setTag(2);
mCardView[3] = (CardView) view.findViewById(R.id.CardView3);
mCardView[3].setTag(3);
mCardView[4] = (CardView) view.findViewById(R.id.CardView4);
mCardView[4].setTag(4);
mCardView[5] = (CardView) view.findViewById(R.id.CardView5);
mCardView[5].setTag(5);
for(int i=0;i<mCardView.length;i++){
mCardView[i].setOnClickListener(this);
}
addView(view);
}
private void initValue(){
if(tvDate != null){
for(int i=0;i<tvDate.length;i++){
for(int j=0;j<tvDate[i].length;j++){
tvDate[i][j].setText("");
}
}
}
}
public void setValue(Calendar calendar){
initValue();
mCurrentCalendar = (Calendar) calendar.clone();
//이번달의 마지막날
int month = calendar.get(Calendar.MONTH);
int maxDate = calendar.getActualMaximum(Calendar.DATE);
int year = calendar.get(Calendar.YEAR);
int date = calendar.get(Calendar.DATE);
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
int currentMonth = Calendar.getInstance().get(Calendar.MONTH);
int currentDate = Calendar.getInstance().get(Calendar.DATE);
boolean isLastdayCheck = false;
if(currentYear == year && currentMonth == month && currentDate == date)
isLastdayCheck = true;
int currentLine = 0;
int maxLine = -1;
int dayCount = 1;
//이번 달의 1일이 무슨요일?
calendar.set(Calendar.DATE, 1);
int dow = calendar.get(Calendar.DAY_OF_WEEK);
for(;dow<8;dow++){
if(isLastdayCheck && dayCount>currentDate){
if(maxLine < 0)
maxLine = currentLine;
tvDate[currentLine][dow-1].setTextColor(ContextCompat.getColor(getContext(), R.color.colorGrey100));
if(currentLine > maxLine)
mCardView[currentLine].setOnClickListener(null);
}else{
if((dow-1) == 0)
tvDate[currentLine][dow-1].setTextColor(ContextCompat.getColor(getContext(), R.color.colorRed500));
else if((dow-1) == 6)
tvDate[currentLine][dow-1].setTextColor(ContextCompat.getColor(getContext(), R.color.colorBlue500));
}
tvDate[currentLine][dow-1].setText(""+dayCount++);
}
dow = calendar.get(Calendar.DAY_OF_WEEK);
int lastIdx = -1;
//다음줄부터 채워나감
while(dayCount <= maxDate){
currentLine++;
for(lastIdx=0;lastIdx<7;lastIdx++){
if(isLastdayCheck && dayCount>currentDate){
if(maxLine < 0)
maxLine = currentLine;
if(currentLine > maxLine)
mCardView[currentLine].setOnClickListener(null);
tvDate[currentLine][lastIdx].setTextColor(ContextCompat.getColor(getContext(), R.color.colorGrey100));
}else{
if(lastIdx == 0)
tvDate[currentLine][lastIdx].setTextColor(ContextCompat.getColor(getContext(), R.color.colorRed500));
else if(lastIdx == 6)
tvDate[currentLine][lastIdx].setTextColor(ContextCompat.getColor(getContext(), R.color.colorBlue500));
}
tvDate[currentLine][lastIdx].setText(""+dayCount++);
if(dayCount > maxDate){
lastIdx++;
break;
}
}
}
//이전달 날짜 채우기
calendar.add(Calendar.MONTH, -1);
int lastDate = calendar.getActualMaximum(Calendar.DATE);
for(int i=0;i<(dow-1);i++){
tvDate[0][i].setText(""+(lastDate-(dow-1)+i+1));
if(i == 0)
tvDate[0][i].setTextColor(ContextCompat.getColor(getContext(), R.color.colorRed200));
else if(i == 6)
tvDate[0][i].setTextColor(ContextCompat.getColor(getContext(), R.color.colorBlue200));
else
tvDate[0][i].setTextColor(ContextCompat.getColor(getContext(), R.color.colorGrey300));
}
//다음달 날짜 채우기
calendar.add(Calendar.MONTH, 2);
int firstDate = calendar.getActualMinimum(Calendar.DATE);
for(;currentLine<tvDate.length;currentLine++){
for(int i = lastIdx;i<7;i++){
if(isLastdayCheck){
tvDate[currentLine][i].setTextColor(ContextCompat.getColor(getContext(), R.color.colorGrey100));
if(maxLine < 0)
maxLine = currentLine;
if(currentLine > maxLine)
mCardView[currentLine].setOnClickListener(null);
}else{
if(i == 0)
tvDate[currentLine][i].setTextColor(ContextCompat.getColor(getContext(), R.color.colorRed200));
else if(i == 6)
tvDate[currentLine][i].setTextColor(ContextCompat.getColor(getContext(), R.color.colorBlue200));
else
tvDate[currentLine][i].setTextColor(ContextCompat.getColor(getContext(), R.color.colorGrey300));
}
tvDate[currentLine][i].setText(""+firstDate++);
}
lastIdx = 0;
}
}
private void setValue(){
//달력 만들기
//지금 날짜 가져와
Calendar calendar = Calendar.getInstance();
setValue(calendar);
}
public void setOnClickWeekListener(OnClickWeekListener onClickWeekListener){
this.mOnClickWeekListener = onClickWeekListener;
}
@Override
public void onClick(View view) {
if(this.mOnClickWeekListener != null){
int cnt = (int) view.getTag();
this.mOnClickWeekListener.onClickWeek(getWeekFirstTimeStamp(cnt), getWeekLastTimeStamp(cnt));
}
}
// 사용편리를 위해 작성한 함수 : dip 값을 pixel 값으로 변환하는 함수
public float getDip(float value) {
return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value, getResources().getDisplayMetrics());
}
public long getWeekFirstTimeStamp(int idx){
Calendar tempCal = (Calendar) this.mCurrentCalendar.clone();
long result = tempCal.getTimeInMillis();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy MM dd HH:mm:ss");
String log = sdf.format(result);
tempCal.set(Calendar.WEEK_OF_MONTH, idx+1);
tempCal.set(Calendar.DAY_OF_WEEK, 1);
result = tempCal.getTimeInMillis();
log = sdf.format(result);
return result;
}
public long getWeekLastTimeStamp(int idx){
Calendar tempCal = (Calendar) this.mCurrentCalendar.clone();
tempCal.set(Calendar.WEEK_OF_MONTH, idx+1);
tempCal.set(Calendar.DAY_OF_WEEK, 7);
long result = tempCal.getTimeInMillis();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy MM dd HH:mm:ss");
String log = sdf.format(result);
return result;
}
public interface OnClickWeekListener{
void onClickWeek(long start, long end);
}
}
| [
"hsbaewa@gmail.com"
] | hsbaewa@gmail.com |
eda2fae2f5e47f3882724d9a365930d058a71acc | fa1408365e2e3f372aa61e7d1e5ea5afcd652199 | /src/testcases/CWE89_SQL_Injection/s04/CWE89_SQL_Injection__URLConnection_executeQuery_07.java | 6820017fd6b908ad0656ed5a6b5e8e0b2be8f1ac | [] | no_license | bqcuong/Juliet-Test-Case | 31e9c89c27bf54a07b7ba547eddd029287b2e191 | e770f1c3969be76fdba5d7760e036f9ba060957d | refs/heads/master | 2020-07-17T14:51:49.610703 | 2019-09-03T16:22:58 | 2019-09-03T16:22:58 | 206,039,578 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 20,694 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE89_SQL_Injection__URLConnection_executeQuery_07.java
Label Definition File: CWE89_SQL_Injection.label.xml
Template File: sources-sinks-07.tmpl.java
*/
/*
* @description
* CWE: 89 SQL Injection
* BadSource: URLConnection Read data from a web server with URLConnection
* GoodSource: A hardcoded string
* Sinks: executeQuery
* GoodSink: Use prepared statement and executeQuery (properly)
* BadSink : data concatenated into SQL statement used in executeQuery(), which could result in SQL Injection
* Flow Variant: 07 Control flow: if(privateFive==5) and if(privateFive!=5)
*
* */
package testcases.CWE89_SQL_Injection.s04;
import testcasesupport.*;
import javax.servlet.http.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import java.util.logging.Level;
import java.sql.*;
public class CWE89_SQL_Injection__URLConnection_executeQuery_07 extends AbstractTestCase
{
/* The variable below is not declared "final", but is never assigned
* any other value so a tool should be able to identify that reads of
* this will always give its initialized value. */
private int privateFive = 5;
public void bad() throws Throwable
{
String data;
if (privateFive==5)
{
data = ""; /* Initialize data */
/* read input from URLConnection */
{
URLConnection urlConnection = (new URL("http://www.example.org/")).openConnection();
BufferedReader readerBuffered = null;
InputStreamReader readerInputStream = null;
try
{
readerInputStream = new InputStreamReader(urlConnection.getInputStream(), "UTF-8");
readerBuffered = new BufferedReader(readerInputStream);
/* POTENTIAL FLAW: Read data from a web server with URLConnection */
/* This will be reading the first "line" of the response body,
* which could be very long if there are no newlines in the HTML */
data = readerBuffered.readLine();
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO);
}
finally
{
/* clean up stream reading objects */
try
{
if (readerBuffered != null)
{
readerBuffered.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO);
}
try
{
if (readerInputStream != null)
{
readerInputStream.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO);
}
}
}
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = null;
}
if (privateFive==5)
{
Connection dbConnection = null;
Statement sqlStatement = null;
ResultSet resultSet = null;
try
{
dbConnection = IO.getDBConnection();
sqlStatement = dbConnection.createStatement();
/* POTENTIAL FLAW: data concatenated into SQL statement used in executeQuery(), which could result in SQL Injection */
resultSet = sqlStatement.executeQuery("select * from users where name='"+data+"'");
IO.writeLine(resultSet.getRow()); /* Use ResultSet in some way */
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql);
}
finally
{
try
{
if (resultSet != null)
{
resultSet.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing ResultSet", exceptSql);
}
try
{
if (sqlStatement != null)
{
sqlStatement.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing Statement", exceptSql);
}
try
{
if (dbConnection != null)
{
dbConnection.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql);
}
}
}
}
/* goodG2B1() - use goodsource and badsink by changing first privateFive==5 to privateFive!=5 */
private void goodG2B1() throws Throwable
{
String data;
if (privateFive!=5)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = null;
}
else
{
/* FIX: Use a hardcoded string */
data = "foo";
}
if (privateFive==5)
{
Connection dbConnection = null;
Statement sqlStatement = null;
ResultSet resultSet = null;
try
{
dbConnection = IO.getDBConnection();
sqlStatement = dbConnection.createStatement();
/* POTENTIAL FLAW: data concatenated into SQL statement used in executeQuery(), which could result in SQL Injection */
resultSet = sqlStatement.executeQuery("select * from users where name='"+data+"'");
IO.writeLine(resultSet.getRow()); /* Use ResultSet in some way */
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql);
}
finally
{
try
{
if (resultSet != null)
{
resultSet.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing ResultSet", exceptSql);
}
try
{
if (sqlStatement != null)
{
sqlStatement.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing Statement", exceptSql);
}
try
{
if (dbConnection != null)
{
dbConnection.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql);
}
}
}
}
/* goodG2B2() - use goodsource and badsink by reversing statements in first if */
private void goodG2B2() throws Throwable
{
String data;
if (privateFive==5)
{
/* FIX: Use a hardcoded string */
data = "foo";
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = null;
}
if (privateFive==5)
{
Connection dbConnection = null;
Statement sqlStatement = null;
ResultSet resultSet = null;
try
{
dbConnection = IO.getDBConnection();
sqlStatement = dbConnection.createStatement();
/* POTENTIAL FLAW: data concatenated into SQL statement used in executeQuery(), which could result in SQL Injection */
resultSet = sqlStatement.executeQuery("select * from users where name='"+data+"'");
IO.writeLine(resultSet.getRow()); /* Use ResultSet in some way */
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql);
}
finally
{
try
{
if (resultSet != null)
{
resultSet.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing ResultSet", exceptSql);
}
try
{
if (sqlStatement != null)
{
sqlStatement.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing Statement", exceptSql);
}
try
{
if (dbConnection != null)
{
dbConnection.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql);
}
}
}
}
/* goodB2G1() - use badsource and goodsink by changing second privateFive==5 to privateFive!=5 */
private void goodB2G1() throws Throwable
{
String data;
if (privateFive==5)
{
data = ""; /* Initialize data */
/* read input from URLConnection */
{
URLConnection urlConnection = (new URL("http://www.example.org/")).openConnection();
BufferedReader readerBuffered = null;
InputStreamReader readerInputStream = null;
try
{
readerInputStream = new InputStreamReader(urlConnection.getInputStream(), "UTF-8");
readerBuffered = new BufferedReader(readerInputStream);
/* POTENTIAL FLAW: Read data from a web server with URLConnection */
/* This will be reading the first "line" of the response body,
* which could be very long if there are no newlines in the HTML */
data = readerBuffered.readLine();
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO);
}
finally
{
/* clean up stream reading objects */
try
{
if (readerBuffered != null)
{
readerBuffered.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO);
}
try
{
if (readerInputStream != null)
{
readerInputStream.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO);
}
}
}
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = null;
}
if (privateFive!=5)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
IO.writeLine("Benign, fixed string");
}
else
{
Connection dbConnection = null;
PreparedStatement sqlStatement = null;
ResultSet resultSet = null;
try
{
/* FIX: Use prepared statement and executeQuery (properly) */
dbConnection = IO.getDBConnection();
sqlStatement = dbConnection.prepareStatement("select * from users where name=?");
sqlStatement.setString(1, data);
resultSet = sqlStatement.executeQuery();
IO.writeLine(resultSet.getRow()); /* Use ResultSet in some way */
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql);
}
finally
{
try
{
if (resultSet != null)
{
resultSet.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing ResultSet", exceptSql);
}
try
{
if (sqlStatement != null)
{
sqlStatement.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing PreparedStatement", exceptSql);
}
try
{
if (dbConnection != null)
{
dbConnection.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql);
}
}
}
}
/* goodB2G2() - use badsource and goodsink by reversing statements in second if */
private void goodB2G2() throws Throwable
{
String data;
if (privateFive==5)
{
data = ""; /* Initialize data */
/* read input from URLConnection */
{
URLConnection urlConnection = (new URL("http://www.example.org/")).openConnection();
BufferedReader readerBuffered = null;
InputStreamReader readerInputStream = null;
try
{
readerInputStream = new InputStreamReader(urlConnection.getInputStream(), "UTF-8");
readerBuffered = new BufferedReader(readerInputStream);
/* POTENTIAL FLAW: Read data from a web server with URLConnection */
/* This will be reading the first "line" of the response body,
* which could be very long if there are no newlines in the HTML */
data = readerBuffered.readLine();
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO);
}
finally
{
/* clean up stream reading objects */
try
{
if (readerBuffered != null)
{
readerBuffered.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO);
}
try
{
if (readerInputStream != null)
{
readerInputStream.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO);
}
}
}
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = null;
}
if (privateFive==5)
{
Connection dbConnection = null;
PreparedStatement sqlStatement = null;
ResultSet resultSet = null;
try
{
/* FIX: Use prepared statement and executeQuery (properly) */
dbConnection = IO.getDBConnection();
sqlStatement = dbConnection.prepareStatement("select * from users where name=?");
sqlStatement.setString(1, data);
resultSet = sqlStatement.executeQuery();
IO.writeLine(resultSet.getRow()); /* Use ResultSet in some way */
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql);
}
finally
{
try
{
if (resultSet != null)
{
resultSet.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing ResultSet", exceptSql);
}
try
{
if (sqlStatement != null)
{
sqlStatement.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing PreparedStatement", exceptSql);
}
try
{
if (dbConnection != null)
{
dbConnection.close();
}
}
catch (SQLException exceptSql)
{
IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql);
}
}
}
}
public void good() throws Throwable
{
goodG2B1();
goodG2B2();
goodB2G1();
goodB2G2();
}
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
| [
"bqcuong2212@gmail.com"
] | bqcuong2212@gmail.com |
f79bef9d3ae67831010995239d17fd5945f6cadd | 0583405ed5573848c23d5310014f71b4dbd5f66f | /app/src/main/java/cn/edu/gdmec/android/boxuegu/activity/SettingActivity.java | 738b708ff8e9554e4fc827ebd9cf9e4ef82d2226 | [] | no_license | 761471926/Boxuegu | 7451e6fa5048f7ce923f43acfab12719f0a468c5 | e76511b2adaca91003cd1cf3f46cdf0ff8a087b8 | refs/heads/master | 2021-09-09T09:04:35.435864 | 2018-03-14T14:29:58 | 2018-03-14T14:29:58 | 115,393,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,350 | java | package cn.edu.gdmec.android.boxuegu.activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import cn.edu.gdmec.android.boxuegu.R;
/**
* Created by student on 17/12/28.
*/
public class SettingActivity extends AppCompatActivity{
public static SettingActivity instance = null;
private TextView tv_main_title;
private TextView tv_back;
private RelativeLayout rl_title_bar;
private RelativeLayout rl_modify_psw;
private RelativeLayout rl_security_setting;
private RelativeLayout rl_exit_login;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_setting);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
instance = this;
init();
}
private void init() {
tv_main_title = (TextView) findViewById(R.id.tv_main_title);
tv_main_title.setText("设置");
tv_back = (TextView) findViewById(R.id.tv_back);
rl_title_bar = (RelativeLayout) findViewById(R.id.title_bar);
rl_title_bar.setBackgroundColor(Color.parseColor("#30B4FF"));
rl_modify_psw = (RelativeLayout) findViewById(R.id.rl_modify_psw);
rl_security_setting = (RelativeLayout) findViewById(R.id.rl_security_setting);
rl_exit_login = (RelativeLayout) findViewById(R.id.rl_exit_login);
tv_back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
SettingActivity.this.finish();
}
});
rl_modify_psw.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(SettingActivity.this,ModifyPswActivity.class);
startActivity(intent);
}
});
rl_security_setting.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(SettingActivity.this,FindPswActivity.class);
intent.putExtra("from","security");
startActivity(intent);
}
});
rl_exit_login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(SettingActivity.this,"退出登录成功",Toast.LENGTH_SHORT).show();
clearLoginStatus();
Intent data = new Intent();
data.putExtra("isLogin",false);
setResult(RESULT_OK,data);
SettingActivity.this.finish();
}
});
}
private void clearLoginStatus(){
SharedPreferences sp = getSharedPreferences("loginInfo", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putBoolean("isLogin",false);
editor.putString("loginUserName","");
editor.commit();
}
}
| [
"761471926@qq.com"
] | 761471926@qq.com |
62648e991be9625f082fd315f599990f715d906e | c65a307e02726d6534d76ae8f6b1bfec805d2014 | /app/src/main/java/com/artimanton/fluxstore/fragments/PageFragment2.java | 299a8eebe638589068a6f846cd25867d7a89441e | [] | no_license | artim-anton/Fluxstore | 6cb5f5971d56497e645950dd72a9a98baf4ee31d | ca85182c63c27e4144c694d9958efc34a238af0a | refs/heads/master | 2022-12-12T02:56:13.945541 | 2020-08-23T22:15:56 | 2020-08-23T22:15:56 | 287,721,788 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 753 | java | package com.artimanton.fluxstore.fragments;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.artimanton.fluxstore.R;
public class PageFragment2 extends Fragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater,
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
ViewGroup rootView = (ViewGroup)inflater.
inflate(R.layout.onboarding_2,container,
false);
return rootView;
}
}
| [
"artim-anton@yandex.ru"
] | artim-anton@yandex.ru |
27a788f432ac67845e72a3d6f09860e5d8d6cd82 | d44dd44bfaee6b1e5266ffd617d7c4f2af9d5198 | /contrib/storage-splunk/src/main/java/org/apache/drill/exec/store/splunk/SplunkScanSpec.java | 513db63707a306e91ec4e02e23f56b45839a0911 | [
"Apache-2.0",
"LicenseRef-scancode-unknown",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | vdiravka/drill | a1e97922e3b52c09ce97459271f52dc5f89d7a74 | 52838ef26e5e3e6b4461c2c656ffada0c64c9e88 | refs/heads/master | 2022-07-07T20:20:53.398107 | 2021-11-04T08:12:27 | 2021-11-04T10:05:42 | 50,912,340 | 1 | 0 | Apache-2.0 | 2018-06-07T10:49:27 | 2016-02-02T10:18:01 | Java | UTF-8 | Java | false | false | 2,033 | java | /*
* 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.drill.exec.store.splunk;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import org.apache.drill.common.PlanStringBuilder;
@JsonTypeName("splunk-scan-spec")
public class SplunkScanSpec {
private final String pluginName;
private final String indexName;
private final SplunkPluginConfig config;
@JsonCreator
public SplunkScanSpec(@JsonProperty("pluginName") String pluginName,
@JsonProperty("indexName") String indexName,
@JsonProperty("config") SplunkPluginConfig config) {
this.pluginName = pluginName;
this.indexName = indexName;
this.config = config;
}
@JsonProperty("pluginName")
public String getPluginName() { return pluginName; }
@JsonProperty("indexName")
public String getIndexName() { return indexName; }
@JsonProperty("config")
public SplunkPluginConfig getConfig() { return config; }
@Override
public String toString() {
return new PlanStringBuilder(this)
.field("config", config)
.field("schemaName", pluginName)
.field("indexName", indexName)
.toString();
}
}
| [
"cgivre@apache.org"
] | cgivre@apache.org |
fefa053bbbb3047b051e5200f5c714bcd24df1c9 | a40e05bce2e1a5d48e1ef1821e3245aa0d968bd0 | /src/glide3/java/com/bumptech/glide/supportapp/github/_938_background/GlideDrawableViewBackgroundTarget.java | e2737630441779246f7fc08a64e5fc435c2d57d3 | [
"Unlicense"
] | permissive | mwshubham/glide-support | f82596ae2f6574509e9d68f6cf06320f8b5844f9 | 8ec2ebc1efbfa0df1e97422ed3ae43cc1ae58be3 | refs/heads/master | 2020-04-24T17:37:11.054603 | 2019-02-23T00:48:07 | 2019-02-23T00:48:07 | 172,154,106 | 0 | 0 | Unlicense | 2019-02-23T00:48:34 | 2019-02-23T00:48:34 | null | UTF-8 | Java | false | false | 1,252 | java | package com.bumptech.glide.supportapp.github._938_background;
import android.widget.ImageView;
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.animation.GlideAnimation;
import com.bumptech.glide.request.target.GlideDrawableImageViewTarget;
/** @see GlideDrawableImageViewTarget */
public class GlideDrawableViewBackgroundTarget extends ViewBackgroundTarget<GlideDrawable> {
private int maxLoopCount;
private GlideDrawable resource;
public GlideDrawableViewBackgroundTarget(ImageView view) {
this(view, GlideDrawable.LOOP_FOREVER);
}
public GlideDrawableViewBackgroundTarget(ImageView view, int maxLoopCount) {
super(view);
this.maxLoopCount = maxLoopCount;
}
@Override public void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> animation) {
super.onResourceReady(resource, animation);
this.resource = resource;
resource.setLoopCount(maxLoopCount);
resource.start();
}
@Override protected void setResource(GlideDrawable resource) {
setBackground(resource);
}
@Override public void onStart() {
if (resource != null) {
resource.start();
}
}
@Override public void onStop() {
if (resource != null) {
resource.stop();
}
}
}
| [
"papp.robert.s@gmail.com"
] | papp.robert.s@gmail.com |
e224856e049c22fee1847e0c2c63d35da349d1a5 | 924c8213b85746f5d82bfc0662285c9d08848a1c | /distribution-common/src/main/java/com/vsc/model/property/details/response/Country.java | b66d1ecb86d122e27612ede80d32149675dd9a83 | [] | no_license | jebynot/distribution | d38df64d09e6d432ccad31ee0d3baf2b8cf03d24 | c614bb44c9747da816deedf434f016bf9ec94516 | refs/heads/master | 2021-01-10T08:59:13.458142 | 2016-02-29T03:07:10 | 2016-02-29T03:07:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,358 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7-b41
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.10.26 at 08:07:16 PM IST
//
package com.vsc.model.property.details.response;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <simpleContent>
* <extension base="<http://www.w3.org/2001/XMLSchema>string">
* <attribute name="code" type="{http://www.w3.org/2001/XMLSchema}string" />
* </extension>
* </simpleContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"value"
})
@XmlRootElement(name = "country")
public class Country {
@XmlValue
protected String value;
@XmlAttribute(name = "code")
protected String code;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}
/**
* Gets the value of the code property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCode() {
return code;
}
/**
* Sets the value of the code property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCode(String value) {
this.code = value;
}
}
| [
"jignatius@orbitz.com"
] | jignatius@orbitz.com |
ec9e0abb530b176c0181721fabbd53a9d6fa89e8 | e952882d529253261d251b8ac3c4f84d13391265 | /src/main/java/cn/xunyard/idea/coding/doc/ServiceDocBuildingService.java | 273a89fd2195d71251bbeb33e89380803d8aa026 | [] | permissive | guangrunshe/CodingHelper | a0185426c8e7b8ad624ed639393547984180446d | 794689b64c470fd32dbcd841a72a437f004d4320 | refs/heads/master | 2022-11-15T06:24:08.473599 | 2019-12-28T15:18:08 | 2019-12-28T15:18:08 | 255,558,139 | 1 | 0 | Apache-2.0 | 2020-04-14T08:53:42 | 2020-04-14T08:53:42 | null | UTF-8 | Java | false | false | 4,755 | java | package cn.xunyard.idea.coding.doc;
import cn.xunyard.idea.coding.doc.process.ProcessContext;
import cn.xunyard.idea.coding.log.Logger;
import cn.xunyard.idea.coding.log.LoggerFactory;
import cn.xunyard.idea.coding.util.AssertUtils;
import cn.xunyard.idea.coding.util.ProjectUtils;
import com.intellij.openapi.project.Project;
import com.thoughtworks.qdox.model.JavaClass;
import lombok.RequiredArgsConstructor;
import org.jetbrains.annotations.SystemIndependent;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* @author <a herf="mailto:wuqi@terminus.io">xunyard</a>
* @date 2019-12-15
*/
public class ServiceDocBuildingService {
private final Logger log = LoggerFactory.getLogger(DocConfig.IDENTITY);
private final DocConfig docConfig;
private final ThreadPoolExecutor THREAD_POOL = new ThreadPoolExecutor(1, 1, 1,
TimeUnit.MINUTES, new LinkedBlockingDeque<>());
public ServiceDocBuildingService(DocConfig docConfig) {
this.docConfig = docConfig;
}
public synchronized void run(Project project) {
if (THREAD_POOL.getActiveCount() > 0) {
log.error("尚有任务在进行中,提交失败!");
throw new RuntimeException("submit.forbidden");
}
TaskRunner taskRunner = new TaskRunner(docConfig, project);
THREAD_POOL.submit(taskRunner);
}
@RequiredArgsConstructor
private static class TaskRunner implements Runnable {
private final Logger log = LoggerFactory.getLogger(DocConfig.IDENTITY);
private final DocConfig docConfig;
private final Project project;
@Override
public void run() {
ProjectUtils.PROJECT.set(project);
@SystemIndependent String basePath = project.getBasePath();
run(basePath);
ProjectUtils.PROJECT.remove();
}
public void run(String basePath) {
if (!checkOutput()) {
return;
}
ProcessContext processContext = new ProcessContext(docConfig);
try {
processContext.init();
ServiceScanner serviceScanner = new ServiceScanner(processContext);
List<JavaClass> serviceJavaClassList = serviceScanner.scan(basePath);
if (AssertUtils.isEmpty(serviceJavaClassList)) {
log.error("过程终止,未发现有效源文件路径!");
return;
}
ServiceResolver serviceResolver = new ServiceResolver(serviceJavaClassList, processContext);
if (!serviceResolver.run() && !docConfig.getAllowInfoMissing()) {
log.error("过程终止,修复注释缺失问题或者打开忽略开关以继续!");
return;
}
ServiceDocumentBuilder documentBuilder = new ServiceDocumentBuilder(processContext, serviceResolver.getServiceDescriberList());
documentBuilder.run();
} catch (Exception e) {
log.error("fail to run, cause: " + formatException(e));
} finally {
processContext.clear();
}
}
private String formatException(Exception e) {
String message = e.toString();
String str = Arrays.stream(e.getStackTrace()).map(Objects::toString).collect(Collectors.joining("\n"));
return message + "\n" + str;
}
private boolean checkOutput() {
String outputDirectory = docConfig.getOutputDirectory();
File file = new File(outputDirectory);
try {
if (!file.exists() || !file.isDirectory()) {
log.error("错误: " + outputDirectory + " 不是有效的目录");
return false;
}
String fullPath = outputDirectory + "/" + docConfig.getOutputFileName();
File outputFile = new File(fullPath);
if (outputFile.exists()) {
log.warn("检测到输出文件已存在,删除!");
boolean isOk = outputFile.delete();
if (!isOk) {
log.error("错误: " + fullPath + " 无法删除");
return false;
}
}
return true;
} catch (Exception e) {
log.error("检测到错误: " + formatException(e));
return false;
}
}
}
}
| [
"wuqi@terminus.io"
] | wuqi@terminus.io |
b3ec9e49750d325ef44b0ead8d4685ef7abfd0e1 | 9429a4d71db9de84a4aef8f16575b266c8d862a0 | /android/bridge/src/main/java/ipfs/gomobile/android/bledriver/Peer.java | 05815d19e0bf6bc348deff77e1ecf463289170be | [
"Apache-2.0",
"MIT"
] | permissive | n0izn0iz/gomobile-ipfs | d13f3c7f4f845357c07ee0950a804d105e917c36 | 3eb1873a521fdb756d3e35c617f119b2067b504d | refs/heads/master | 2022-02-06T07:15:38.244264 | 2022-01-08T05:41:55 | 2022-01-08T05:41:55 | 237,205,257 | 0 | 0 | NOASSERTION | 2022-01-08T05:34:31 | 2020-01-30T12:09:02 | Java | UTF-8 | Java | false | false | 2,031 | java | package ipfs.gomobile.android.bledriver;
import java.util.ArrayList;
public class Peer {
private static final String TAG = "bty.ble.Peer";
private final Logger mLogger;
private static final long TIMEOUT = 30000;
private final String mPeerID;
private final ArrayList<PeerDevice> mClientDevices = new ArrayList<>();
private final ArrayList<PeerDevice> mServerDevices = new ArrayList<>();
private Runnable mTimeoutRunnable;
public Peer(Logger logger, String peerID) {
mLogger = logger;
mPeerID = peerID;
}
public synchronized String getPeerID() {
return mPeerID;
}
public synchronized void addClientDevice(PeerDevice peerDevice) {
mClientDevices.add(peerDevice);
}
public synchronized void addServerDevice(PeerDevice peerDevice) {
mServerDevices.add(peerDevice);
}
public synchronized void removeDevices() {
mLogger.d(TAG, String.format("removeDevices called: pid=%s", mLogger.sensitiveObject(mPeerID)));
mClientDevices.clear();
mServerDevices.clear();
}
public synchronized PeerDevice getPeerClientDevice() {
if (mClientDevices.size() > 0) {
return mClientDevices.get(0);
}
return null;
}
public synchronized PeerDevice getPeerServerDevice() {
if (mServerDevices.size() > 0) {
return mServerDevices.get(0);
}
return null;
}
public synchronized PeerDevice getDevice() {
if (mClientDevices.size() > 0) {
return mClientDevices.get(0);
} else if (mServerDevices.size() > 0) {
return mServerDevices.get(0);
}
return null;
}
public synchronized boolean isClientReady() {
return mClientDevices.size() > 0;
}
public synchronized boolean isServerReady() {
return mServerDevices.size() > 0;
}
public synchronized boolean isHandshakeSuccessful() {
return isClientReady() || isServerReady();
}
}
| [
"d4ryl00@gmail.com"
] | d4ryl00@gmail.com |
42af2ef952f39646833fd324f49073d2202e53f2 | de4260130c334615d8ab3f27d884860e80e459d8 | /android/app/src/main/java/com/activitytracker/MainApplication.java | 13d732eaa1380465cac437010158076d5e84f5c1 | [] | no_license | Shuniy/activity-tracker | 9b813cef776603dca73cb3a3c955efbc17b2104d | d29e92f26cda4499840b719a8cfa31a51c84a454 | refs/heads/master | 2023-08-01T04:39:54.074970 | 2021-09-23T11:22:36 | 2021-09-23T11:22:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,884 | java | package com.activitytracker;
import android.app.Application;
import android.content.Context;
import android.net.Uri;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.activitytracker.generated.BasePackageList;
import org.unimodules.adapters.react.ReactAdapterPackage;
import org.unimodules.adapters.react.ModuleRegistryAdapter;
import org.unimodules.adapters.react.ReactModuleRegistryProvider;
import org.unimodules.core.interfaces.Package;
import org.unimodules.core.interfaces.SingletonModule;
import expo.modules.updates.UpdatesController;
import com.facebook.react.bridge.JSIModulePackage;
import com.swmansion.reanimated.ReanimatedJSIModulePackage;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Nullable;
public class MainApplication extends Application implements ReactApplication {
private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(
new BasePackageList().getPackageList()
);
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new ModuleRegistryAdapter(mModuleRegistryProvider));
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
@Override
protected JSIModulePackage getJSIModulePackage() {
return new ReanimatedJSIModulePackage();
}
@Override
protected @Nullable String getJSBundleFile() {
if (BuildConfig.DEBUG) {
return super.getJSBundleFile();
} else {
return UpdatesController.getInstance().getLaunchAssetFile();
}
}
@Override
protected @Nullable String getBundleAssetName() {
if (BuildConfig.DEBUG) {
return super.getBundleAssetName();
} else {
return UpdatesController.getInstance().getBundleAssetName();
}
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
if (!BuildConfig.DEBUG) {
UpdatesController.initialize(this);
}
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.activitytracker.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
| [
"shubhamkumar1239@outlook.com"
] | shubhamkumar1239@outlook.com |
9b65061f42960d1f62f5b2e20a98ebc56a9651a6 | 306424deb791c36c6223fbb55d5d7ea7e6b76c0e | /game/src/main/java/game/control/package-info.java | 729ce8d0ef2213998c861b45dadd8bffef36286e | [
"Apache-2.0"
] | permissive | juliusHuelsmann/strategy | fd5d0b9c901cc175436917995766686a085c963b | af2c61a12c09769a0b74c2bff3a5b78d7ca46116 | refs/heads/master | 2021-01-18T12:36:58.179556 | 2015-06-13T14:58:33 | 2015-06-13T14:58:33 | 36,997,899 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 60 | java | /**
*
*/
/**
* @author juli
*
*/
package game.control; | [
"jhuelsmann@techfak.uni-bielefeld.de"
] | jhuelsmann@techfak.uni-bielefeld.de |
152c3587d3359ec06e71819f7539083914468787 | 94102d45b939c5b37f3b35a5a1b28d62440cf9de | /shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/context/OptimizeContext.java | 7dc346e31068afaa5b61c8fbd85c6342d469ee05 | [
"Apache-2.0"
] | permissive | shook2012/shardingsphere | 6e46b9d24cf6da0a138fc2c956678fcca1c4d6ad | 5d70df3e48ee4cf50edbc9bf7f9e6e828381bd00 | refs/heads/master | 2023-05-07T06:58:35.935087 | 2021-05-20T09:44:51 | 2021-05-20T09:44:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,505 | java | /*
* 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.shardingsphere.infra.optimize.context;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.calcite.schema.Schema;
import org.apache.calcite.sql.parser.SqlParser;
import org.apache.calcite.sql.validate.SqlValidator;
import org.apache.calcite.sql2rel.SqlToRelConverter;
import java.util.Properties;
/**
* Optimize context.
*/
@RequiredArgsConstructor
@Getter
public final class OptimizeContext {
private final Properties connectionProperties;
private final Schema logicSchema;
private final SqlParser.Config parserConfig;
private final SqlValidator validator;
private final SqlToRelConverter relConverter;
}
| [
"noreply@github.com"
] | shook2012.noreply@github.com |
e0219db0025ed849d7c89679b746b56242f3e776 | bd802842b64f72a5d10d8b7e843285e71897f940 | /src/Java/LessNumber.java | 7550db8084b7767c752109ec9b6956b2363e4404 | [] | no_license | KeshavSingh520/JavaLearning | 7af6f9804e701bbf18c6d7a872311465d2436153 | cf0df73d3031c033ad3cf7e06b910ba3479b945c | refs/heads/master | 2020-03-22T01:56:08.678856 | 2018-07-01T17:06:46 | 2018-07-01T17:06:46 | 139,339,220 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 651 | java | package Java;
import java.util.Scanner;
public class LessNumber {
public static void main(String[] args) {
System.out.println(getLLessThanN(126, 62));
}
static int getLLessThanN(int number, int digit)
{
//Converting digit to char
char c = Integer.toString(digit).charAt(0);
//Decrementing number & checking whether it contains digit
for (int i = number; i > 0; --i)
{
if(Integer.toString(i).indexOf(c) == -1)
{
//If 'i' doesn't contain 'c'
return i;
}
}
return -1;
}
}
| [
"you@example.com"
] | you@example.com |
961a79fa5570860ecbcddabe73eb4a99655ea2cd | 07c50852997f39b7ad3afab5a680672ec94f2620 | /summer-core/src/main/java/com/coco/whale/core/utils/ValidateCodeUtil.java | e9e8df259958888651bdbb59c1d407d368da5353 | [] | no_license | whaleBoot/Summer-Boot | 4046e115d12c175587ccc91cfcf576bfd0874683 | 5dc205aa1f235fdd3b32973d808bbdd02465e02a | refs/heads/master | 2020-04-22T03:12:26.831695 | 2019-02-20T09:40:15 | 2019-02-20T09:40:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,112 | java | package com.coco.whale.core.utils;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Date;
import java.util.Random;
/**
* @ClassName ValidateCodeUtil
* @Description 图片验证码生成器
* @Author like
* @Data 2019/2/20 14:43
* @Version 1.0
**/
public class ValidateCodeUtil {
// 图片的宽度。
private int width = 80;
// 图片的高度。
private int height = 30;
// 验证码字符个数
private int codeCount = 4;
// 验证码干扰线数
private int lineCount = 80;
// 验证码
private String code = null;
// 验证码图片Buffer
private BufferedImage buffImg = null;
// 验证码范围,去掉0(数字)和O(拼音)容易混淆的(小写的1和L也可以去掉,大写不用了)
private char[] codeSequence = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
/**
* 默认构造函数,设置默认参数
*/
public ValidateCodeUtil() {
this.createCode();
}
/**
* @param width 图片宽
* @param height 图片高
*/
public ValidateCodeUtil(int width, int height) {
this.width = width;
this.height = height;
this.createCode();
}
/**
* @param width 图片宽
* @param height 图片高
* @param codeCount 字符个数
* @param lineCount 干扰线条数
*/
public ValidateCodeUtil(int width, int height, int codeCount, int lineCount) {
this.width = width;
this.height = height;
this.codeCount = codeCount;
this.lineCount = lineCount;
this.createCode();
}
public void createCode() {
int x = 0, fontHeight = 0, codeY = 0;
int red = 0, green = 0, blue = 0;
x = width / (codeCount + 2);//每个字符的宽度(左右各空出一个字符)
fontHeight = height - 2;//字体的高度
codeY = height - 4;
// 图像buffer
buffImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics2D g = buffImg.createGraphics();
// 生成随机数
Random random = new Random();
// 将图像填充为白色
g.setColor(Color.WHITE);
g.fillRect(0, 0, width, height);
// 创建字体,可以修改为其它的
Font font = new Font("Fixedsys", Font.PLAIN, fontHeight);
// Font font = new Font("Times New Roman", Font.ROMAN_BASELINE, fontHeight);
g.setFont(font);
for (int i = 0; i < lineCount; i++) {
// 设置随机开始和结束坐标
int xs = random.nextInt(width);//x坐标开始
int ys = random.nextInt(height);//y坐标开始
int xe = xs + random.nextInt(width / 8);//x坐标结束
int ye = ys + random.nextInt(height / 8);//y坐标结束
// 产生随机的颜色值,让输出的每个干扰线的颜色值都将不同。
red = random.nextInt(255);
green = random.nextInt(255);
blue = random.nextInt(255);
g.setColor(new Color(red, green, blue));
g.drawLine(xs, ys, xe, ye);
}
// randomCode记录随机产生的验证码
StringBuffer randomCode = new StringBuffer();
// 随机产生codeCount个字符的验证码。
for (int i = 0; i < codeCount; i++) {
String strRand = String.valueOf(codeSequence[random.nextInt(codeSequence.length)]);
// 产生随机的颜色值,让输出的每个字符的颜色值都将不同。
red = random.nextInt(255);
green = random.nextInt(255);
blue = random.nextInt(255);
g.setColor(new Color(red, green, blue));
g.drawString(strRand, (i + 1) * x, codeY);
// 将产生的四个随机数组合在一起。
randomCode.append(strRand);
}
// 将四位数字的验证码保存到Session中。
code = randomCode.toString();
}
public void write(String path) throws IOException {
OutputStream sos = new FileOutputStream(path);
this.write(sos);
}
public void write(OutputStream sos) throws IOException {
ImageIO.write(buffImg, "png", sos);
sos.close();
}
public BufferedImage getBuffImg() {
return buffImg;
}
public String getCode() {
return code;
}
/**
* 测试函数,默认生成到d盘
*
* @param args
*/
public static void main(String[] args) {
ValidateCodeUtil vCode = new ValidateCodeUtil(160, 40, 5, 150);
try {
String path = "D:/" + System.currentTimeMillis() + ".png";
System.out.println(vCode.getCode() + " >" + path);
vCode.write(path);
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"like3168@pansoft.com"
] | like3168@pansoft.com |
25fdcea8efb757166923e6d1747637a1f6520ffa | c8da50e1a99c6b4bdb4460b00b9004a2db189aa7 | /src/main/java/com/buddhaworks/mvcweb/DTO/Image.java | fd123b003333ffa8ac3aededccbe9b97589227bb | [] | no_license | buddhaprog/BuddhaWorks | 4e914528ac30bfa3b7e5c0788b2121a7cd911572 | 9534558a7ef0d891a5c9f3a77353cfa7005241c7 | refs/heads/master | 2016-09-06T04:17:25.200874 | 2016-01-18T14:16:16 | 2016-01-18T14:16:16 | 39,080,958 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,099 | java | package com.buddhaworks.mvcweb.DTO;
import java.util.Objects;
public class Image {
private int imageId;
private String image;
public int getImageId() {
return imageId;
}
public void setImageId(int imageId) {
this.imageId = imageId;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
@Override
public int hashCode() {
int hash = 3;
hash = 23 * hash + this.imageId;
hash = 23 * hash + Objects.hashCode(this.image);
return hash;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Image other = (Image) obj;
if (this.imageId != other.imageId) {
return false;
}
if (!Objects.equals(this.image, other.image)) {
return false;
}
return true;
}
}
| [
"rhelvinator@yahoo.com"
] | rhelvinator@yahoo.com |
14df5ac9fa10bf05a60395b152966382dc092269 | 09d447afca9be99144edfc1c0d9dfdf441197a44 | /src/example11.java | 21614c898c10e27aa210a6fa117b2b21e7566804 | [] | no_license | yoyou/JavaPratice | 07f660eef8a31911a879031e11b316b87dc39c78 | 159cec835b39d6f770447ee0ba6db74936b6cad4 | refs/heads/master | 2020-06-10T17:42:14.368198 | 2019-06-28T10:06:43 | 2019-06-28T10:06:43 | 193,695,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 812 | java | import java.io.FileInputStream;
import java.io.IOException;
import java.util.Scanner;
public class example11 {
public static void main (String[] args) {
FileInputStream fis = null;
try {
fis = new FileInputStream("src/example11.java");
System.setIn(fis);
Scanner sca = new Scanner(System.in);
sca.useDelimiter("\n");
while (sca.hasNext()){
System.out.println("键盘输入的内容是:" + sca.next());
}
}catch (IOException ioe) {
ioe.printStackTrace();
}finally {
try {
if (fis != null) {
fis.close();
}
}catch (Exception e) {
e.printStackTrace();
}
}
}
}
| [
"example@yinhe.com"
] | example@yinhe.com |
7361f9efb06825db77ef7ce470824bf803fc80c8 | bd5c06c41ad0c75dc01a536a989af9008a9cf2d7 | /src/main/java/com/rhotiz/challenge/challenge/service/GetServiceImpl.java | 1c1a3ea871c8c415740650dadce4864af3707d17 | [] | no_license | AhmadHoghooghi/sharif-challenge | c3a3d5f7240fa4602358f2e7930771a8fb534b4d | feda675ebd6bb185c31857c627f3afff7071dc66 | refs/heads/master | 2020-04-09T22:36:01.348371 | 2018-12-06T13:40:44 | 2018-12-06T13:40:44 | 160,632,917 | 1 | 2 | null | 2018-12-06T13:40:45 | 2018-12-06T06:59:08 | Java | UTF-8 | Java | false | false | 160 | java | package com.rhotiz.challenge.challenge.service;
import org.springframework.stereotype.Service;
@Service
public class GetServiceImpl implements GetService {
}
| [
"ali.dabagh@gmail.com"
] | ali.dabagh@gmail.com |
33df37e67a4474b8eb1f44c656f49df22050918b | 768f506ef2a4bd9099dda9e7e4a51679dea7efa5 | /stc5.students/src/main/java/dao/JournalDAOImpl.java | 495f190aa30cefbd2e9367ecda0fb317f5840cfd | [] | no_license | wohan/PracticeAdapterObserver-master | a5a211dace48931d1598a3dd8a9183f4238a6cf2 | a68c963792e79dbd029c72f15c55fbddf024d8cc | refs/heads/master | 2021-01-20T12:23:13.548655 | 2017-05-05T09:10:44 | 2017-05-05T09:10:44 | 90,357,992 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 314 | java | package dao;
import models.Journal;
import java.util.List;
/**
* Created by PoGo on 20.04.2017.
*/
public class JournalDAOImpl implements JournalDAO {
@Override
public List<Journal> getAll() {
return null;
}
@Override
public Journal get(Integer id) {
return null;
}
}
| [
"you@example.com"
] | you@example.com |
56915b3d02d85eda92ad9a706811bd060c09181d | d564e5c5b0dd77083fe740b1a23d14ce98c51e7c | /src/main/java/com/zking/ssm/mapper/info/TLogininfoMapper.java | c33e5db4b0bfe409ba5b9ce0810d7859eba8dd11 | [] | no_license | yani-lab/ssm | 739eb9d82f2d41302e83a4da39f1680f0ffcaf87 | 085dec58fec1fe46c4c62e57d6dd80cef14307e4 | refs/heads/master | 2022-12-26T03:43:04.395174 | 2019-12-25T01:41:06 | 2019-12-25T01:41:06 | 227,072,161 | 0 | 0 | null | 2022-12-16T04:25:48 | 2019-12-10T08:57:47 | Java | UTF-8 | Java | false | false | 141 | java | package com.zking.ssm.mapper.info;
/**
* @author luo
* @company zking
* @creat 2019-12-1216:22
*/
public interface TLogininfoMapper {
}
| [
"2536496956@qq.com"
] | 2536496956@qq.com |
b136504bec766766533f918fc1019f844f2acd23 | 5d76b555a3614ab0f156bcad357e45c94d121e2d | /src-v3/com/google/android/gms/wallet/C0558k.java | 233dfce89a9eab45fe41598d8c1a5903e983df86 | [] | no_license | BinSlashBash/xcrumby | 8e09282387e2e82d12957d22fa1bb0322f6e6227 | 5b8b1cc8537ae1cfb59448d37b6efca01dded347 | refs/heads/master | 2016-09-01T05:58:46.144411 | 2016-02-15T13:23:25 | 2016-02-15T13:23:25 | 51,755,603 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,598 | java | package com.google.android.gms.wallet;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.fasterxml.jackson.databind.deser.std.FromStringDeserializer.Std;
import com.google.android.gms.common.internal.safeparcel.C0261a;
import com.google.android.gms.common.internal.safeparcel.C0261a.C0260a;
import com.google.android.gms.common.internal.safeparcel.C0262b;
import com.google.android.gms.identity.intents.model.UserAddress;
/* renamed from: com.google.android.gms.wallet.k */
public class C0558k implements Creator<MaskedWallet> {
static void m1518a(MaskedWallet maskedWallet, Parcel parcel, int i) {
int p = C0262b.m236p(parcel);
C0262b.m234c(parcel, 1, maskedWallet.getVersionCode());
C0262b.m222a(parcel, 2, maskedWallet.abh, false);
C0262b.m222a(parcel, 3, maskedWallet.abi, false);
C0262b.m229a(parcel, 4, maskedWallet.abn, false);
C0262b.m222a(parcel, 5, maskedWallet.abk, false);
C0262b.m219a(parcel, 6, maskedWallet.abl, i, false);
C0262b.m219a(parcel, 7, maskedWallet.abm, i, false);
C0262b.m228a(parcel, 8, maskedWallet.abT, i, false);
C0262b.m228a(parcel, 9, maskedWallet.abU, i, false);
C0262b.m219a(parcel, 10, maskedWallet.abo, i, false);
C0262b.m219a(parcel, 11, maskedWallet.abp, i, false);
C0262b.m228a(parcel, 12, maskedWallet.abq, i, false);
C0262b.m211F(parcel, p);
}
public MaskedWallet bg(Parcel parcel) {
int o = C0261a.m196o(parcel);
int i = 0;
String str = null;
String str2 = null;
String[] strArr = null;
String str3 = null;
Address address = null;
Address address2 = null;
LoyaltyWalletObject[] loyaltyWalletObjectArr = null;
OfferWalletObject[] offerWalletObjectArr = null;
UserAddress userAddress = null;
UserAddress userAddress2 = null;
InstrumentInfo[] instrumentInfoArr = null;
while (parcel.dataPosition() < o) {
int n = C0261a.m194n(parcel);
switch (C0261a.m174R(n)) {
case Std.STD_FILE /*1*/:
i = C0261a.m187g(parcel, n);
break;
case Std.STD_URL /*2*/:
str = C0261a.m195n(parcel, n);
break;
case Std.STD_URI /*3*/:
str2 = C0261a.m195n(parcel, n);
break;
case Std.STD_CLASS /*4*/:
strArr = C0261a.m208z(parcel, n);
break;
case Std.STD_JAVA_TYPE /*5*/:
str3 = C0261a.m195n(parcel, n);
break;
case Std.STD_CURRENCY /*6*/:
address = (Address) C0261a.m176a(parcel, n, Address.CREATOR);
break;
case Std.STD_PATTERN /*7*/:
address2 = (Address) C0261a.m176a(parcel, n, Address.CREATOR);
break;
case Std.STD_LOCALE /*8*/:
loyaltyWalletObjectArr = (LoyaltyWalletObject[]) C0261a.m181b(parcel, n, LoyaltyWalletObject.CREATOR);
break;
case Std.STD_CHARSET /*9*/:
offerWalletObjectArr = (OfferWalletObject[]) C0261a.m181b(parcel, n, OfferWalletObject.CREATOR);
break;
case Std.STD_TIME_ZONE /*10*/:
userAddress = (UserAddress) C0261a.m176a(parcel, n, UserAddress.CREATOR);
break;
case Std.STD_INET_ADDRESS /*11*/:
userAddress2 = (UserAddress) C0261a.m176a(parcel, n, UserAddress.CREATOR);
break;
case Std.STD_INET_SOCKET_ADDRESS /*12*/:
instrumentInfoArr = (InstrumentInfo[]) C0261a.m181b(parcel, n, InstrumentInfo.CREATOR);
break;
default:
C0261a.m180b(parcel, n);
break;
}
}
if (parcel.dataPosition() == o) {
return new MaskedWallet(i, str, str2, strArr, str3, address, address2, loyaltyWalletObjectArr, offerWalletObjectArr, userAddress, userAddress2, instrumentInfoArr);
}
throw new C0260a("Overread allowed size end=" + o, parcel);
}
public /* synthetic */ Object createFromParcel(Parcel x0) {
return bg(x0);
}
public MaskedWallet[] cs(int i) {
return new MaskedWallet[i];
}
public /* synthetic */ Object[] newArray(int x0) {
return cs(x0);
}
}
| [
"binslashbash@otaking.top"
] | binslashbash@otaking.top |
b5848bd71a287c621e384c3eb5f7d28a909ccef9 | 4dd5ec1da43c476b166846783fb17ef02fcb02e4 | /TrainingCollege/src/main/java/training_college/entity/PostModifySchedulePK.java | d574433422f5c239ace250589b3f7fa041cdd01c | [] | no_license | njushishuo/Training_College | 16bb0bf2717c07d714eb67e5da1382220718a31c | b0e31a232cddf69ef91c1fcd5904e0630f446486 | refs/heads/master | 2021-01-21T10:19:47.039993 | 2017-03-20T07:31:00 | 2017-03-20T07:31:00 | 83,409,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,166 | java | package training_college.entity;
import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
/**
* Created by ss14 on 2017/3/11.
*/
public class PostModifySchedulePK implements Serializable {
private int projectId;
private int courseId;
@Column(name = "project_id")
@Id
public int getProjectId() {
return projectId;
}
public void setProjectId(int projectId) {
this.projectId = projectId;
}
@Column(name = "course_id")
@Id
public int getCourseId() {
return courseId;
}
public void setCourseId(int courseId) {
this.courseId = courseId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PostModifySchedulePK that = (PostModifySchedulePK) o;
if (projectId != that.projectId) return false;
if (courseId != that.courseId) return false;
return true;
}
@Override
public int hashCode() {
int result = projectId;
result = 31 * result + courseId;
return result;
}
}
| [
"675342907@qq.com"
] | 675342907@qq.com |
af90593d8122624709dccd29fafeb347f66f014c | 4bb83687710716d91b5da55054c04f430474ee52 | /dsrc/sku.0/sys.server/compiled/game/script/npc/vendor/object_for_sale.java | 7661eb5f23f5f9975a09624a2eb2a0a0126c467e | [] | no_license | geralex/SWG-NGE | 0846566a44f4460c32d38078e0a1eb115a9b08b0 | fa8ae0017f996e400fccc5ba3763e5bb1c8cdd1c | refs/heads/master | 2020-04-06T11:18:36.110302 | 2018-03-19T15:42:32 | 2018-03-19T15:42:32 | 157,411,938 | 1 | 0 | null | 2018-11-13T16:35:01 | 2018-11-13T16:35:01 | null | UTF-8 | Java | false | false | 17,426 | java | package script.npc.vendor;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.factions;
import script.library.money;
import script.library.prose;
import script.library.static_item;
import script.library.township;
import script.library.trial;
import script.library.utils;
public class object_for_sale extends script.base_script
{
public object_for_sale()
{
}
public static final String VENDOR_TOKEN_TYPE = "item.token.type";
public static final string_id SID_INV_FULL = new string_id("spam", "npc_vendor_player_inv_full");
public int OnAttach(obj_id self) throws InterruptedException
{
setObjVar(self, township.OBJECT_FOR_SALE_ON_VENDOR, true);
return SCRIPT_CONTINUE;
}
public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException
{
if (item == menu_info_types.ITEM_PUBLIC_CONTAINER_USE1)
{
if (hasObjVar(self, "faction_recruiter.faction"))
{
String itemFactionName = getStringObjVar(self, "faction_recruiter.faction");
int playerFaction = pvpGetAlignedFaction(player);
String playerFactionName = factions.getFactionNameByHashCode(playerFaction);
if (!itemFactionName.equals(playerFactionName))
{
sendSystemMessage(player, new string_id("spam", "wrong_faction"));
return SCRIPT_OVERRIDE;
}
}
if (!confirmInventory(self, player))
{
return SCRIPT_OVERRIDE;
}
if (confirmFunds(self, player))
{
processItemPurchase(self, player);
}
else
{
sendSystemMessage(player, new string_id("spam", "buildabuff_nsf_buffee"));
}
}
return SCRIPT_CONTINUE;
}
public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException
{
if (names == null || attribs == null || names.length != attribs.length)
{
return SCRIPT_CONTINUE;
}
final int firstFreeIndex = getFirstFreeIndex(names);
if (firstFreeIndex >= 0 && firstFreeIndex < names.length)
{
names[firstFreeIndex] = utils.packStringId(new string_id("set_bonus", "vendor_cost"));
attribs[firstFreeIndex] = createPureConcatenatedJoy(self);
}
return SCRIPT_CONTINUE;
}
public String createPureConcatenatedJoy(obj_id self) throws InterruptedException
{
String pureConcatenatedJoy = getString(new string_id("set_bonus", "vendor_sale_object_justify_line"));
int creditCost = 0;
int tokenArrayLength = 0;
creditCost = getIntObjVar(self, "item.object_for_sale.cash_cost");
int[] tokenCost = getIntArrayObjVar(self, "item.object_for_sale.token_cost");
if (!hasObjVar(self, VENDOR_TOKEN_TYPE))
{
if (tokenCost.length > trial.HEROIC_TOKENS.length)
{
tokenArrayLength = trial.HEROIC_TOKENS.length;
}
else if (tokenCost.length > 0)
{
tokenArrayLength = tokenCost.length;
}
for (int i = 0; i < tokenArrayLength; i++)
{
if (tokenCost[i] > 0)
{
pureConcatenatedJoy += "[" + tokenCost[i] + "] " + getString(new string_id("static_item_n", trial.HEROIC_TOKENS[i])) + "\n";
}
}
}
else
{
String tokenList = getStringObjVar(self, VENDOR_TOKEN_TYPE);
String[] differentTokens = split(tokenList, ',');
if (tokenCost.length > differentTokens.length)
{
tokenArrayLength = differentTokens.length;
}
else if (tokenCost.length > 0)
{
tokenArrayLength = tokenCost.length;
}
for (int i = 0; i < tokenArrayLength; i++)
{
if (tokenCost[i] > 0)
{
pureConcatenatedJoy += "[" + tokenCost[i] + "] " + getString(new string_id("static_item_n", differentTokens[i])) + "\n";
}
}
}
if (creditCost > 0)
{
pureConcatenatedJoy += creditCost + getString(new string_id("set_bonus", "vendor_credits"));
}
return pureConcatenatedJoy;
}
public boolean confirmInventory(obj_id self, obj_id player) throws InterruptedException
{
obj_id pInv = utils.getInventoryContainer(player);
if (!isValidId(pInv) || !exists(pInv))
{
return false;
}
if (getVolumeFree(pInv) <= 0)
{
sendSystemMessage(player, SID_INV_FULL);
return false;
}
return true;
}
public boolean confirmFunds(obj_id self, obj_id player) throws InterruptedException
{
boolean canPay = false;
boolean hasTheCredits = false;
boolean hasTheTokens = false;
boolean foundTokenHolderBox = false;
obj_id[] inventoryContents = getInventoryAndEquipment(player);
int creditCost = getIntObjVar(self, "item.object_for_sale.cash_cost");
int[] tokenCostInThisFunction = getIntArrayObjVar(self, "item.object_for_sale.token_cost");
if (creditCost < 1)
{
hasTheCredits = true;
}
if (creditCost >= 1)
{
if (money.hasFunds(player, money.MT_TOTAL, creditCost))
{
hasTheCredits = true;
}
}
int owedTokenCount = 0;
boolean owesTokens = false;
for (int o = 0; o < tokenCostInThisFunction.length; o++)
{
owedTokenCount += tokenCostInThisFunction[o];
}
if (owedTokenCount > 0)
{
owesTokens = true;
}
if (owesTokens)
{
for (int i = 0; i < inventoryContents.length; i++)
{
String itemName = getStaticItemName(inventoryContents[i]);
if (itemName != null && !itemName.equals(""))
{
if (hasObjVar(self, VENDOR_TOKEN_TYPE))
{
String tokenList = getStringObjVar(self, VENDOR_TOKEN_TYPE);
String[] differentTokens = split(tokenList, ',');
for (int j = 0; j < differentTokens.length; j++)
{
if (itemName.equals(differentTokens[j]) && tokenCostInThisFunction[j] > 0)
{
if (getCount(inventoryContents[i]) > 1)
{
for (int m = 0; m < getCount(inventoryContents[i]); m++)
{
if (tokenCostInThisFunction[j] > 0)
{
tokenCostInThisFunction[j]--;
}
}
}
else
{
tokenCostInThisFunction[j]--;
}
}
}
}
else
{
for (int j = 0; j < trial.HEROIC_TOKENS.length; j++)
{
if (itemName.equals(trial.HEROIC_TOKENS[j]) && tokenCostInThisFunction[j] > 0)
{
if (getCount(inventoryContents[i]) > 1)
{
for (int m = 0; m < getCount(inventoryContents[i]); m++)
{
if (tokenCostInThisFunction[j] > 0)
{
tokenCostInThisFunction[j]--;
}
}
}
else
{
tokenCostInThisFunction[j]--;
}
}
}
if (!foundTokenHolderBox && itemName.equals("item_heroic_token_box_01_01"))
{
foundTokenHolderBox = true;
if (hasObjVar(inventoryContents[i], "item.set.tokens_held"))
{
int[] virtualTokens = getIntArrayObjVar(inventoryContents[i], "item.set.tokens_held");
for (int k = 0; k < trial.HEROIC_TOKENS.length; k++)
{
if (tokenCostInThisFunction[k] > 0 && virtualTokens[k] > 0)
{
int paymentIterations = tokenCostInThisFunction[k];
for (int l = 0; l < paymentIterations; l++)
{
if (virtualTokens[k] > 0)
{
virtualTokens[k]--;
tokenCostInThisFunction[k]--;
}
}
}
}
}
}
}
}
}
}
int outstandingTokensOwed = 0;
for (int n = 0; n < tokenCostInThisFunction.length; n++)
{
outstandingTokensOwed += tokenCostInThisFunction[n];
}
if (outstandingTokensOwed == 0)
{
hasTheTokens = true;
}
return hasTheCredits && hasTheTokens;
}
public void processItemPurchase(obj_id self, obj_id player) throws InterruptedException
{
obj_id inventory = utils.getInventoryContainer(player);
obj_id[] inventoryContents = getInventoryAndEquipment(player);
int creditCost = getIntObjVar(self, "item.object_for_sale.cash_cost");
int[] tokenCostForReals = getIntArrayObjVar(self, "item.object_for_sale.token_cost");
obj_id purchasedItem = obj_id.NULL_ID;
String myName = "";
if (static_item.isStaticItem(self))
{
myName = static_item.getStaticItemName(self);
purchasedItem = static_item.createNewItemFunction(myName, inventory);
}
else
{
myName = getTemplateName(self);
purchasedItem = createObjectOverloaded(myName, inventory);
}
if (hasScript(purchasedItem, "npc.faction_recruiter.biolink_item"))
{
setBioLink(purchasedItem, player);
}
CustomerServiceLog("Heroic-Token: ", "player " + getFirstName(player) + "(" + player + ") purchased item " + myName + "(" + purchasedItem + ")");
if (!exists(purchasedItem))
{
sendSystemMessage(player, new string_id("set_bonus", "vendor_cant_purchase"));
return;
}
String readableName = getString(parseNameToStringId(getName(self), self));
prose_package pp = new prose_package();
pp = prose.setStringId(pp, new string_id("set_bonus", "vendor_item_purchased"));
pp = prose.setTT(pp, readableName);
sendSystemMessageProse(player, pp);
if (creditCost >= 1)
{
obj_id containedBy = getContainedBy(getContainedBy(getContainedBy(self)));
money.requestPayment(player, containedBy, creditCost, "no_handler", null, false);
}
boolean foundTokenHolderBox = false;
for (int i = 0; i < inventoryContents.length; i++)
{
String itemName = getStaticItemName(inventoryContents[i]);
if (itemName != null && !itemName.equals(""))
{
if (hasObjVar(self, VENDOR_TOKEN_TYPE))
{
String tokenList = getStringObjVar(self, VENDOR_TOKEN_TYPE);
String[] differentTokens = split(tokenList, ',');
for (int j = 0; j < differentTokens.length; j++)
{
if (itemName.equals(differentTokens[j]) && tokenCostForReals[j] > 0)
{
if (getCount(inventoryContents[i]) > 1)
{
int numInStack = getCount(inventoryContents[i]);
for (int m = 0; m < numInStack - 1; m++)
{
if (tokenCostForReals[j] > 0)
{
tokenCostForReals[j]--;
setCount(inventoryContents[i], getCount(inventoryContents[i]) - 1);
}
}
}
if (getCount(inventoryContents[i]) <= 1 && tokenCostForReals[j] > 0)
{
destroyObject(inventoryContents[i]);
tokenCostForReals[j]--;
}
}
}
}
else
{
for (int j = 0; j < trial.HEROIC_TOKENS.length; j++)
{
if (itemName.equals(trial.HEROIC_TOKENS[j]) && tokenCostForReals[j] > 0)
{
if (getCount(inventoryContents[i]) > 1)
{
int numInStack = getCount(inventoryContents[i]);
for (int m = 0; m < numInStack - 1; m++)
{
if (tokenCostForReals[j] > 0)
{
tokenCostForReals[j]--;
setCount(inventoryContents[i], getCount(inventoryContents[i]) - 1);
}
}
}
if (getCount(inventoryContents[i]) <= 1 && tokenCostForReals[j] > 0)
{
destroyObject(inventoryContents[i]);
tokenCostForReals[j]--;
}
}
}
if (!foundTokenHolderBox && itemName.equals("item_heroic_token_box_01_01"))
{
foundTokenHolderBox = true;
if (hasObjVar(inventoryContents[i], "item.set.tokens_held"))
{
int[] virtualTokens = getIntArrayObjVar(inventoryContents[i], "item.set.tokens_held");
for (int k = 0; k < trial.HEROIC_TOKENS.length; k++)
{
if (tokenCostForReals[k] > 0 && virtualTokens[k] > 0)
{
int paymentCounter = tokenCostForReals[k];
for (int l = 0; l < paymentCounter; l++)
{
if (virtualTokens[k] > 0)
{
virtualTokens[k]--;
tokenCostForReals[k]--;
}
}
}
}
setObjVar(inventoryContents[i], "item.set.tokens_held", virtualTokens);
}
}
}
}
}
return;
}
public string_id parseNameToStringId(String itemName, obj_id item) throws InterruptedException
{
String[] parsedString = split(itemName, ':');
string_id itemNameSID;
if (static_item.isStaticItem(item))
{
itemNameSID = static_item.getStaticItemStringIdName(item);
}
else if (parsedString.length > 1)
{
String stfFile = parsedString[0];
String reference = parsedString[1];
itemNameSID = new string_id(stfFile, reference);
}
else
{
String stfFile = parsedString[0];
itemNameSID = new string_id(stfFile, " ");
}
return itemNameSID;
}
}
| [
"tmoflash@gmail.com"
] | tmoflash@gmail.com |
1996b928e08ff519a62792e596dcb4398b7d0d06 | e3f6abd71dfd8ac683ced4aaf28820f9b9944e09 | /src/main/java/whatnot/MirrorTree.java | e3cb6aaf7874d4edbc6fe9b5f6980d2658bf523f | [] | no_license | dpoulomi/PractiseForInterview | bc602b87e8226df89ccc26549c885b3b74660e4a | 3f24a7be48c9125286f1ddedf5d34436de4f3b42 | refs/heads/master | 2021-09-03T12:39:58.422385 | 2018-01-09T05:39:22 | 2018-01-09T05:39:22 | 109,642,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,809 | java | package whatnot;
public class MirrorTree {
public class Node {
int data;
Node left = null;
Node right = null;
public Node(int value, Node left, Node right) {
data = value;
this.left = left;
this.right = right;
}
}
public static void main(String[] args) throws Exception {
MirrorTree mirrorTree = new MirrorTree();
Node tree = mirrorTree.createTree1();
mirrorTree.printList(tree);
System.out.println();
mirrorTree.createMirrorTree(tree);
mirrorTree.printList(tree);
}
private void createMirrorTree(Node tree) throws Exception {
if (tree == null) {
return;
}
if (tree.left == null && tree.right == null) {
return;
}
if (tree != null) {
if (tree.left != null && tree.right != null) {
Node temp = tree.left;
tree.left = tree.right;
tree.right = temp;
}
if (tree.left != null) {
createMirrorTree(tree.left);
}
if (tree.right != null) {
createMirrorTree(tree.right);
}
}
}
private Node createTree1() {
Node n7 = new Node(7, null, null);
Node n6 = new Node(6, null, null);
Node n5 = new Node(5, null, null);
Node n4 = new Node(4, null, null);
Node n3 = new Node(3, n6, n7);
Node n2 = new Node(2, n4, n5);
Node n1 = new Node(1, n2, n3);
return n1;
}
private void printList(Node tree) {
if (tree != null) {
printList(tree.left);
System.out.print(tree.data + "--->");
printList(tree.right);
}
}
}
| [
"neo@Subhojits-MacBook-Pro.local"
] | neo@Subhojits-MacBook-Pro.local |
2ec0389e72c2b6c5da544ebb8d69097a22bb5f8d | ad872706fe5f0a3509c56839f0084c3bb98f813c | /dreamer-back/dreamer-core/src/main/java/indi/tudan/dreamer/core/utils/Id/SnowflakeIdWorker.java | 0df5275509b336b6fbb2943f42864eab7c96c9c5 | [
"Apache-2.0"
] | permissive | tudan110/dreamer-framework | b784ab54241c8523ee0eb2c209b87554fae92fbc | d0ae0f1eb480759ba3678462b17204d3231e39f8 | refs/heads/master | 2022-12-13T03:07:43.448269 | 2020-12-16T03:29:28 | 2020-12-16T03:29:28 | 199,764,124 | 2 | 0 | Apache-2.0 | 2022-12-11T04:17:30 | 2019-07-31T02:38:30 | Java | UTF-8 | Java | false | false | 6,293 | java | package indi.tudan.dreamer.core.utils.Id;
/**
* Twitter_Snowflake<br>
* SnowFlake的结构如下(每部分用-分开):<br>
* 0 - 0000000000 0000000000 0000000000 0000000000 0 - 00000 - 00000 - 000000000000 <br>
* 1位标识,由于long基本类型在Java中是带符号的,最高位是符号位,正数是0,负数是1,所以id一般是正数,最高位是0<br>
* 41位时间截(毫秒级),注意,41位时间截不是存储当前时间的时间截,而是存储时间截的差值(当前时间截 - 开始时间截)
* 得到的值),这里的的开始时间截,一般是我们的id生成器开始使用的时间,由我们程序来指定的(如下下面程序IdWorker类的startTime属性)。41位的时间截,可以使用69年,年T = (1L << 41) / (1000L * 60 * 60 * 24 * 365) = 69<br>
* 10位的数据机器位,可以部署在1024个节点,包括5位datacenterId和5位workerId<br>
* 12位序列,毫秒内的计数,12位的计数顺序号支持每个节点每毫秒(同一机器,同一时间截)产生4096个ID序号<br>
* 加起来刚好64位,为一个Long型。<br>
* SnowFlake的优点是,整体上按照时间自增排序,并且整个分布式系统内不会产生ID碰撞(由数据中心ID和机器ID作区分),并且效率较高,经测试,SnowFlake每秒能够产生26万ID左右。
*/
public class SnowflakeIdWorker {
// ==============================Fields===========================================
/**
* 开始时间截 (2015-01-01)
*/
private final long twepoch = 1420041600000L;
/**
* 机器id所占的位数
*/
private final long workerIdBits = 5L;
/**
* 数据标识id所占的位数
*/
private final long datacenterIdBits = 5L;
/**
* 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数)
*/
private final long maxWorkerId = -1L ^ (-1L << workerIdBits);
/**
* 支持的最大数据标识id,结果是31
*/
private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);
/**
* 序列在id中占的位数
*/
private final long sequenceBits = 12L;
/**
* 机器ID向左移12位
*/
private final long workerIdShift = sequenceBits;
/**
* 数据标识id向左移17位(12+5)
*/
private final long datacenterIdShift = sequenceBits + workerIdBits;
/**
* 时间截向左移22位(5+5+12)
*/
private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;
/**
* 生成序列的掩码,这里为4095 (0b111111111111=0xfff=4095)
*/
private final long sequenceMask = -1L ^ (-1L << sequenceBits);
/**
* 工作机器ID(0~31)
*/
private long workerId;
/**
* 数据中心ID(0~31)
*/
private long datacenterId;
/**
* 毫秒内序列(0~4095)
*/
private long sequence = 0L;
/**
* 上次生成ID的时间截
*/
private long lastTimestamp = -1L;
//==============================Constructors=====================================
/**
* 构造函数
*
* @param workerId 工作ID (0~31)
* @param datacenterId 数据中心ID (0~31)
*/
public SnowflakeIdWorker(long workerId, long datacenterId) {
if (workerId > maxWorkerId || workerId < 0) {
throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId));
}
if (datacenterId > maxDatacenterId || datacenterId < 0) {
throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId));
}
this.workerId = workerId;
this.datacenterId = datacenterId;
}
// ==============================Methods==========================================
/**
* 获得下一个ID (该方法是线程安全的)
*
* @return SnowflakeId
*/
public synchronized long nextId() {
long timestamp = timeGen();
//如果当前时间小于上一次ID生成的时间戳,说明系统时钟回退过这个时候应当抛出异常
if (timestamp < lastTimestamp) {
throw new RuntimeException(
String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
}
//如果是同一时间生成的,则进行毫秒内序列
if (lastTimestamp == timestamp) {
sequence = (sequence + 1) & sequenceMask;
//毫秒内序列溢出
if (sequence == 0) {
//阻塞到下一个毫秒,获得新的时间戳
timestamp = tilNextMillis(lastTimestamp);
}
}
//时间戳改变,毫秒内序列重置
else {
sequence = 0L;
}
//上次生成ID的时间截
lastTimestamp = timestamp;
//移位并通过或运算拼到一起组成64位的ID
return ((timestamp - twepoch) << timestampLeftShift) //
| (datacenterId << datacenterIdShift) //
| (workerId << workerIdShift) //
| sequence;
}
/**
* 阻塞到下一个毫秒,直到获得新的时间戳
*
* @param lastTimestamp 上次生成ID的时间截
* @return 当前时间戳
*/
protected long tilNextMillis(long lastTimestamp) {
long timestamp = timeGen();
while (timestamp <= lastTimestamp) {
timestamp = timeGen();
}
return timestamp;
}
/**
* 返回以毫秒为单位的当前时间
*
* @return 当前时间(毫秒)
*/
protected long timeGen() {
return System.currentTimeMillis();
}
//==============================Test=============================================
/**
* 测试
*/
public static void main(String[] args) {
SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0);
for (int i = 0; i < 1000; i++) {
long id = idWorker.nextId();
System.out.println(Long.toBinaryString(id));
System.out.println(id);
}
}
} | [
"wtudan@126.com"
] | wtudan@126.com |
5167d676383f791e1e818de7897dfe185cff1530 | 4ddae7b8a16f1ae2876ad34f0ee894275a6bebc1 | /src/main/java/api/model/BankAccount.java | 41959646cdc37e0e47be7d04fe377385ac23515f | [] | no_license | ealparslan/broccoli-rest | e2cc2714951bb15659fa5b43f30693840c6bdebf | 61bcdbdd03e8430b0386635ee6627af4a1269138 | refs/heads/master | 2023-07-14T23:33:10.143565 | 2017-07-29T23:46:50 | 2017-07-29T23:46:50 | 403,684,191 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 734 | java | package api.model;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* Created by deniz on 6/29/17.
*/
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
@Entity
public class BankAccount implements Serializable {
static final long serialVersionUID = 2494623453227271L;
@Id
@GeneratedValue
int id;
@NotNull
String bank;
String routingNumber;
@NotNull
String accountNumber;
Date addedOn;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "dietician_id")
Dietician dietician;
}
| [
"e"
] | e |
98af31557e336bd472f0739e9e97f34520d33f0a | e3bb3136ff1c486ca4e837cd9460da83ce7012c7 | /app/src/androidTest/java/ru/lifecoders/multidictionary/ExampleInstrumentedTest.java | 0a529cd42d95a097f61abe8f659577ec6af1788d | [] | no_license | ilyas585/multidictionary2 | 445d63b9690a95ca23970c6f2e8c40f476267458 | 2b2ad7049a825cf50c59ea01095c51580229423e | refs/heads/master | 2021-08-24T10:47:04.267445 | 2017-12-09T09:13:58 | 2017-12-09T09:13:58 | 113,656,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 759 | java | package ru.lifecoders.multidictionary;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("ru.lifecoders.multidictionary", appContext.getPackageName());
}
}
| [
"azamat.atlaskirov@gmail.com"
] | azamat.atlaskirov@gmail.com |
9b71d8ec9ea54e8c449bc463def9fca675f089c5 | e9c93fc7f6b08fa15cc8e957b49a8a994b27eb1f | /src/main/java/one/oktw/infinity/mixin/Command_GameMode.java | f947d5209ea48b5c0f31ac04f853ba8596711f5e | [
"CC0-1.0"
] | permissive | WerXD-MCP/minecraft-infinity-tweak | fcad6b0a7a5e7e93dbaa63f71cf92588b061573d | 186919ee1e0385ed4a273912847378f725644a11 | refs/heads/master | 2023-03-17T09:56:40.684853 | 2020-04-03T06:05:57 | 2020-04-03T06:05:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,093 | java | package one.oktw.infinity.mixin;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.command.arguments.EntityArgumentType;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.GameModeCommand;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.world.GameMode;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import java.util.Collection;
import java.util.Collections;
@Mixin(GameModeCommand.class)
public abstract class Command_GameMode {
@Shadow
private static int execute(CommandContext<ServerCommandSource> context, Collection<ServerPlayerEntity> targets, GameMode gameMode) {
return 0;
}
/**
* @author jamess58899
* @reason Disable GameMode Permission Check
*/
@Overwrite
public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {
LiteralArgumentBuilder<ServerCommandSource> literalArgumentBuilder = CommandManager.literal("gamemode");
for (GameMode gameMode : GameMode.values()) {
if (gameMode != GameMode.NOT_SET) {
literalArgumentBuilder
.then(CommandManager.literal(gameMode.getName())
.executes((commandContext) -> execute(commandContext, Collections.singleton(commandContext.getSource().getPlayer()), gameMode))
.then(CommandManager.argument("target", EntityArgumentType.players())
.executes((commandContext) -> execute(commandContext, EntityArgumentType.getPlayers(commandContext, "target"), gameMode))
.requires(serverCommandSource -> serverCommandSource.hasPermissionLevel(2))));
}
}
dispatcher.register(literalArgumentBuilder);
}
}
| [
"james59988@gmail.com"
] | james59988@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.