hexsha
stringlengths
40
40
size
int64
8
1.04M
content
stringlengths
8
1.04M
avg_line_length
float64
2.24
100
max_line_length
int64
4
1k
alphanum_fraction
float64
0.25
0.97
3b0ca036a0fe92bd42bff42818f94ebf9b5e14a9
5,098
/* * Copyright (c) 2019. * * 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.itfsw.mybatis.generator.plugins; import com.itfsw.mybatis.generator.plugins.tools.DBHelper; import com.itfsw.mybatis.generator.plugins.tools.MyBatisGeneratorTool; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import org.mybatis.generator.api.GeneratedJavaFile; import org.mybatis.generator.api.MyBatisGenerator; import org.mybatis.generator.api.dom.java.CompilationUnit; import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; import org.mybatis.generator.api.dom.java.Interface; /** * --------------------------------------------------------------------------- * * --------------------------------------------------------------------------- * @author: hewei * @time:2019/7/9 14:46 * --------------------------------------------------------------------------- */ public class MapperAnnotationPluginTest { /** * 初始化 */ @BeforeClass public static void init() throws Exception { DBHelper.createDB("scripts/MapperAnnotationPlugin/init.sql"); } /** * 测试默认配置 */ @Test public void testDefault() throws Exception{ MyBatisGeneratorTool tool = MyBatisGeneratorTool.create("scripts/MapperAnnotationPlugin/mybatis-generator.xml"); MyBatisGenerator myBatisGenerator = tool.generate(); for (GeneratedJavaFile file : myBatisGenerator.getGeneratedJavaFiles()) { CompilationUnit compilationUnit = file.getCompilationUnit(); if (compilationUnit instanceof Interface && compilationUnit.getType().getShortName().endsWith("Mapper")) { Interface interfaze = (Interface) compilationUnit; Assert.assertEquals(interfaze.getAnnotations().size(), 1); Assert.assertEquals(interfaze.getAnnotations().get(0), "@Mapper"); Assert.assertTrue(interfaze.getImportedTypes().contains(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Mapper"))); } } } /** * 测试@Mapper false 并且自定义 @Repository * @throws Exception */ @Test public void testWithMapperFalseAndCustomRepository() throws Exception{ MyBatisGeneratorTool tool = MyBatisGeneratorTool.create("scripts/MapperAnnotationPlugin/mybatis-generator-with-mapper-false.xml"); MyBatisGenerator myBatisGenerator = tool.generate(); for (GeneratedJavaFile file : myBatisGenerator.getGeneratedJavaFiles()) { CompilationUnit compilationUnit = file.getCompilationUnit(); if (compilationUnit instanceof Interface && compilationUnit.getType().getShortName().endsWith("Mapper")) { Interface interfaze = (Interface) compilationUnit; Assert.assertEquals(interfaze.getAnnotations().size(), 2); Assert.assertEquals(interfaze.getAnnotations().get(0), "@DS(\"master\")"); Assert.assertEquals(interfaze.getAnnotations().get(1), "@Repository"); Assert.assertTrue(interfaze.getImportedTypes().contains(new FullyQualifiedJavaType("org.springframework.test.Repository"))); Assert.assertTrue(interfaze.getImportedTypes().contains(new FullyQualifiedJavaType("com.baomidou.dynamic.datasource.annotation.DS"))); } } } /** * 测试配置Repository * @throws Exception */ @Test public void testWithRepository() throws Exception{ MyBatisGeneratorTool tool = MyBatisGeneratorTool.create("scripts/MapperAnnotationPlugin/mybatis-generator-with-old-repository.xml"); MyBatisGenerator myBatisGenerator = tool.generate(); for (GeneratedJavaFile file : myBatisGenerator.getGeneratedJavaFiles()) { CompilationUnit compilationUnit = file.getCompilationUnit(); if (compilationUnit instanceof Interface && compilationUnit.getType().getShortName().endsWith("Mapper")) { Interface interfaze = (Interface) compilationUnit; Assert.assertEquals(interfaze.getAnnotations().size(), 2); Assert.assertEquals(interfaze.getAnnotations().get(0), "@Mapper"); Assert.assertEquals(interfaze.getAnnotations().get(1), "@Repository"); Assert.assertTrue(interfaze.getImportedTypes().contains(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Mapper"))); Assert.assertTrue(interfaze.getImportedTypes().contains(new FullyQualifiedJavaType("org.springframework.stereotype.Repository"))); } } } }
44.330435
150
0.666928
267680a63a372fc4d034d11315673d63fa7df851
4,979
package org.hl7.fhir.igtools.renderers; import org.hl7.fhir.r5.model.CanonicalResource; import org.hl7.fhir.r5.model.ContactDetail; import org.hl7.fhir.r5.model.ContactPoint; import org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem; import org.hl7.fhir.r5.model.DomainResource; import org.hl7.fhir.r5.utils.ToolingExtensions; import org.hl7.fhir.utilities.Utilities; public class StatusRenderer { public static class ResourceStatusInformation { String fmm; String owner; String ownerLink; String status; String sstatus; String colorClass; public String getFmm() { return fmm; } public void setFmm(String fmm) { this.fmm = fmm; } public String getOwner() { return owner; } public void setOwner(String owner) { this.owner = owner; } public String getOwnerLink() { return ownerLink; } public void setOwnerLink(String ownerLink) { this.ownerLink = ownerLink; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getSstatus() { return sstatus; } public void setSstatus(String sstatus) { this.sstatus = sstatus; } public String getColorClass() { return colorClass; } public void setColorClass(String colorClass) { this.colorClass = colorClass; } } public static ResourceStatusInformation analyse(DomainResource resource) { ResourceStatusInformation info = new ResourceStatusInformation(); info.setFmm(readFmmStatus(resource)); info.setOwner(readOwner(resource)); info.setOwnerLink(readOwnerLink(resource)); info.setStatus(readStatus(resource)); info.setSstatus(readStandardsStatus(resource)); info.setColorClass(getColor(info)); return info; } private static String getColor(ResourceStatusInformation info) { if ("Draft".equals(info.getStatus())) { return "colsd"; } if (!"Active".equals(info.getStatus())) { return "colsd"; } if (info.getSstatus() == null) return "0".equals(info.getFmm()) ? "colsd" : "colstu"; switch (info.getSstatus()) { case "Draft": return "colsd"; case "Trial-Use": return "0".equals(info.getFmm()) ? "colsd" : "colstu"; case "Normative": return "colsn"; case "Informative": return "colsi"; case "Exteranl": return "colse"; default: return "colsi"; } } private static String readStandardsStatus(DomainResource resource) { return ToolingExtensions.readStringExtension(resource, ToolingExtensions.EXT_STANDARDS_STATUS); } private static String readStatus(DomainResource resource) { if (resource instanceof CanonicalResource) { return ((CanonicalResource) resource).getStatus().getDisplay(); } return null; } private static String readOwnerLink(DomainResource resource) { if (resource instanceof CanonicalResource) { for (ContactDetail cd : ((CanonicalResource) resource).getContact()) { for (ContactPoint cp : cd.getTelecom()) { if (cp.getSystem() == ContactPointSystem.URL) { return cp.getValue(); } } } } return null; } private static String readOwner(DomainResource resource) { if (resource instanceof CanonicalResource) { return ((CanonicalResource) resource).getPublisher(); } return null; } private static String readFmmStatus(DomainResource resource) { return ToolingExtensions.readStringExtension(resource, ToolingExtensions.EXT_FMM_LEVEL); } public static String render(String src, ResourceStatusInformation info) { StringBuilder b = new StringBuilder(); b.append("<table class=\""); b.append(info.getColorClass()); b.append("\"><tr>"); if (info.getOwnerLink() != null) { b.append("<td>Publisher: <a href=\""); b.append(info.getOwnerLink()); b.append("\">"); b.append(Utilities.escapeXml(info.getOwner())); b.append("</a></td><td>"); } else { b.append("<td>Publisher: "); b.append(Utilities.escapeXml(info.getOwner())); b.append("</td><td>"); } b.append("<a href=\""+src+"/versions.html#maturity\">Status</a>: "); b.append(info.getStatus()); b.append("</td><td>"); b.append("<a href=\""+src+"/versions.html#maturity\">Maturity Level</a>: "); if (info.getFmm() != null) { b.append(info.getFmm()); } else { b.append("N/A"); } b.append("</td><td>"); b.append("<a href=\""+src+"/versions.html#std-process\">Standards Status</a>: "); if (info.getSstatus() != null) { b.append(info.getSstatus()); } else { b.append("N/A"); } b.append("</td></tr></table>\r\n"); return b.toString(); } }
29.461538
100
0.623619
d3a55bfc4dcae3edd30d57b544f5dd619c05f720
314
package com.ian.spring.struts.service.impl; import com.ian.spring.struts.service.MyService; public class MyServiceImpl implements MyService{ public boolean valid(String username, String password){ if (username.equals("ian") && password.equals("kaka")) { return true; }else{ return false; } } }
19.625
58
0.72293
017058d1cd50a5421790a003575743fc41729342
2,084
package pt.up.fc.dcc.mooshak.server.commands; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import java.util.Arrays; import org.junit.Before; import org.junit.Test; public class AdminCommandServiceImplTest { AdminCommandServiceImpl servlet; @Before public void setUp() throws Exception { servlet = new AdminCommandServiceImpl(); } @Test public void testSanitizePathId() { for(String text: Arrays.asList("data","data/contests", "data/contests/proto_icpc", "data/contests/../contests/proto_icpc", "data/contests/proto_icpc/problems", "data/contests/proto_icpc/problems/A", "data/contests/proto_icpc/problems/A/tests", "data/contests/proto_icpc/problems/A/tests/T1", "data/contests/proto_icpc/problems/A/tests/T1/in.txt")) assertEquals(text,CommandService.sanitizePathId(text)); for(String text: Arrays.asList("/data","../data/contests", "../../../data/contests/proto_icpc", "../data/contests/../proto_icpc/problems", "../data/contests/proto_icpc/problems/A", "../../../../../../../../root", "../../root")) assertFalse(text,text.equals(CommandService.sanitizePathId(text))); } @Test public void testSanitizePathSegment() { for(String text: Arrays.asList("data", "A.c","Prog.java","int.txt","A",".data.tcl")) assertEquals(text,CommandService.sanitizePathSegment(text)); for(String text: Arrays.asList( "data/contests", "data/contests/proto_icpc", "data/contests/../contests/proto_icpc", "data/contests/proto_icpc/problems", "data/contests/proto_icpc/problems/A", "data/contests/proto_icpc/problems/A/tests", "data/contests/proto_icpc/problems/A/tests/T1", "data/contests/proto_icpc/problems/A/tests/T1/in.txt", "/data","../data/contests", "../../../data/contests/proto_icpc", "../data/contests/../proto_icpc/problems", "../data/contests/proto_icpc/problems/A", "../../../../../../../../root", "../../root")) assertFalse(text,text.equals(CommandService.sanitizePathSegment(text))); } }
30.647059
74
0.684261
a11c34ad67cbf2f2b31898c61b42a37914dba0fb
4,107
// Copyright 2016 Yahoo Inc. // Licensed under the terms of the Apache license. Please see LICENSE.md file distributed with this work for terms. package com.yahoo.bard.webservice.util; import com.fasterxml.jackson.databind.ObjectReader; import com.fasterxml.jackson.dataformat.csv.CsvMapper; import com.fasterxml.jackson.dataformat.csv.CsvParser; import com.fasterxml.jackson.dataformat.csv.CsvSchema; import java.io.IOException; import java.util.Arrays; import java.util.List; /** * Utility class to tokenize Strings based on CSV properties. */ public class FilterTokenizer { private static final String PARSING_FAILURE = "Parsing values '%s' failed"; private static final String PARSING_FAILURE_UNQOUTED_VALUES_FORMAT = "Set of values '%s' cannot be processed. " + "Empty strings, commas, and leading or trailing whitespace must be quoted"; // Sharing ObjectReaders/ObjectWriters is recommended as more efficient vs sharing ObjectMapper. It is thread-safe. private static ObjectReader defaultReader = initDefault(); private static ObjectReader rawReader = initRaw(); /** * Initialize an ObjectReader. * * @return an initialized ObjectReader */ protected static ObjectReader initDefault() { return init(CsvSchema.emptySchema()); } /** * Initialize an ObjectReader that does not quote things. * * @return an initialized ObjectReader */ protected static ObjectReader initRaw() { return init(CsvSchema.emptySchema().withoutQuoteChar()); } /** * Initialize the tokenizer. * * @param filterCsvSchema Schema to initialize the tokenizer for * * @return an initialized ObjectReader */ protected static ObjectReader init(CsvSchema filterCsvSchema) { return new CsvMapper() .disable(CsvParser.Feature.WRAP_AS_ARRAY) .readerFor(String[].class) .with(filterCsvSchema); } /** * Split a string into tokens based on CSV rules. * The CSV parsing defined here uses comma as a delimeter, * double quotes for escaping characters, including comma and double quote itself, * and does not use a special character for escaping (such as '\'). * If double quotes need to be escaped inside the field, then the whole field needs * to be double quoted (see Examples below). * <p> * Examples: * Foo, Bar corresponds to ["Foo", "Bar"] * "Foo, Bar and Baz",Qux corresponds to ["Foo, Bar and Baz", "Qux"] * Foo,"2'10""" corresponds to ["Foo", "2'10\""] * Foo,,Bar is invalid. Empty string was not quoted * * @param input the string to split * * @return list of tokens. The size of this list is fixed. * @throws IllegalArgumentException if the input has empty items */ public static List<String> split(String input) throws IllegalArgumentException { try { // Since there's no way to check whether a field was an empty string surrounded // by double quotes or not after parsing it as a CSV string with the default // parser, we use two parsers: One with the default schema and one that does // not translate quotes String[] result = defaultReader.readValue(input); String[] raw = rawReader.readValue(input); // If the one that doesn't translate quotes includes empty strings (after trimming) // then it's unclear whether the use of empty field was intended or not by the user // and therefore an exception is thrown for (String item : raw) { if (item.trim().isEmpty()) { String msg = String.format(PARSING_FAILURE_UNQOUTED_VALUES_FORMAT, input); throw new IllegalArgumentException(msg); } } return Arrays.asList(result); } catch (IOException ioe) { String msg = String.format(PARSING_FAILURE, input); throw new IllegalArgumentException(msg, ioe); } } }
39.873786
119
0.658875
4eee132eaa5bbdb6bee5e385b8c73031860d99e0
550
package com.linkedin.r2.message.stream.entitystream; import com.linkedin.data.ByteString; /** * This is a convenience reader to drain the bytes in the entity stream and simply discard the bytes. * * @author Zhenkai Zhu */ public class DrainReader implements Reader { private ReadHandle _rh; public void onInit(ReadHandle rh) { _rh = rh; _rh.request(Integer.MAX_VALUE); } public void onDataAvailable(ByteString data) { _rh.request(1); } public void onDone() { } public void onError(Throwable ex) { } }
16.176471
101
0.696364
167c9819f7fb9eb6a1c20e9ed20e996f800df9b1
724
package com.fishercoder.solutions; public class _1043 { public static class Solution1 { /** * credit: https://leetcode.com/problems/partition-array-for-maximum-sum/discuss/290863/JavaC%2B%2BPython-DP */ public int maxSumAfterPartitioning(int[] A, int K) { int N = A.length; int[] dp = new int[N]; for (int i = 0; i < N; i++) { int curMax = 0; for (int k = 1; k <= K && i - k + 1 >= 0; k++) { curMax = Math.max(curMax, A[i - k + 1]); dp[i] = Math.max(dp[i], (i >= k ? dp[i - k] : 0) + curMax * k); } } return dp[N - 1]; } } }
32.909091
116
0.439227
29091281737874571d55f6c2ab7b86dd95deaedf
1,775
package com.anop.resource; import java.io.Serializable; import java.util.Date; /** * 接受者通知资源 * * @author Xue_Feng */ public class ReceiverNotificationResource implements Serializable { private Integer id; private Integer groupId; private Integer userId; private String nickname; private String avatarUrl; private String title; private String content; private Date creationDate; private Byte isRead; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getGroupId() { return groupId; } public void setGroupId(Integer groupId) { this.groupId = groupId; } public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public String getAvatarUrl() { return avatarUrl; } public void setAvatarUrl(String avatarUrl) { this.avatarUrl = avatarUrl; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public Date getCreationDate() { return creationDate; } public void setCreationDate(Date creationDate) { this.creationDate = creationDate; } public Byte getIsRead() { return isRead; } public void setIsRead(Byte isRead) { this.isRead = isRead; } }
17.401961
67
0.614085
d83bdfd6a634c1332ff2b7af0ee72f79b13ac33b
7,985
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package lexicalanalyzer; import java.util.ArrayList; import java.util.Arrays; /** * * @author Rakesh */ public class LexicalAnalyzer extends javax.swing.JFrame { private String[] operator={ "+", "-", "*", "/", "%", "=", "(", ")", "{", "}", "+=", "-=", "/=", "+=", "%=", "&=", "|=", "++", "--", "&&", "||", "&", "|", "~", "!", "^", "==", ">=", "<=", "!=", "<", ">", ":", "?", ".", "->", ",", "\"", "\'", "#", "//", "/*", "*/"}; private String[] keyword={ "int", "float", "char", "void", "for", "if", "while", "do"}; private ArrayList<String> tokens=new ArrayList<>(); /** * Creates new form LexicalAnalyzer */ public LexicalAnalyzer() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); list = new javax.swing.JList(); jScrollPane2 = new javax.swing.JScrollPane(); txt = new javax.swing.JTextArea(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Lex"); list.setFont(new java.awt.Font("Monospaced", 0, 10)); // NOI18N jScrollPane1.setViewportView(list); txt.setColumns(20); txt.setRows(5); txt.setText("int main() {\n\tchar* s=\"Hello\";\n\tint a, b=1, c='a';\n\ta=b+c;\n}"); txt.addCaretListener(new javax.swing.event.CaretListener() { public void caretUpdate(javax.swing.event.CaretEvent evt) { txtCaretUpdate(evt); } }); jScrollPane2.setViewportView(txt); jLabel1.setText("Input string :"); jLabel2.setText("Tokens :"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE) .addComponent(jScrollPane2) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent(jLabel2)) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 451, Short.MAX_VALUE) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents private boolean contains(String []array, String s) { for(String e : array) { if(e.equals(s)) return true; } return false; } private void addToken(String token) { if(token.trim().isEmpty()) return; if(token.charAt(0)=='\"') tokens.add("String : "+token); else if(Character.isDigit(token.charAt(0)) || token.charAt(0)=='\'') tokens.add("Constants : "+token); else if(contains(operator, token)) tokens.add("Operator : "+token); else if(contains(keyword, token)) tokens.add("Keyword : "+token); else tokens.add("Identifier : "+token); } public void tokenize() { //list.setListData(s.split("[ \t\n]*\\b")); //list.setListData(s.split("!(([a-zA-Z_][a-zA-Z_0-9]*)|([0-9])|([=+-]))")); list.removeAll(); tokens.clear(); String s=txt.getText(); String token=""; boolean isOperator=false, isString=false, escape=false; for(int i=0; i<s.length(); i++) { char c=s.charAt(i); if(c=='\"' || c=='\'') { if(token.charAt(token.length()-1)=='\\') escape=!escape; if(isString) { if(escape) { token+=c; escape=false; } else { isString=false; token+=c; addToken(token); token=""; } } else { addToken(token); token=""+c; isString=true; } } else if(isString) { token+=c; } else { if(Character.isAlphabetic(c) || Character.isDigit(c)) { if(isOperator!=false) { addToken(token); token=""; } token+=c; isOperator=false; } else if("=+-*/%(){}[],;.~!|&<>!#^-\"\'".contains(""+c)) { if(isOperator!=true || !contains(operator, token+c)) { addToken(token); token=""; } token+=c; isOperator=true; } else { addToken(token); token=""; isOperator=false; } } } addToken(token); list.setListData(tokens.toArray()); } private void txtCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_txtCaretUpdate tokenize(); }//GEN-LAST:event_txtCaretUpdate /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(LexicalAnalyzer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(LexicalAnalyzer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(LexicalAnalyzer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(LexicalAnalyzer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { LexicalAnalyzer lexWindow=new LexicalAnalyzer(); lexWindow.setVisible(true); lexWindow.tokenize(); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JList list; private javax.swing.JTextArea txt; // End of variables declaration//GEN-END:variables }
34.418103
127
0.614527
f354727ee6e8259303207b98640a971397ae0218
936
package PieceCreator; import DataStructures.Pieza; import PieceCreator.PieceType.ProVersion.*; //Clase que implementa la fabrica abstracta y que crea las piezas pro public class PjeProFactory implements PjeAbstractFactory{ int id = 1; public Pieza crearArquero() { ArqueroP arqueroP=new ArqueroP(this.id); this.id++; return arqueroP; } public Pieza crearLycan() { LycanP lycanP=new LycanP(this.id); this.id++; return lycanP; } public Pieza crearMago() { MagoP magoP=new MagoP(this.id); this.id++; return magoP; } public Pieza crearNigromante() { NigromanteP nigromanteP=new NigromanteP(this.id); this.id++; return nigromanteP; } public Pieza crearTanque() { TanqueP tanqueP=new TanqueP(this.id); this.id++; return tanqueP; } public Pieza crearVampiro() { VampiroP vampiroP=new VampiroP(this.id); this.id++; return vampiroP; } }
20.347826
70
0.679487
8d6d703989883dfa0f4bd79bb640145bd922963d
1,994
/* * Copyright (c) 2016-2017, Adam <Adam@sigterm.info> * 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 net.runelite.cache.util; import static org.junit.Assert.assertArrayEquals; import org.junit.Test; public class XteaTest { @Test public void test() { byte[] data = "testtesttest1".getBytes(); int[] key = new int[] { 4, 8, 15, 16 }; byte[] encrypted = new byte[] { 121, -18, 48, 64, 120, -42, -113, 77, 116, 101, 115, 116, 49 }; Xtea xtea = new Xtea(key); byte[] encData = xtea.encrypt(data, data.length); assertArrayEquals(encrypted, encData); xtea = new Xtea(key); byte[] decData = xtea.decrypt(encData, encData.length); assertArrayEquals(data, decData); } }
35.607143
82
0.732698
71ce2f52dd863a4902aaf3fee7c4139d305771af
538
package de.marcermarc.backup.tasks; import de.marcermarc.backup.controller.PluginController; import org.bukkit.scheduler.BukkitTask; public class StartBackup implements Runnable { private PluginController controller; public StartBackup(PluginController pluginController) { this.controller = pluginController; } @Override public void run() { BukkitTask bukkitTask = controller.getMain().getServer().getScheduler().runTaskAsynchronously(controller.getMain(), new AsyncBackup(controller)); } }
25.619048
153
0.756506
5ff24d99460a7e2633e54f2ff05069f45c7181ea
699
package com.salesmanager.test.shop.rest.service; import org.eclipse.microprofile.rest.client.RestClientBuilder; import org.junit.Test; import java.net.URI; import java.net.URISyntaxException; public class OperationActuatorService { @Test public void testApplicationShutdown() throws URISyntaxException { URI uri = new URI("http://127.0.0.1:8080"); com.salesmanager.shop.rest.service.OperationActuatorService operationActuatorService = RestClientBuilder.newBuilder() .baseUri(uri) .build(com.salesmanager.shop.rest.service.OperationActuatorService.class); System.out.println(operationActuatorService.applicationShutdown()); } }
34.95
125
0.745351
951ba08fc0c321ddb03b229a90ca3089f02f9dc9
357
package org.jjche.security.property; /** * 验证码配置枚举 * * @author miaoyj * @version 1.0.8-SNAPSHOT * @author: liaojinlong * @since: 2020/6/10 17:40 */ public enum LoginCodeEnum { /** * 算数 */ arithmetic, /** * 中文 */ chinese, /** * 中文闪图 */ chinese_gif, /** * 闪图 */ gif, spec }
11.516129
36
0.473389
c70dd6721cdec077d75adfe04bad8a1563402963
773
package org.firstinspires.ftc.teamcode.toolkit.core; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; import org.firstinspires.ftc.teamcode.UpliftRobot; public abstract class Background implements Runnable{ Thread t; UpliftRobot robot; LinearOpMode opMode; public Background(UpliftRobot robot) { t = new Thread(this); this.robot = robot; this.opMode = robot.opMode; } public void enable() { t.start(); } public abstract void loop(); public void stop() { t = null; } @Override public void run() { opMode.waitForStart(); while(t != null && opMode.opModeIsActive() && !opMode.isStopRequested()) { loop(); } stop(); } }
20.342105
82
0.610608
047801d2c98510a3979184d558e680965c3ed5b6
507
package icetone.extras.chooser; import icetone.controls.buttons.SelectableItem; import icetone.core.BaseScreen; public class DefaultButtonView<I> extends AbstractButtonView<I> { public DefaultButtonView() { this(BaseScreen.get()); } public DefaultButtonView(BaseScreen screen) { super("button-view", screen); } @Override protected void configureButton(SelectableItem button, I path) { super.configureButton(button, path); button.setText(getChooser().getResources().getLabel(path)); } }
22.043478
65
0.767258
bfdae5730f31c10945c9a2c9b857af90d8211236
179,785
/* *AVISO LEGAL © Copyright *Este programa esta protegido por la ley de derechos de autor. *La reproduccion o distribucion ilicita de este programa o de cualquiera de *sus partes esta penado por la ley con severas sanciones civiles y penales, *y seran objeto de todas las sanciones legales que correspondan. *Su contenido no puede copiarse para fines comerciales o de otras, *ni puede mostrarse, incluso en una version modificada, en otros sitios Web. Solo esta permitido colocar hipervinculos al sitio web. */ package com.bydan.erp.nomina.presentation.swing.jinternalframes; import com.bydan.erp.seguridad.presentation.swing.jinternalframes.*; import com.bydan.erp.nomina.presentation.web.jsf.sessionbean.*;//; import com.bydan.erp.nomina.presentation.swing.jinternalframes.*; import com.bydan.erp.nomina.presentation.swing.jinternalframes.auxiliar.*; import com.bydan.erp.seguridad.presentation.web.jsf.sessionbean.*; import com.bydan.erp.seguridad.business.entity.*; //import com.bydan.erp.nomina.presentation.report.source.*; import com.bydan.framework.erp.business.entity.Reporte; import com.bydan.erp.seguridad.business.entity.Modulo; import com.bydan.erp.seguridad.business.entity.Opcion; import com.bydan.erp.seguridad.business.entity.Usuario; import com.bydan.erp.seguridad.business.entity.ResumenUsuario; import com.bydan.erp.seguridad.business.entity.ParametroGeneralSg; import com.bydan.erp.seguridad.business.entity.ParametroGeneralUsuario; import com.bydan.erp.seguridad.util.SistemaParameterReturnGeneral; import com.bydan.erp.nomina.business.entity.*; import com.bydan.erp.nomina.util.ValorRubroVariableConstantesFunciones; import com.bydan.erp.nomina.business.logic.*; import com.bydan.framework.erp.business.entity.DatoGeneral; import com.bydan.framework.erp.business.entity.OrderBy; import com.bydan.framework.erp.business.entity.Mensajes; import com.bydan.framework.erp.business.entity.Classe; import com.bydan.framework.erp.business.logic.*; import com.bydan.framework.erp.presentation.desktop.swing.DateConverter; import com.bydan.framework.erp.presentation.desktop.swing.DateConverterFromDate; import com.bydan.framework.erp.presentation.desktop.swing.FuncionesSwing; import com.bydan.framework.erp.presentation.desktop.swing.JInternalFrameBase; import com.bydan.framework.erp.presentation.desktop.swing.*; import com.bydan.framework.erp.util.*; import java.util.Date; import java.util.List; import java.util.ArrayList; import java.io.File; import java.util.HashMap; import java.util.Map; import java.io.PrintWriter; import java.sql.SQLException; import java.sql.*; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.util.JRLoader; import net.sf.jasperreports.engine.export.JRHtmlExporter; import net.sf.jasperreports.j2ee.servlets.BaseHttpServlet; import net.sf.jasperreports.engine.JRExporterParameter; import net.sf.jasperreports.engine.data.JRBeanArrayDataSource; import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; import javax.swing.*; import java.awt.*; import javax.swing.border.EtchedBorder; import javax.swing.border.Border; import javax.swing.border.TitledBorder; import java.awt.event.*; import javax.swing.event.*; import javax.swing.GroupLayout.Alignment; import javax.swing.table.TableColumn; import com.toedter.calendar.JDateChooser; @SuppressWarnings("unused") public class ValorRubroVariableJInternalFrame extends ValorRubroVariableBeanSwingJInternalFrameAdditional { private static final long serialVersionUID = 1L; //protected Usuario usuarioActual=null; public JToolBar jTtoolBarValorRubroVariable; protected JMenuBar jmenuBarValorRubroVariable; protected JMenu jmenuValorRubroVariable; protected JMenu jmenuDatosValorRubroVariable; protected JMenu jmenuArchivoValorRubroVariable; protected JMenu jmenuAccionesValorRubroVariable; protected JPanel jContentPane = null; protected JPanel jPanelBusquedasParametrosValorRubroVariable = new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true);//new JPanel(); protected GridBagLayout gridaBagLayoutValorRubroVariable; protected GridBagConstraints gridBagConstraintsValorRubroVariable; //protected JInternalFrameBase jInternalFrameParent; public ValorRubroVariableDetalleFormJInternalFrame jInternalFrameDetalleFormValorRubroVariable; protected ReporteDinamicoJInternalFrame jInternalFrameReporteDinamicoValorRubroVariable; protected ImportacionJInternalFrame jInternalFrameImportacionValorRubroVariable; //VENTANAS PARA ACTUALIZAR Y BUSCAR FK protected EmpresaBeanSwingJInternalFrame empresaBeanSwingJInternalFrame; public String sFinalQueryGeneral_empresa=""; protected EmpleadoBeanSwingJInternalFrame empleadoBeanSwingJInternalFrame; public String sFinalQueryGeneral_empleado=""; protected RubroEmpleaBeanSwingJInternalFrame rubroempleaBeanSwingJInternalFrame; public String sFinalQueryGeneral_rubroemplea=""; public ValorRubroVariableSessionBean valorrubrovariableSessionBean; public EmpresaSessionBean empresaSessionBean; public EmpleadoSessionBean empleadoSessionBean; public RubroEmpleaSessionBean rubroempleaSessionBean; //protected JDesktopPane jDesktopPane; public List<ValorRubroVariable> valorrubrovariables; public List<ValorRubroVariable> valorrubrovariablesEliminados; public List<ValorRubroVariable> valorrubrovariablesAux; protected OrderByJInternalFrame jInternalFrameOrderByValorRubroVariable; protected JButton jButtonAbrirOrderByValorRubroVariable; //protected JPanel jPanelOrderByValorRubroVariable; //public JScrollPane jScrollPanelOrderByValorRubroVariable; //protected JButton jButtonCerrarOrderByValorRubroVariable; public ArrayList<OrderBy> arrOrderBy= new ArrayList<OrderBy>(); public ValorRubroVariableLogic valorrubrovariableLogic; public JScrollPane jScrollPanelDatosValorRubroVariable; public JScrollPane jScrollPanelDatosEdicionValorRubroVariable; public JScrollPane jScrollPanelDatosGeneralValorRubroVariable; //public JScrollPane jScrollPanelDatosValorRubroVariableOrderBy; //public JScrollPane jScrollPanelReporteDinamicoValorRubroVariable; //public JScrollPane jScrollPanelImportacionValorRubroVariable; protected JPanel jPanelAccionesValorRubroVariable; protected JPanel jPanelPaginacionValorRubroVariable; protected JPanel jPanelParametrosReportesValorRubroVariable; protected JPanel jPanelParametrosReportesAccionesValorRubroVariable; ; protected JPanel jPanelParametrosAuxiliar1ValorRubroVariable; protected JPanel jPanelParametrosAuxiliar2ValorRubroVariable; protected JPanel jPanelParametrosAuxiliar3ValorRubroVariable; protected JPanel jPanelParametrosAuxiliar4ValorRubroVariable; //protected JPanel jPanelParametrosAuxiliar5ValorRubroVariable; //protected JPanel jPanelReporteDinamicoValorRubroVariable; //protected JPanel jPanelImportacionValorRubroVariable; public JTable jTableDatosValorRubroVariable; //public JTable jTableDatosValorRubroVariableOrderBy; //ELEMENTOS TABLAS PARAMETOS //ELEMENTOS TABLAS PARAMETOS_FIN protected JButton jButtonNuevoValorRubroVariable; protected JButton jButtonDuplicarValorRubroVariable; protected JButton jButtonCopiarValorRubroVariable; protected JButton jButtonVerFormValorRubroVariable; protected JButton jButtonNuevoRelacionesValorRubroVariable; protected JButton jButtonModificarValorRubroVariable; protected JButton jButtonGuardarCambiosTablaValorRubroVariable; protected JButton jButtonCerrarValorRubroVariable; protected JButton jButtonRecargarInformacionValorRubroVariable; protected JButton jButtonProcesarInformacionValorRubroVariable; protected JButton jButtonAnterioresValorRubroVariable; protected JButton jButtonSiguientesValorRubroVariable; protected JButton jButtonNuevoGuardarCambiosValorRubroVariable; //protected JButton jButtonGenerarReporteDinamicoValorRubroVariable; //protected JButton jButtonCerrarReporteDinamicoValorRubroVariable; //protected JButton jButtonGenerarExcelReporteDinamicoValorRubroVariable; //protected JButton jButtonAbrirImportacionValorRubroVariable; //protected JButton jButtonGenerarImportacionValorRubroVariable; //protected JButton jButtonCerrarImportacionValorRubroVariable; //protected JFileChooser jFileChooserImportacionValorRubroVariable; //protected File fileImportacionValorRubroVariable; //TOOLBAR protected JButton jButtonNuevoToolBarValorRubroVariable; protected JButton jButtonDuplicarToolBarValorRubroVariable; protected JButton jButtonNuevoRelacionesToolBarValorRubroVariable; public JButton jButtonGuardarCambiosToolBarValorRubroVariable; protected JButton jButtonCopiarToolBarValorRubroVariable; protected JButton jButtonVerFormToolBarValorRubroVariable; public JButton jButtonGuardarCambiosTablaToolBarValorRubroVariable; protected JButton jButtonMostrarOcultarTablaToolBarValorRubroVariable; protected JButton jButtonCerrarToolBarValorRubroVariable; protected JButton jButtonRecargarInformacionToolBarValorRubroVariable; protected JButton jButtonProcesarInformacionToolBarValorRubroVariable; protected JButton jButtonAnterioresToolBarValorRubroVariable; protected JButton jButtonSiguientesToolBarValorRubroVariable; protected JButton jButtonNuevoGuardarCambiosToolBarValorRubroVariable; protected JButton jButtonAbrirOrderByToolBarValorRubroVariable; //TOOLBAR //MENU protected JMenuItem jMenuItemNuevoValorRubroVariable; protected JMenuItem jMenuItemDuplicarValorRubroVariable; protected JMenuItem jMenuItemNuevoRelacionesValorRubroVariable; protected JMenuItem jMenuItemGuardarCambiosValorRubroVariable; protected JMenuItem jMenuItemCopiarValorRubroVariable; protected JMenuItem jMenuItemVerFormValorRubroVariable; protected JMenuItem jMenuItemGuardarCambiosTablaValorRubroVariable; protected JMenuItem jMenuItemCerrarValorRubroVariable; protected JMenuItem jMenuItemDetalleCerrarValorRubroVariable; protected JMenuItem jMenuItemDetalleAbrirOrderByValorRubroVariable; protected JMenuItem jMenuItemDetalleMostarOcultarValorRubroVariable; protected JMenuItem jMenuItemRecargarInformacionValorRubroVariable; protected JMenuItem jMenuItemProcesarInformacionValorRubroVariable; protected JMenuItem jMenuItemAnterioresValorRubroVariable; protected JMenuItem jMenuItemSiguientesValorRubroVariable; protected JMenuItem jMenuItemNuevoGuardarCambiosValorRubroVariable; protected JMenuItem jMenuItemAbrirOrderByValorRubroVariable; protected JMenuItem jMenuItemMostrarOcultarValorRubroVariable; //MENU protected JLabel jLabelAccionesValorRubroVariable; protected JCheckBox jCheckBoxSeleccionarTodosValorRubroVariable; protected JCheckBox jCheckBoxSeleccionadosValorRubroVariable; protected JCheckBox jCheckBoxConAltoMaximoTablaValorRubroVariable; protected JCheckBox jCheckBoxConGraficoReporteValorRubroVariable; @SuppressWarnings("rawtypes") protected JComboBox jComboBoxTiposArchivosReportesValorRubroVariable; @SuppressWarnings("rawtypes") protected JComboBox jComboBoxTiposReportesValorRubroVariable; //@SuppressWarnings("rawtypes") //protected JComboBox jComboBoxTiposArchivosReportesDinamicoValorRubroVariable; //@SuppressWarnings("rawtypes") //protected JComboBox jComboBoxTiposReportesDinamicoValorRubroVariable; @SuppressWarnings("rawtypes") protected JComboBox jComboBoxTiposGraficosReportesValorRubroVariable; @SuppressWarnings("rawtypes") protected JComboBox jComboBoxTiposPaginacionValorRubroVariable; @SuppressWarnings("rawtypes") protected JComboBox jComboBoxTiposRelacionesValorRubroVariable; @SuppressWarnings("rawtypes") protected JComboBox jComboBoxTiposAccionesValorRubroVariable; @SuppressWarnings("rawtypes") protected JComboBox jComboBoxTiposSeleccionarValorRubroVariable; protected JTextField jTextFieldValorCampoGeneralValorRubroVariable; //REPORTE DINAMICO //@SuppressWarnings("rawtypes") //public JLabel jLabelColumnasSelectReporteValorRubroVariable; //public JList<Reporte> jListColumnasSelectReporteValorRubroVariable; //public JScrollPane jScrollColumnasSelectReporteValorRubroVariable; //public JLabel jLabelRelacionesSelectReporteValorRubroVariable; //public JList<Reporte> jListRelacionesSelectReporteValorRubroVariable; //public JScrollPane jScrollRelacionesSelectReporteValorRubroVariable; //public JLabel jLabelConGraficoDinamicoValorRubroVariable; //protected JCheckBox jCheckBoxConGraficoDinamicoValorRubroVariable; //public JLabel jLabelGenerarExcelReporteDinamicoValorRubroVariable; //public JLabel jLabelTiposArchivoReporteDinamicoValorRubroVariable; //public JLabel jLabelArchivoImportacionValorRubroVariable; //public JLabel jLabelPathArchivoImportacionValorRubroVariable; //protected JTextField jTextFieldPathArchivoImportacionValorRubroVariable; //public JLabel jLabelColumnaCategoriaGraficoValorRubroVariable; //@SuppressWarnings("rawtypes") //protected JComboBox jComboBoxColumnaCategoriaGraficoValorRubroVariable; //public JLabel jLabelColumnaCategoriaValorValorRubroVariable; //@SuppressWarnings("rawtypes") //protected JComboBox jComboBoxColumnaCategoriaValorValorRubroVariable; //public JLabel jLabelColumnasValoresGraficoValorRubroVariable; //public JList<Reporte> jListColumnasValoresGraficoValorRubroVariable; //public JScrollPane jScrollColumnasValoresGraficoValorRubroVariable; //public JLabel jLabelTiposGraficosReportesDinamicoValorRubroVariable; //@SuppressWarnings("rawtypes") //protected JComboBox jComboBoxTiposGraficosReportesDinamicoValorRubroVariable; protected Boolean conMaximoRelaciones=true; protected Boolean conFuncionalidadRelaciones=true; public Boolean conCargarMinimo=false; public Boolean cargarRelaciones=false; public Boolean conMostrarAccionesCampo=false; public Boolean permiteRecargarForm=false;//PARA NUEVO PREPARAR Y MANEJO DE EVENTOS, EVITAR QUE SE EJECUTE AL CARGAR VENTANA O LOAD public Boolean conCargarFormDetalle=false; //BYDAN_BUSQUEDAS public JTabbedPane jTabbedPaneBusquedasValorRubroVariable; public JPanel jPanelFK_IdEmpleadoValorRubroVariable; public JButton jButtonFK_IdEmpleadoValorRubroVariable; public JPanel jPanelFK_IdRubroEmpleaValorRubroVariable; public JButton jButtonFK_IdRubroEmpleaValorRubroVariable; public JPanel jPanelid_empleadoFK_IdEmpleadoValorRubroVariable; public JLabel jLabelid_empleadoFK_IdEmpleadoValorRubroVariable; @SuppressWarnings("rawtypes") public JComboBox jComboBoxid_empleadoFK_IdEmpleadoValorRubroVariable; public JButton jButtonid_empleadoFK_IdEmpleadoValorRubroVariable= new JButtonMe(); public JButton jButtonid_empleadoFK_IdEmpleadoValorRubroVariableUpdate= new JButtonMe(); public JButton jButtonid_empleadoFK_IdEmpleadoValorRubroVariableBusqueda= new JButtonMe(); public JPanel jPanelid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable; public JLabel jLabelid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable; @SuppressWarnings("rawtypes") public JComboBox jComboBoxid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable; public JButton jButtonid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable= new JButtonMe(); public JButton jButtonid_rubro_empleaFK_IdRubroEmpleaValorRubroVariableUpdate= new JButtonMe(); public JButton jButtonid_rubro_empleaFK_IdRubroEmpleaValorRubroVariableBusqueda= new JButtonMe(); //ELEMENTOS TABLAS PARAMETOS //ELEMENTOS TABLAS PARAMETOS_FIN public static int openFrameCount = 0; public static final int xOffset = 10, yOffset = 35; //LOS DATOS DE NUEVO Y EDICION ACTUAL APARECEN EN OTRA VENTANA(true) O NO(false) public static Boolean CON_DATOS_FRAME=true; public static Boolean ISBINDING_MANUAL=true; public static Boolean ISLOAD_FKLOTE=true; public static Boolean ISBINDING_MANUAL_TABLA=true; public static Boolean CON_CARGAR_MEMORIA_INICIAL=true; //Al final no se utilizan, se inicializan desde JInternalFrameBase, desde ParametroGeneralUsuario public static String STIPO_TAMANIO_GENERAL="NORMAL"; public static String STIPO_TAMANIO_GENERAL_TABLA="NORMAL"; public static Boolean CONTIPO_TAMANIO_MANUAL=false; public static Boolean CON_LLAMADA_SIMPLE=true; public static Boolean CON_LLAMADA_SIMPLE_TOTAL=true; public static Boolean ESTA_CARGADO_PORPARTE=false; public int iWidthScroll=0;//(screenSize.width-screenSize.width/2)+(250*0); public int iHeightScroll=0;//(screenSize.height-screenSize.height/Constantes.ISWING_RESTOPARTE_DIFERENCIA_ALTO); //public int iWidthFormulario=450;//(screenSize.width-screenSize.width/2)+(250*0); //public int iHeightFormulario=330;//(screenSize.height-screenSize.height/Constantes.ISWING_RESTOPARTE_DIFERENCIA_ALTO); //Esto va en DetalleForm //public int iHeightFormularioMaximo=0; //public int iWidthFormularioMaximo=0; public int iWidthTableDefinicion=0; public double dStart = 0; public double dEnd = 0; public double dDif = 0; /* double start=(double)System.currentTimeMillis(); double end=0; double dif=0; end=(double)System.currentTimeMillis(); dif=end - start; start=(double)System.currentTimeMillis(); System.out.println("Tiempo(ms) Carga TEST 1_2 DetalleMovimientoInventario: " + dif); */ public SistemaParameterReturnGeneral sistemaReturnGeneral; public List<Opcion> opcionsRelacionadas=new ArrayList<Opcion>(); //ES AUXILIAR PARA WINDOWS FORMS public ValorRubroVariableJInternalFrame() throws Exception { super(PaginaTipo.PRINCIPAL); //super("ValorRubroVariable No " + (++openFrameCount),true, /*resizable*/true, /*closable*/true, /*maximizable*/true);//iconifiable try { //Boolean cargarRelaciones=false; initialize(null,false,false,false/*cargarRelaciones*/,null,null,null,null,null,null,PaginaTipo.PRINCIPAL); } catch(Exception e) { FuncionesSwing.manageException(this, e, null); } } public ValorRubroVariableJInternalFrame(Boolean cargarRelaciones,PaginaTipo paginaTipo) throws Exception { super(paginaTipo); //super("ValorRubroVariable No " + (++openFrameCount),true, /*resizable*/true, /*closable*/true, /*maximizable*/true);//iconifiable try { initialize(null,false,false,cargarRelaciones,null,null,null,null,null,null,paginaTipo); } catch(Exception e) { FuncionesSwing.manageException(this, e, null); } } public ValorRubroVariableJInternalFrame(Boolean conGuardarRelaciones,Boolean esGuardarRelacionado,Boolean cargarRelaciones,PaginaTipo paginaTipo) throws Exception { super(paginaTipo); //super("ValorRubroVariable No " + (++openFrameCount),true, /*resizable*/true, /*closable*/true, /*maximizable*/true);//iconifiable try { initialize(null,conGuardarRelaciones,esGuardarRelacionado,cargarRelaciones,null,null,null,null,null,null,paginaTipo); } catch(Exception e) { FuncionesSwing.manageException(this, e, null); } } public ValorRubroVariableJInternalFrame(JDesktopPane jdesktopPane,Boolean conGuardarRelaciones,Boolean esGuardarRelacionado,Boolean cargarRelaciones,Usuario usuarioActual,ResumenUsuario resumenUsuarioActual,Modulo moduloActual,Opcion opcionActual,ParametroGeneralSg parametroGeneralSg,ParametroGeneralUsuario parametroGeneralUsuario,PaginaTipo paginaTipo) throws Exception { super(paginaTipo);//,jdesktopPane this.jDesktopPane=jdesktopPane; this.dStart=(double)System.currentTimeMillis(); //super("ValorRubroVariable No " + (++openFrameCount),true, /*resizable*/true, /*closable*/true, /*maximizable*/true);//iconifiable try { long start_time=0; long end_time=0; if(Constantes2.ISDEVELOPING2) { start_time = System.currentTimeMillis(); } initialize(jdesktopPane,conGuardarRelaciones,esGuardarRelacionado,cargarRelaciones,usuarioActual,resumenUsuarioActual,moduloActual,opcionActual,parametroGeneralSg,parametroGeneralUsuario,paginaTipo); if(Constantes2.ISDEVELOPING2) { end_time = System.currentTimeMillis(); String sTipo="Clase Padre Ventana"; Funciones2.getMensajeTiempoEjecucion(start_time, end_time, sTipo,false); } } catch(Exception e) { FuncionesSwing.manageException(this, e, null); } } public JInternalFrameBase getJInternalFrameParent() { return jInternalFrameParent; } public void setJInternalFrameParent(JInternalFrameBase internalFrameParent) { jInternalFrameParent = internalFrameParent; } public void setjButtonRecargarInformacion(JButton jButtonRecargarInformacionValorRubroVariable) { this.jButtonRecargarInformacionValorRubroVariable = jButtonRecargarInformacionValorRubroVariable; } public JButton getjButtonProcesarInformacionValorRubroVariable() { return this.jButtonProcesarInformacionValorRubroVariable; } public void setjButtonProcesarInformacion(JButton jButtonProcesarInformacionValorRubroVariable) { this.jButtonProcesarInformacionValorRubroVariable = jButtonProcesarInformacionValorRubroVariable; } public JButton getjButtonRecargarInformacionValorRubroVariable() { return this.jButtonRecargarInformacionValorRubroVariable; } public List<ValorRubroVariable> getvalorrubrovariables() { return this.valorrubrovariables; } public void setvalorrubrovariables(List<ValorRubroVariable> valorrubrovariables) { this.valorrubrovariables = valorrubrovariables; } public List<ValorRubroVariable> getvalorrubrovariablesAux() { return this.valorrubrovariablesAux; } public void setvalorrubrovariablesAux(List<ValorRubroVariable> valorrubrovariablesAux) { this.valorrubrovariablesAux = valorrubrovariablesAux; } public List<ValorRubroVariable> getvalorrubrovariablesEliminados() { return this.valorrubrovariablesEliminados; } public void setValorRubroVariablesEliminados(List<ValorRubroVariable> valorrubrovariablesEliminados) { this.valorrubrovariablesEliminados = valorrubrovariablesEliminados; } @SuppressWarnings("rawtypes") public JComboBox getjComboBoxTiposSeleccionarValorRubroVariable() { return jComboBoxTiposSeleccionarValorRubroVariable; } @SuppressWarnings("rawtypes") public void setjComboBoxTiposSeleccionarValorRubroVariable( JComboBox jComboBoxTiposSeleccionarValorRubroVariable) { this.jComboBoxTiposSeleccionarValorRubroVariable = jComboBoxTiposSeleccionarValorRubroVariable; } public void setBorderResaltarTiposSeleccionarValorRubroVariable() { Border borderResaltar=Funciones2.getBorderResaltar(this.getParametroGeneralUsuario(),"PARAMETRO"); this.jTtoolBarValorRubroVariable.setBorder(borderResaltar); this.jComboBoxTiposSeleccionarValorRubroVariable .setBorder(borderResaltar); } public JTextField getjTextFieldValorCampoGeneralValorRubroVariable() { return jTextFieldValorCampoGeneralValorRubroVariable; } public void setjTextFieldValorCampoGeneralValorRubroVariable( JTextField jTextFieldValorCampoGeneralValorRubroVariable) { this.jTextFieldValorCampoGeneralValorRubroVariable = jTextFieldValorCampoGeneralValorRubroVariable; } public void setBorderResaltarValorCampoGeneralValorRubroVariable() { Border borderResaltar=Funciones2.getBorderResaltar(this.getParametroGeneralUsuario(),"PARAMETRO"); this.jTtoolBarValorRubroVariable.setBorder(borderResaltar); this.jTextFieldValorCampoGeneralValorRubroVariable .setBorder(borderResaltar); } public JCheckBox getjCheckBoxSeleccionarTodosValorRubroVariable() { return this.jCheckBoxSeleccionarTodosValorRubroVariable; } public void setjCheckBoxSeleccionarTodosValorRubroVariable( JCheckBox jCheckBoxSeleccionarTodosValorRubroVariable) { this.jCheckBoxSeleccionarTodosValorRubroVariable = jCheckBoxSeleccionarTodosValorRubroVariable; } public void setBorderResaltarSeleccionarTodosValorRubroVariable() { Border borderResaltar=Funciones2.getBorderResaltar(this.getParametroGeneralUsuario(),"PARAMETRO"); this.jTtoolBarValorRubroVariable.setBorder(borderResaltar); this.jCheckBoxSeleccionarTodosValorRubroVariable .setBorder(borderResaltar); } public JCheckBox getjCheckBoxSeleccionadosValorRubroVariable() { return this.jCheckBoxSeleccionadosValorRubroVariable; } public void setjCheckBoxSeleccionadosValorRubroVariable( JCheckBox jCheckBoxSeleccionadosValorRubroVariable) { this.jCheckBoxSeleccionadosValorRubroVariable = jCheckBoxSeleccionadosValorRubroVariable; } public void setBorderResaltarSeleccionadosValorRubroVariable() { Border borderResaltar=Funciones2.getBorderResaltar(this.getParametroGeneralUsuario(),"PARAMETRO"); this.jTtoolBarValorRubroVariable.setBorder(borderResaltar); this.jCheckBoxSeleccionadosValorRubroVariable .setBorder(borderResaltar); } @SuppressWarnings("rawtypes") public JComboBox getjComboBoxTiposArchivosReportesValorRubroVariable() { return this.jComboBoxTiposArchivosReportesValorRubroVariable; } @SuppressWarnings("rawtypes") public void setjComboBoxTiposArchivosReportesValorRubroVariable( JComboBox jComboBoxTiposArchivosReportesValorRubroVariable) { this.jComboBoxTiposArchivosReportesValorRubroVariable = jComboBoxTiposArchivosReportesValorRubroVariable; } public void setBorderResaltarTiposArchivosReportesValorRubroVariable() { Border borderResaltar=Funciones2.getBorderResaltar(this.getParametroGeneralUsuario(),"PARAMETRO"); this.jTtoolBarValorRubroVariable.setBorder(borderResaltar); this.jComboBoxTiposArchivosReportesValorRubroVariable .setBorder(borderResaltar); } @SuppressWarnings("rawtypes") public JComboBox getjComboBoxTiposReportesValorRubroVariable() { return this.jComboBoxTiposReportesValorRubroVariable; } @SuppressWarnings("rawtypes") public void setjComboBoxTiposReportesValorRubroVariable( JComboBox jComboBoxTiposReportesValorRubroVariable) { this.jComboBoxTiposReportesValorRubroVariable = jComboBoxTiposReportesValorRubroVariable; } //@SuppressWarnings("rawtypes") //public JComboBox getjComboBoxTiposReportesDinamicoValorRubroVariable() { // return jComboBoxTiposReportesDinamicoValorRubroVariable; //} //@SuppressWarnings("rawtypes") //public void setjComboBoxTiposReportesDinamicoValorRubroVariable( // JComboBox jComboBoxTiposReportesDinamicoValorRubroVariable) { // this.jComboBoxTiposReportesDinamicoValorRubroVariable = jComboBoxTiposReportesDinamicoValorRubroVariable; //} //@SuppressWarnings("rawtypes") //public JComboBox getjComboBoxTiposArchivosReportesDinamicoValorRubroVariable() { // return jComboBoxTiposArchivosReportesDinamicoValorRubroVariable; //} //@SuppressWarnings("rawtypes") //public void setjComboBoxTiposArchivosReportesDinamicoValorRubroVariable( // JComboBox jComboBoxTiposArchivosReportesDinamicoValorRubroVariable) { // this.jComboBoxTiposArchivosReportesDinamicoValorRubroVariable = jComboBoxTiposArchivosReportesDinamicoValorRubroVariable; //} public void setBorderResaltarTiposReportesValorRubroVariable() { Border borderResaltar=Funciones2.getBorderResaltar(this.getParametroGeneralUsuario(),"PARAMETRO"); this.jTtoolBarValorRubroVariable.setBorder(borderResaltar); this.jComboBoxTiposReportesValorRubroVariable .setBorder(borderResaltar); } @SuppressWarnings("rawtypes") public JComboBox getjComboBoxTiposGraficosReportesValorRubroVariable() { return this.jComboBoxTiposGraficosReportesValorRubroVariable; } @SuppressWarnings("rawtypes") public void setjComboBoxTiposGraficosReportesValorRubroVariable( JComboBox jComboBoxTiposGraficosReportesValorRubroVariable) { this.jComboBoxTiposGraficosReportesValorRubroVariable = jComboBoxTiposGraficosReportesValorRubroVariable; } public void setBorderResaltarTiposGraficosReportesValorRubroVariable() { Border borderResaltar=Funciones2.getBorderResaltar(this.getParametroGeneralUsuario(),"PARAMETRO"); this.jTtoolBarValorRubroVariable.setBorder(borderResaltar); this.jComboBoxTiposGraficosReportesValorRubroVariable .setBorder(borderResaltar); } @SuppressWarnings("rawtypes") public JComboBox getjComboBoxTiposPaginacionValorRubroVariable() { return this.jComboBoxTiposPaginacionValorRubroVariable; } @SuppressWarnings("rawtypes") public void setjComboBoxTiposPaginacionValorRubroVariable( JComboBox jComboBoxTiposPaginacionValorRubroVariable) { this.jComboBoxTiposPaginacionValorRubroVariable = jComboBoxTiposPaginacionValorRubroVariable; } public void setBorderResaltarTiposPaginacionValorRubroVariable() { Border borderResaltar=Funciones2.getBorderResaltar(this.getParametroGeneralUsuario(),"PARAMETRO"); this.jTtoolBarValorRubroVariable.setBorder(borderResaltar); this.jComboBoxTiposPaginacionValorRubroVariable .setBorder(borderResaltar); } @SuppressWarnings("rawtypes") public JComboBox getjComboBoxTiposRelacionesValorRubroVariable() { return this.jComboBoxTiposRelacionesValorRubroVariable; } @SuppressWarnings("rawtypes") public JComboBox getjComboBoxTiposAccionesValorRubroVariable() { return this.jComboBoxTiposAccionesValorRubroVariable; } @SuppressWarnings("rawtypes") public void setjComboBoxTiposRelacionesValorRubroVariable( JComboBox jComboBoxTiposRelacionesValorRubroVariable) { this.jComboBoxTiposRelacionesValorRubroVariable = jComboBoxTiposRelacionesValorRubroVariable; } @SuppressWarnings("rawtypes") public void setjComboBoxTiposAccionesValorRubroVariable( JComboBox jComboBoxTiposAccionesValorRubroVariable) { this.jComboBoxTiposAccionesValorRubroVariable = jComboBoxTiposAccionesValorRubroVariable; } public void setBorderResaltarTiposRelacionesValorRubroVariable() { Border borderResaltar=Funciones2.getBorderResaltar(this.getParametroGeneralUsuario(),"PARAMETRO"); this.jTtoolBarValorRubroVariable.setBorder(borderResaltar); this.jComboBoxTiposRelacionesValorRubroVariable .setBorder(borderResaltar); } public void setBorderResaltarTiposAccionesValorRubroVariable() { Border borderResaltar=Funciones2.getBorderResaltar(this.getParametroGeneralUsuario(),"PARAMETRO"); this.jTtoolBarValorRubroVariable.setBorder(borderResaltar); this.jComboBoxTiposAccionesValorRubroVariable .setBorder(borderResaltar); } //public JCheckBox getjCheckBoxConGraficoDinamicoValorRubroVariable() { // return jCheckBoxConGraficoDinamicoValorRubroVariable; //} //public void setjCheckBoxConGraficoDinamicoValorRubroVariable( // JCheckBox jCheckBoxConGraficoDinamicoValorRubroVariable) { // this.jCheckBoxConGraficoDinamicoValorRubroVariable = jCheckBoxConGraficoDinamicoValorRubroVariable; //} //public void setBorderResaltarConGraficoDinamicoValorRubroVariable() { // Border borderResaltar=Funciones2.getBorderResaltar(this.getParametroGeneralUsuario(),"PARAMETRO"); // this.jTtoolBarValorRubroVariable.setBorder(borderResaltar); // this.jCheckBoxConGraficoDinamicoValorRubroVariable .setBorder(borderResaltar); //} /* public JDesktopPane getJDesktopPane() { return jDesktopPane; } public void setJDesktopPane(JDesktopPane desktopPane) { jDesktopPane = desktopPane; } */ private void initialize(JDesktopPane jdesktopPane,Boolean conGuardarRelaciones,Boolean esGuardarRelacionado,Boolean cargarRelaciones,Usuario usuarioActual,ResumenUsuario resumenUsuarioActual,Modulo moduloActual,Opcion opcionActual,ParametroGeneralSg parametroGeneralSg,ParametroGeneralUsuario parametroGeneralUsuario,PaginaTipo paginaTipo) throws Exception { this.valorrubrovariableSessionBean=new ValorRubroVariableSessionBean(); this.valorrubrovariableSessionBean.setConGuardarRelaciones(conGuardarRelaciones); this.valorrubrovariableSessionBean.setEsGuardarRelacionado(esGuardarRelacionado); this.conCargarMinimo=this.valorrubrovariableSessionBean.getEsGuardarRelacionado(); this.cargarRelaciones=cargarRelaciones; if(!this.conCargarMinimo) { } //this.sTipoTamanioGeneral=ValorRubroVariableJInternalFrame.STIPO_TAMANIO_GENERAL; //this.sTipoTamanioGeneralTabla=ValorRubroVariableJInternalFrame.STIPO_TAMANIO_GENERAL_TABLA; this.sTipoTamanioGeneral=FuncionesSwing.getTipoTamanioGeneral(this,parametroGeneralUsuario,conGuardarRelaciones,esGuardarRelacionado); this.sTipoTamanioGeneralTabla=FuncionesSwing.getTipoTamanioGeneralTabla(this,parametroGeneralUsuario,conGuardarRelaciones,esGuardarRelacionado); this.conTipoTamanioManual=FuncionesSwing.getConTipoTamanioManual(this,parametroGeneralUsuario,conGuardarRelaciones,esGuardarRelacionado); this.conTipoTamanioTodo=FuncionesSwing.getConTipoTamanioTodo(this,parametroGeneralUsuario,conGuardarRelaciones,esGuardarRelacionado); ValorRubroVariableJInternalFrame.STIPO_TAMANIO_GENERAL=this.sTipoTamanioGeneral; ValorRubroVariableJInternalFrame.STIPO_TAMANIO_GENERAL_TABLA=this.sTipoTamanioGeneralTabla; ValorRubroVariableJInternalFrame.CONTIPO_TAMANIO_MANUAL=this.conTipoTamanioManual; Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int iWidth=(screenSize.width-screenSize.width/Constantes.ISWING_RESTOPARTE_DIFERENCIA_ANCHO); int iHeight=(screenSize.height-screenSize.height/Constantes.ISWING_RESTOPARTE_DIFERENCIA_ALTO); //this.setTitle(Funciones.GetTituloSistema(this.parametroGeneralSg,this.moduloActual,this.opcionActual,this.usuarioActual,"Valor Rubro Variable MANTENIMIENTO")); if(iWidth > 650) { iWidth=650; } if(iHeight > 660) { iHeight=660; } this.setSize(iWidth,iHeight); this.setFrameIcon(new ImageIcon(FuncionesSwing.getImagenBackground(Constantes2.S_ICON_IMAGE))); this.setContentPane(this.getJContentPane(iWidth,iHeight,jdesktopPane,cargarRelaciones,usuarioActual,resumenUsuarioActual,moduloActual,opcionActual,parametroGeneralSg,parametroGeneralUsuario,paginaTipo)); if(!this.valorrubrovariableSessionBean.getEsGuardarRelacionado()) { this.setResizable(true); this.setClosable(true); this.setMaximizable(true); this.iconable=true; setLocation(xOffset*openFrameCount, yOffset*openFrameCount); if(Constantes.CON_VARIAS_VENTANAS) { openFrameCount++; if(openFrameCount==Constantes.INUM_MAX_VENTANAS) { openFrameCount=0; } } } ValorRubroVariableJInternalFrame.ESTA_CARGADO_PORPARTE=true; //super("ValorRubroVariable No " + (++openFrameCount),true, /*resizable*/true, /*closable*/true, /*maximizable*/true);//iconifiable //SwingUtilities.updateComponentTreeUI(this); } public void inicializarToolBar() { this.jTtoolBarValorRubroVariable= new JToolBar("MENU PRINCIPAL"); //TOOLBAR //PRINCIPAL this.jButtonNuevoToolBarValorRubroVariable=FuncionesSwing.getButtonToolBarGeneral(this.jButtonNuevoToolBarValorRubroVariable,this.jTtoolBarValorRubroVariable, "nuevo","nuevo","Nuevo"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO + FuncionesSwing.getKeyMensaje("NUEVO"),"Nuevo",false); this.jButtonNuevoGuardarCambiosToolBarValorRubroVariable=FuncionesSwing.getButtonToolBarGeneral(this.jButtonNuevoGuardarCambiosToolBarValorRubroVariable,this.jTtoolBarValorRubroVariable, "nuevoguardarcambios","nuevoguardarcambios","Nuevo" + FuncionesSwing.getKeyMensaje("NUEVO_TABLA"),"Nuevo",false); this.jButtonGuardarCambiosTablaToolBarValorRubroVariable=FuncionesSwing.getButtonToolBarGeneral(this.jButtonGuardarCambiosTablaToolBarValorRubroVariable,this.jTtoolBarValorRubroVariable, "guardarcambiostabla","guardarcambiostabla","Guardar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO + FuncionesSwing.getKeyMensaje("GUARDAR_CAMBIOS"),"Guardar",false); this.jButtonDuplicarToolBarValorRubroVariable=FuncionesSwing.getButtonToolBarGeneral(this.jButtonDuplicarToolBarValorRubroVariable,this.jTtoolBarValorRubroVariable, "duplicar","duplicar","Duplicar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO + FuncionesSwing.getKeyMensaje("DUPLICAR"),"Duplicar",false); this.jButtonCopiarToolBarValorRubroVariable=FuncionesSwing.getButtonToolBarGeneral(this.jButtonCopiarToolBarValorRubroVariable,this.jTtoolBarValorRubroVariable, "copiar","copiar","Copiar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO + FuncionesSwing.getKeyMensaje("COPIAR"),"Copiar",false); this.jButtonVerFormToolBarValorRubroVariable=FuncionesSwing.getButtonToolBarGeneral(this.jButtonVerFormToolBarValorRubroVariable,this.jTtoolBarValorRubroVariable, "ver_form","ver_form","Ver"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO + FuncionesSwing.getKeyMensaje("VER_FORM"),"Ver",false); this.jButtonRecargarInformacionToolBarValorRubroVariable=FuncionesSwing.getButtonToolBarGeneral(this.jButtonRecargarInformacionToolBarValorRubroVariable,this.jTtoolBarValorRubroVariable, "recargar","recargar","Recargar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO + FuncionesSwing.getKeyMensaje("RECARGAR"),"Recargar",false); this.jButtonAnterioresToolBarValorRubroVariable=FuncionesSwing.getButtonToolBarGeneral(this.jButtonRecargarInformacionToolBarValorRubroVariable,this.jTtoolBarValorRubroVariable, "anteriores","anteriores","Anteriores Datos" + FuncionesSwing.getKeyMensaje("ANTERIORES"),"<<",false); this.jButtonSiguientesToolBarValorRubroVariable=FuncionesSwing.getButtonToolBarGeneral(this.jButtonRecargarInformacionToolBarValorRubroVariable,this.jTtoolBarValorRubroVariable, "siguientes","siguientes","Siguientes Datos" + FuncionesSwing.getKeyMensaje("SIGUIENTES"),">>",false); this.jButtonAbrirOrderByToolBarValorRubroVariable=FuncionesSwing.getButtonToolBarGeneral(this.jButtonAbrirOrderByToolBarValorRubroVariable,this.jTtoolBarValorRubroVariable, "orden","orden","Orden" + FuncionesSwing.getKeyMensaje("ORDEN"),"Orden",false); this.jButtonNuevoRelacionesToolBarValorRubroVariable=FuncionesSwing.getButtonToolBarGeneral(this.jButtonNuevoRelacionesToolBarValorRubroVariable,this.jTtoolBarValorRubroVariable, "nuevo_relaciones","nuevo_relaciones","NUEVO RELACIONES" + FuncionesSwing.getKeyMensaje("NUEVO_RELACIONES"),"NUEVO RELACIONES",false); this.jButtonMostrarOcultarTablaToolBarValorRubroVariable=FuncionesSwing.getButtonToolBarGeneral(this.jButtonMostrarOcultarTablaToolBarValorRubroVariable,this.jTtoolBarValorRubroVariable, "mostrar_ocultar","mostrar_ocultar","Mostrar Ocultar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO + FuncionesSwing.getKeyMensaje("MOSTRAR_OCULTAR"),"Mostrar Ocultar",false); this.jButtonCerrarToolBarValorRubroVariable=FuncionesSwing.getButtonToolBarGeneral(this.jButtonCerrarToolBarValorRubroVariable,this.jTtoolBarValorRubroVariable, "cerrar","cerrar","Salir"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO + FuncionesSwing.getKeyMensaje("CERRAR"),"Salir",false); //this.jButtonNuevoRelacionesToolBarValorRubroVariable=new JButtonMe(); //protected JButton jButtonNuevoRelacionesToolBarValorRubroVariable; this.jButtonProcesarInformacionToolBarValorRubroVariable=new JButtonMe(); //protected JButton jButtonProcesarInformacionToolBarValorRubroVariable; //protected JButton jButtonModificarToolBarValorRubroVariable; //PRINCIPAL //DETALLE //DETALLE_FIN } public void cargarMenus() { this.jmenuBarValorRubroVariable=new JMenuBarMe(); //PRINCIPAL this.jmenuValorRubroVariable=new JMenuMe("General"); this.jmenuArchivoValorRubroVariable=new JMenuMe("Archivo"); this.jmenuAccionesValorRubroVariable=new JMenuMe("Acciones"); this.jmenuDatosValorRubroVariable=new JMenuMe("Datos"); //PRINCIPAL_FIN //DETALLE //DETALLE_FIN this.jMenuItemNuevoValorRubroVariable= new JMenuItem("Nuevo" + FuncionesSwing.getKeyMensaje("NUEVO")); this.jMenuItemNuevoValorRubroVariable.setActionCommand("Nuevo"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemNuevoValorRubroVariable,"nuevo_button","Nuevo"); FuncionesSwing.setBoldMenuItem(this.jMenuItemNuevoValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemDuplicarValorRubroVariable= new JMenuItem("Duplicar" + FuncionesSwing.getKeyMensaje("DUPLICAR")); this.jMenuItemDuplicarValorRubroVariable.setActionCommand("Duplicar"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemDuplicarValorRubroVariable,"duplicar_button","Duplicar"); FuncionesSwing.setBoldMenuItem(this.jMenuItemDuplicarValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemNuevoRelacionesValorRubroVariable= new JMenuItem("Nuevo Rel" + FuncionesSwing.getKeyMensaje("NUEVO_TABLA")); this.jMenuItemNuevoRelacionesValorRubroVariable.setActionCommand("Nuevo Rel"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemNuevoRelacionesValorRubroVariable,"nuevorelaciones_button","Nuevo Rel"); FuncionesSwing.setBoldMenuItem(this.jMenuItemNuevoRelacionesValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemGuardarCambiosValorRubroVariable= new JMenuItem("Guardar" + FuncionesSwing.getKeyMensaje("GUARDAR_CAMBIOS")); this.jMenuItemGuardarCambiosValorRubroVariable.setActionCommand("Guardar"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemGuardarCambiosValorRubroVariable,"guardarcambios_button","Guardar"); FuncionesSwing.setBoldMenuItem(this.jMenuItemGuardarCambiosValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemCopiarValorRubroVariable= new JMenuItem("Copiar" + FuncionesSwing.getKeyMensaje("COPIAR")); this.jMenuItemCopiarValorRubroVariable.setActionCommand("Copiar"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemCopiarValorRubroVariable,"copiar_button","Copiar"); FuncionesSwing.setBoldMenuItem(this.jMenuItemCopiarValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemVerFormValorRubroVariable= new JMenuItem("Ver" + FuncionesSwing.getKeyMensaje("VER_FORM")); this.jMenuItemVerFormValorRubroVariable.setActionCommand("Ver"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemVerFormValorRubroVariable,"ver_form_button","Ver"); FuncionesSwing.setBoldMenuItem(this.jMenuItemVerFormValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemGuardarCambiosTablaValorRubroVariable= new JMenuItem("Guardar Tabla" + FuncionesSwing.getKeyMensaje("GUARDAR_CAMBIOS")); this.jMenuItemGuardarCambiosTablaValorRubroVariable.setActionCommand("Guardar Tabla"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemGuardarCambiosTablaValorRubroVariable,"guardarcambiostabla_button","Guardar Tabla"); FuncionesSwing.setBoldMenuItem(this.jMenuItemGuardarCambiosTablaValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemCerrarValorRubroVariable= new JMenuItem("Salir" + FuncionesSwing.getKeyMensaje("CERRAR")); this.jMenuItemCerrarValorRubroVariable.setActionCommand("Cerrar"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemCerrarValorRubroVariable,"cerrar_button","Salir"); FuncionesSwing.setBoldMenuItem(this.jMenuItemCerrarValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemRecargarInformacionValorRubroVariable= new JMenuItem("Recargar" + FuncionesSwing.getKeyMensaje("RECARGAR")); this.jMenuItemRecargarInformacionValorRubroVariable.setActionCommand("Recargar"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemRecargarInformacionValorRubroVariable,"recargar_button","Recargar"); FuncionesSwing.setBoldMenuItem(this.jMenuItemRecargarInformacionValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemProcesarInformacionValorRubroVariable= new JMenuItem("Procesar Informacion"); this.jMenuItemProcesarInformacionValorRubroVariable.setActionCommand("Procesar Informacion"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemProcesarInformacionValorRubroVariable,"procesar_button","Procesar Informacion"); this.jMenuItemAnterioresValorRubroVariable= new JMenuItem("Anteriores" + FuncionesSwing.getKeyMensaje("ANTERIORES")); this.jMenuItemAnterioresValorRubroVariable.setActionCommand("Anteriores"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemAnterioresValorRubroVariable,"anteriores_button","Anteriores"); FuncionesSwing.setBoldMenuItem(this.jMenuItemAnterioresValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemSiguientesValorRubroVariable= new JMenuItem("Siguientes" + FuncionesSwing.getKeyMensaje("SIGUIENTES")); this.jMenuItemSiguientesValorRubroVariable.setActionCommand("Siguientes"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemSiguientesValorRubroVariable,"siguientes_button","Siguientes"); FuncionesSwing.setBoldMenuItem(this.jMenuItemSiguientesValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemAbrirOrderByValorRubroVariable= new JMenuItem("Orden" + FuncionesSwing.getKeyMensaje("ORDEN")); this.jMenuItemAbrirOrderByValorRubroVariable.setActionCommand("Orden"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemAbrirOrderByValorRubroVariable,"orden_button","Orden"); FuncionesSwing.setBoldMenuItem(this.jMenuItemAbrirOrderByValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemMostrarOcultarValorRubroVariable= new JMenuItem("Mostrar Ocultar" + FuncionesSwing.getKeyMensaje("MOSTRAR_OCULTAR")); this.jMenuItemMostrarOcultarValorRubroVariable.setActionCommand("Mostrar Ocultar"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemMostrarOcultarValorRubroVariable,"mostrar_ocultar_button","Mostrar Ocultar"); FuncionesSwing.setBoldMenuItem(this.jMenuItemMostrarOcultarValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemDetalleAbrirOrderByValorRubroVariable= new JMenuItem("Orden" + FuncionesSwing.getKeyMensaje("ORDEN")); this.jMenuItemDetalleAbrirOrderByValorRubroVariable.setActionCommand("Orden"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemDetalleAbrirOrderByValorRubroVariable,"orden_button","Orden"); FuncionesSwing.setBoldMenuItem(this.jMenuItemDetalleAbrirOrderByValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemDetalleMostarOcultarValorRubroVariable= new JMenuItem("Mostrar Ocultar" + FuncionesSwing.getKeyMensaje("MOSTRAR_OCULTAR")); this.jMenuItemDetalleMostarOcultarValorRubroVariable.setActionCommand("Mostrar Ocultar"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemDetalleMostarOcultarValorRubroVariable,"mostrar_ocultar_button","Mostrar Ocultar"); FuncionesSwing.setBoldMenuItem(this.jMenuItemDetalleMostarOcultarValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jMenuItemNuevoGuardarCambiosValorRubroVariable= new JMenuItem("Nuevo Tabla" + FuncionesSwing.getKeyMensaje("NUEVO_TABLA")); this.jMenuItemNuevoGuardarCambiosValorRubroVariable.setActionCommand("Nuevo Tabla"); FuncionesSwing.addImagenMenuItemGeneral(this.jMenuItemNuevoGuardarCambiosValorRubroVariable,"nuevoguardarcambios_button","Nuevo"); FuncionesSwing.setBoldMenuItem(this.jMenuItemNuevoGuardarCambiosValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); //PRINCIPAL if(!this.conCargarMinimo) { this.jmenuArchivoValorRubroVariable.add(this.jMenuItemCerrarValorRubroVariable); this.jmenuAccionesValorRubroVariable.add(this.jMenuItemNuevoValorRubroVariable); this.jmenuAccionesValorRubroVariable.add(this.jMenuItemNuevoGuardarCambiosValorRubroVariable); this.jmenuAccionesValorRubroVariable.add(this.jMenuItemNuevoRelacionesValorRubroVariable); this.jmenuAccionesValorRubroVariable.add(this.jMenuItemGuardarCambiosTablaValorRubroVariable); this.jmenuAccionesValorRubroVariable.add(this.jMenuItemDuplicarValorRubroVariable); this.jmenuAccionesValorRubroVariable.add(this.jMenuItemCopiarValorRubroVariable); this.jmenuAccionesValorRubroVariable.add(this.jMenuItemVerFormValorRubroVariable); this.jmenuDatosValorRubroVariable.add(this.jMenuItemRecargarInformacionValorRubroVariable); this.jmenuDatosValorRubroVariable.add(this.jMenuItemAnterioresValorRubroVariable); this.jmenuDatosValorRubroVariable.add(this.jMenuItemSiguientesValorRubroVariable); this.jmenuDatosValorRubroVariable.add(this.jMenuItemAbrirOrderByValorRubroVariable); this.jmenuDatosValorRubroVariable.add(this.jMenuItemMostrarOcultarValorRubroVariable); } //PRINCIPAL_FIN //DETALLE //this.jmenuDetalleAccionesValorRubroVariable.add(this.jMenuItemGuardarCambiosValorRubroVariable); //DETALLE_FIN //RELACIONES //RELACIONES //PRINCIPAL if(!this.conCargarMinimo) { FuncionesSwing.setBoldMenu(this.jmenuArchivoValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); FuncionesSwing.setBoldMenu(this.jmenuAccionesValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); FuncionesSwing.setBoldMenu(this.jmenuDatosValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jmenuBarValorRubroVariable.add(this.jmenuArchivoValorRubroVariable); this.jmenuBarValorRubroVariable.add(this.jmenuAccionesValorRubroVariable); this.jmenuBarValorRubroVariable.add(this.jmenuDatosValorRubroVariable); } //PRINCIPAL_FIN //DETALLE //DETALLE_FIN //AGREGA MENU A PANTALLA if(!this.conCargarMinimo) { this.setJMenuBar(this.jmenuBarValorRubroVariable); } //AGREGA MENU DETALLE A PANTALLA } public void inicializarElementosBusquedasValorRubroVariable() { //BYDAN_BUSQUEDAS //INDICES BUSQUEDA this.jPanelFK_IdEmpleadoValorRubroVariable=new JPanelMe("fondo_formulario",true);//new JPanel(); this.jPanelFK_IdEmpleadoValorRubroVariable.setToolTipText("Buscar Por Empleado "); this.jButtonFK_IdEmpleadoValorRubroVariable= new JButtonMe(); this.jButtonFK_IdEmpleadoValorRubroVariable.setText("Buscar"); this.jButtonFK_IdEmpleadoValorRubroVariable.setToolTipText("Buscar Por Empleado "); FuncionesSwing.addImagenButtonGeneral(this.jButtonFK_IdEmpleadoValorRubroVariable,"buscar_button","Buscar Por Empleado "); FuncionesSwing.setBoldButton(this.jButtonFK_IdEmpleadoValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; jLabelid_empleadoFK_IdEmpleadoValorRubroVariable = new JLabelMe(); jLabelid_empleadoFK_IdEmpleadoValorRubroVariable.setText("Empleado :"); jLabelid_empleadoFK_IdEmpleadoValorRubroVariable.setToolTipText("Empleado"); jLabelid_empleadoFK_IdEmpleadoValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL_LABEL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL_LABEL,-39),Constantes2.ISWING_ALTO_CONTROL_LABEL)); jLabelid_empleadoFK_IdEmpleadoValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL_LABEL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL_LABEL,-39),Constantes2.ISWING_ALTO_CONTROL_LABEL)); jLabelid_empleadoFK_IdEmpleadoValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL_LABEL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL_LABEL,-39),Constantes2.ISWING_ALTO_CONTROL_LABEL)); FuncionesSwing.setBoldLabel(jLabelid_empleadoFK_IdEmpleadoValorRubroVariable,STIPO_TAMANIO_GENERAL,false,true,this); jComboBoxid_empleadoFK_IdEmpleadoValorRubroVariable= new JComboBoxMe(); jComboBoxid_empleadoFK_IdEmpleadoValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,100),Constantes.ISWING_ALTO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ALTO_CONTROL,0))); jComboBoxid_empleadoFK_IdEmpleadoValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,100),Constantes.ISWING_ALTO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ALTO_CONTROL,0))); jComboBoxid_empleadoFK_IdEmpleadoValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,100),Constantes.ISWING_ALTO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ALTO_CONTROL,0))); FuncionesSwing.setBoldComboBox(jComboBoxid_empleadoFK_IdEmpleadoValorRubroVariable,STIPO_TAMANIO_GENERAL,false,true,this); this.jPanelFK_IdRubroEmpleaValorRubroVariable=new JPanelMe("fondo_formulario",true);//new JPanel(); this.jPanelFK_IdRubroEmpleaValorRubroVariable.setToolTipText("Buscar Por Rubro Emplea "); this.jButtonFK_IdRubroEmpleaValorRubroVariable= new JButtonMe(); this.jButtonFK_IdRubroEmpleaValorRubroVariable.setText("Buscar"); this.jButtonFK_IdRubroEmpleaValorRubroVariable.setToolTipText("Buscar Por Rubro Emplea "); FuncionesSwing.addImagenButtonGeneral(this.jButtonFK_IdRubroEmpleaValorRubroVariable,"buscar_button","Buscar Por Rubro Emplea "); FuncionesSwing.setBoldButton(this.jButtonFK_IdRubroEmpleaValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; jLabelid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable = new JLabelMe(); jLabelid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable.setText("Rubro Emplea :"); jLabelid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable.setToolTipText("Rubro Emplea"); jLabelid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL_LABEL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL_LABEL,-39),Constantes2.ISWING_ALTO_CONTROL_LABEL)); jLabelid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL_LABEL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL_LABEL,-39),Constantes2.ISWING_ALTO_CONTROL_LABEL)); jLabelid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL_LABEL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL_LABEL,-39),Constantes2.ISWING_ALTO_CONTROL_LABEL)); FuncionesSwing.setBoldLabel(jLabelid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable,STIPO_TAMANIO_GENERAL,false,true,this); jComboBoxid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable= new JComboBoxMe(); jComboBoxid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0),Constantes.ISWING_ALTO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ALTO_CONTROL,0))); jComboBoxid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0),Constantes.ISWING_ALTO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ALTO_CONTROL,0))); jComboBoxid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0),Constantes.ISWING_ALTO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ALTO_CONTROL,0))); FuncionesSwing.setBoldComboBox(jComboBoxid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable,STIPO_TAMANIO_GENERAL,false,true,this); this.jTabbedPaneBusquedasValorRubroVariable=new JTabbedPane(); this.jTabbedPaneBusquedasValorRubroVariable.setMinimumSize(new Dimension(this.getWidth(),Constantes.ISWING_ALTO_TABPANE_BUSQUEDA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ALTO_TABPANE_BUSQUEDA,25))); this.jTabbedPaneBusquedasValorRubroVariable.setMaximumSize(new Dimension(this.getWidth(),Constantes.ISWING_ALTO_TABPANE_BUSQUEDA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ALTO_TABPANE_BUSQUEDA,25))); this.jTabbedPaneBusquedasValorRubroVariable.setPreferredSize(new Dimension(this.getWidth(),Constantes.ISWING_ALTO_TABPANE_BUSQUEDA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ALTO_TABPANE_BUSQUEDA,25))); //this.jTabbedPaneBusquedasValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("Busqueda")); this.jTabbedPaneBusquedasValorRubroVariable.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); FuncionesSwing.setBoldTabbedPane(this.jTabbedPaneBusquedasValorRubroVariable,STIPO_TAMANIO_GENERAL,false,true,this); //INDICES BUSQUEDA_FIN } //JPanel //@SuppressWarnings({"unchecked" })//"rawtypes" public JScrollPane getJContentPane(int iWidth,int iHeight,JDesktopPane jDesktopPane,Boolean cargarRelaciones,Usuario usuarioActual,ResumenUsuario resumenUsuarioActual,Modulo moduloActual,Opcion opcionActual,ParametroGeneralSg parametroGeneralSg,ParametroGeneralUsuario parametroGeneralUsuario,PaginaTipo paginaTipo) throws Exception { //PARA TABLA PARAMETROS String sKeyStrokeName=""; KeyStroke keyStrokeControl=null; this.jContentPane = new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true);//new JPanel(); this.usuarioActual=usuarioActual; this.resumenUsuarioActual=resumenUsuarioActual; this.opcionActual=opcionActual; this.moduloActual=moduloActual; this.parametroGeneralSg=parametroGeneralSg; this.parametroGeneralUsuario=parametroGeneralUsuario; this.jDesktopPane=jDesktopPane; this.conFuncionalidadRelaciones=parametroGeneralUsuario.getcon_guardar_relaciones(); int iGridyPrincipal=0; this.inicializarToolBar(); //CARGAR MENUS if(this.conCargarFormDetalle) { //true) { //this.jInternalFrameDetalleValorRubroVariable = new ValorRubroVariableDetalleJInternalFrame(paginaTipo);//JInternalFrameBase("Valor Rubro Variable DATOS"); this.jInternalFrameDetalleFormValorRubroVariable = new ValorRubroVariableDetalleFormJInternalFrame(jDesktopPane,this.valorrubrovariableSessionBean.getConGuardarRelaciones(),this.valorrubrovariableSessionBean.getEsGuardarRelacionado(),cargarRelaciones,usuarioActual,resumenUsuarioActual,moduloActual,opcionActual,parametroGeneralSg,parametroGeneralUsuario,paginaTipo); } else { this.jInternalFrameDetalleFormValorRubroVariable = null;//new ValorRubroVariableDetalleFormJInternalFrame("MINIMO"); } this.cargarMenus(); this.gridaBagLayoutValorRubroVariable= new GridBagLayout(); this.jTableDatosValorRubroVariable = new JTableMe(); String sToolTipValorRubroVariable=""; sToolTipValorRubroVariable=ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO; if(Constantes.ISDEVELOPING) { sToolTipValorRubroVariable+="(Nomina.ValorRubroVariable)"; } if(!this.valorrubrovariableSessionBean.getEsGuardarRelacionado()) { sToolTipValorRubroVariable+="_"+this.opcionActual.getId(); } this.jTableDatosValorRubroVariable.setToolTipText(sToolTipValorRubroVariable); //SE DEFINE EN DETALLE //FuncionesSwing.setBoldLabelTable(this.jTableDatosValorRubroVariable); this.jTableDatosValorRubroVariable.setAutoCreateRowSorter(true); this.jTableDatosValorRubroVariable.setRowHeight(Constantes.ISWING_ALTO_FILA_TABLA + Constantes.ISWING_ALTO_FILA_TABLA_EXTRA_FECHA); //MULTIPLE SELECTION this.jTableDatosValorRubroVariable.setRowSelectionAllowed(true); this.jTableDatosValorRubroVariable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); FuncionesSwing.setBoldTable(jTableDatosValorRubroVariable,STIPO_TAMANIO_GENERAL,false,true,this); this.jButtonNuevoValorRubroVariable = new JButtonMe(); this.jButtonDuplicarValorRubroVariable = new JButtonMe(); this.jButtonCopiarValorRubroVariable = new JButtonMe(); this.jButtonVerFormValorRubroVariable = new JButtonMe(); this.jButtonNuevoRelacionesValorRubroVariable = new JButtonMe(); this.jButtonGuardarCambiosTablaValorRubroVariable = new JButtonMe(); this.jButtonCerrarValorRubroVariable = new JButtonMe(); this.jScrollPanelDatosValorRubroVariable = new JScrollPane(); this.jScrollPanelDatosGeneralValorRubroVariable = new JScrollPane(); this.jPanelAccionesValorRubroVariable = new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true); //if(!this.conCargarMinimo) { ; //} this.sPath=" <---> Acceso: Valor Rubro Variable"; if(!this.valorrubrovariableSessionBean.getEsGuardarRelacionado()) { this.jScrollPanelDatosValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos Valor Rubro Variables" + this.sPath)); } else { this.jScrollPanelDatosValorRubroVariable.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); } this.jScrollPanelDatosGeneralValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("Edicion Datos")); this.jPanelAccionesValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("Acciones")); this.jPanelAccionesValorRubroVariable.setToolTipText("Acciones"); this.jPanelAccionesValorRubroVariable.setName("Acciones"); FuncionesSwing.setBoldScrollPanel(this.jScrollPanelDatosGeneralValorRubroVariable, STIPO_TAMANIO_GENERAL,false,false,this); FuncionesSwing.setBoldScrollPanel(this.jScrollPanelDatosValorRubroVariable, STIPO_TAMANIO_GENERAL,false,false,this); //if(!this.conCargarMinimo) { ; //} //ELEMENTOS TABLAS PARAMETOS if(!this.conCargarMinimo) { } //ELEMENTOS TABLAS PARAMETOS_FIN if(!this.conCargarMinimo) { //REPORTE DINAMICO //NO CARGAR INICIALMENTE, EN BOTON AL ABRIR //this.jInternalFrameReporteDinamicoValorRubroVariable=new ReporteDinamicoJInternalFrame(ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO,this); //this.cargarReporteDinamicoValorRubroVariable(); //IMPORTACION //NO CARGAR INICIALMENTE, EN BOTON AL ABRIR //this.jInternalFrameImportacionValorRubroVariable=new ImportacionJInternalFrame(ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO,this); //this.cargarImportacionValorRubroVariable(); } String sMapKey = ""; InputMap inputMap =null; this.jButtonAbrirOrderByValorRubroVariable = new JButtonMe(); this.jButtonAbrirOrderByValorRubroVariable.setText("Orden"); this.jButtonAbrirOrderByValorRubroVariable.setToolTipText("Orden"+FuncionesSwing.getKeyMensaje("ORDEN")); FuncionesSwing.addImagenButtonGeneral(this.jButtonAbrirOrderByValorRubroVariable,"orden_button","Orden"); FuncionesSwing.setBoldButton(this.jButtonAbrirOrderByValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; sMapKey = "AbrirOrderBySistema"; inputMap = this.jButtonAbrirOrderByValorRubroVariable.getInputMap(FuncionesSwing.getTipoFocusedKeyEvent("NORMAL")); inputMap.put(KeyStroke.getKeyStroke(FuncionesSwing.getKeyEvent("ORDEN") , FuncionesSwing.getMaskKey("ORDEN")), sMapKey); this.jButtonAbrirOrderByValorRubroVariable.getActionMap().put(sMapKey,new ButtonAbstractAction(this,"AbrirOrderBySistema")); if(!this.conCargarMinimo) { //NO CARGAR INICIALMENTE, EN BOTON AL ABRIR //this.jInternalFrameOrderByValorRubroVariable=new OrderByJInternalFrame(STIPO_TAMANIO_GENERAL,this.jButtonAbrirOrderByValorRubroVariable,false,this); //this.cargarOrderByValorRubroVariable(false); } else { //NO CARGAR INICIALMENTE, EN BOTON AL ABRIR //this.jInternalFrameOrderByValorRubroVariable=new OrderByJInternalFrame(STIPO_TAMANIO_GENERAL,this.jButtonAbrirOrderByValorRubroVariable,true,this); //this.cargarOrderByValorRubroVariable(true); } //VALORES PARA DISENO /* this.jTableDatosValorRubroVariable.setMinimumSize(new Dimension(400,50));//630 this.jTableDatosValorRubroVariable.setMaximumSize(new Dimension(400,50));//630 this.jTableDatosValorRubroVariable.setPreferredSize(new Dimension(400,50));//630 this.jScrollPanelDatosValorRubroVariable.setMinimumSize(new Dimension(400,50)); this.jScrollPanelDatosValorRubroVariable.setMaximumSize(new Dimension(400,50)); this.jScrollPanelDatosValorRubroVariable.setPreferredSize(new Dimension(400,50)); */ this.jButtonNuevoValorRubroVariable.setText("Nuevo"); this.jButtonDuplicarValorRubroVariable.setText("Duplicar"); this.jButtonCopiarValorRubroVariable.setText("Copiar"); this.jButtonVerFormValorRubroVariable.setText("Ver"); this.jButtonNuevoRelacionesValorRubroVariable.setText("Nuevo Rel"); this.jButtonGuardarCambiosTablaValorRubroVariable.setText("Guardar"); this.jButtonCerrarValorRubroVariable.setText("Salir"); FuncionesSwing.addImagenButtonGeneral(this.jButtonNuevoValorRubroVariable,"nuevo_button","Nuevo",this.valorrubrovariableSessionBean.getEsGuardarRelacionado()); FuncionesSwing.addImagenButtonGeneral(this.jButtonDuplicarValorRubroVariable,"duplicar_button","Duplicar",this.valorrubrovariableSessionBean.getEsGuardarRelacionado()); FuncionesSwing.addImagenButtonGeneral(this.jButtonCopiarValorRubroVariable,"copiar_button","Copiar",this.valorrubrovariableSessionBean.getEsGuardarRelacionado()); FuncionesSwing.addImagenButtonGeneral(this.jButtonVerFormValorRubroVariable,"ver_form","Ver",this.valorrubrovariableSessionBean.getEsGuardarRelacionado()); FuncionesSwing.addImagenButtonGeneral(this.jButtonNuevoRelacionesValorRubroVariable,"nuevorelaciones_button","Nuevo Rel",this.valorrubrovariableSessionBean.getEsGuardarRelacionado()); FuncionesSwing.addImagenButtonGeneral(this.jButtonGuardarCambiosTablaValorRubroVariable,"guardarcambiostabla_button","Guardar",this.valorrubrovariableSessionBean.getEsGuardarRelacionado()); FuncionesSwing.addImagenButtonGeneral(this.jButtonCerrarValorRubroVariable,"cerrar_button","Salir",this.valorrubrovariableSessionBean.getEsGuardarRelacionado()); FuncionesSwing.setBoldButton(this.jButtonNuevoValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); FuncionesSwing.setBoldButton(this.jButtonDuplicarValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); FuncionesSwing.setBoldButton(this.jButtonCopiarValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); FuncionesSwing.setBoldButton(this.jButtonVerFormValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); FuncionesSwing.setBoldButton(this.jButtonNuevoRelacionesValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); FuncionesSwing.setBoldButton(this.jButtonGuardarCambiosTablaValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); FuncionesSwing.setBoldButton(this.jButtonCerrarValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jButtonNuevoValorRubroVariable.setToolTipText("Nuevo"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO + FuncionesSwing.getKeyMensaje("NUEVO")); this.jButtonDuplicarValorRubroVariable.setToolTipText("Duplicar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO + FuncionesSwing.getKeyMensaje("DUPLICAR")); this.jButtonCopiarValorRubroVariable.setToolTipText("Copiar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO+ FuncionesSwing.getKeyMensaje("COPIAR")); this.jButtonVerFormValorRubroVariable.setToolTipText("Ver"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO+ FuncionesSwing.getKeyMensaje("VER_FORM")); this.jButtonNuevoRelacionesValorRubroVariable.setToolTipText("Nuevo Rel"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO + FuncionesSwing.getKeyMensaje("NUEVO_RELACIONES")); this.jButtonGuardarCambiosTablaValorRubroVariable.setToolTipText("Guardar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO + FuncionesSwing.getKeyMensaje("GUARDAR_CAMBIOS")); this.jButtonCerrarValorRubroVariable.setToolTipText("Salir"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO + FuncionesSwing.getKeyMensaje("CERRAR")); //HOT KEYS /* N->Nuevo N->Alt + Nuevo Relaciones (ANTES R) A->Actualizar E->Eliminar S->Cerrar C->->Mayus + Cancelar (ANTES Q->Quit) G->Guardar Cambios D->Duplicar C->Alt + Cop?ar O->Orden N->Nuevo Tabla R->Recargar Informacion Inicial (ANTES I) Alt + Pag.Down->Siguientes Alt + Pag.Up->Anteriores NO UTILIZADOS M->Modificar */ //String sMapKey = ""; //InputMap inputMap =null; //NUEVO sMapKey = "NuevoValorRubroVariable"; inputMap = this.jButtonNuevoValorRubroVariable.getInputMap(FuncionesSwing.getTipoFocusedKeyEvent("NORMAL")); inputMap.put(KeyStroke.getKeyStroke(FuncionesSwing.getKeyEvent("NUEVO") , FuncionesSwing.getMaskKey("NUEVO")), sMapKey); this.jButtonNuevoValorRubroVariable.getActionMap().put(sMapKey, new ButtonAbstractAction(this,"NuevoValorRubroVariable")); //DUPLICAR sMapKey = "DuplicarValorRubroVariable"; inputMap = this.jButtonDuplicarValorRubroVariable.getInputMap(FuncionesSwing.getTipoFocusedKeyEvent("NORMAL")); inputMap.put(KeyStroke.getKeyStroke(FuncionesSwing.getKeyEvent("DUPLICAR") , FuncionesSwing.getMaskKey("DUPLICAR")), sMapKey); this.jButtonDuplicarValorRubroVariable.getActionMap().put(sMapKey, new ButtonAbstractAction(this,"DuplicarValorRubroVariable")); //COPIAR sMapKey = "CopiarValorRubroVariable"; inputMap = this.jButtonCopiarValorRubroVariable.getInputMap(FuncionesSwing.getTipoFocusedKeyEvent("NORMAL")); inputMap.put(KeyStroke.getKeyStroke(FuncionesSwing.getKeyEvent("COPIAR") , FuncionesSwing.getMaskKey("COPIAR")), sMapKey); this.jButtonCopiarValorRubroVariable.getActionMap().put(sMapKey, new ButtonAbstractAction(this,"CopiarValorRubroVariable")); //VEr FORM sMapKey = "VerFormValorRubroVariable"; inputMap = this.jButtonVerFormValorRubroVariable.getInputMap(FuncionesSwing.getTipoFocusedKeyEvent("NORMAL")); inputMap.put(KeyStroke.getKeyStroke(FuncionesSwing.getKeyEvent("VER_FORM") , FuncionesSwing.getMaskKey("VER_FORM")), sMapKey); this.jButtonVerFormValorRubroVariable.getActionMap().put(sMapKey, new ButtonAbstractAction(this,"VerFormValorRubroVariable")); //NUEVO RELACIONES sMapKey = "NuevoRelacionesValorRubroVariable"; inputMap = this.jButtonNuevoRelacionesValorRubroVariable.getInputMap(FuncionesSwing.getTipoFocusedKeyEvent("NORMAL")); inputMap.put(KeyStroke.getKeyStroke(FuncionesSwing.getKeyEvent("NUEVO_RELACIONES") , FuncionesSwing.getMaskKey("NUEVO_RELACIONES")), sMapKey); this.jButtonNuevoRelacionesValorRubroVariable.getActionMap().put(sMapKey,new ButtonAbstractAction(this,"NuevoRelacionesValorRubroVariable")); //MODIFICAR /* sMapKey = "ModificarValorRubroVariable"; inputMap = this.jButtonModificarValorRubroVariable.getInputMap(FuncionesSwing.getTipoFocusedKeyEvent("NORMAL")); inputMap.put(KeyStroke.getKeyStroke(FuncionesSwing.getKeyEvent("MODIFICAR") , FuncionesSwing.getMaskKey("MODIFICAR")), sMapKey); this.jButtonModificarValorRubroVariable.getActionMap().put(sMapKey,new ButtonAbstractAction(this,"ModificarValorRubroVariable")); */ //CERRAR sMapKey = "CerrarValorRubroVariable"; inputMap = this.jButtonCerrarValorRubroVariable.getInputMap(FuncionesSwing.getTipoFocusedKeyEvent("NORMAL")); inputMap.put(KeyStroke.getKeyStroke(FuncionesSwing.getKeyEvent("CERRAR") , FuncionesSwing.getMaskKey("CERRAR")), sMapKey); this.jButtonCerrarValorRubroVariable.getActionMap().put(sMapKey,new ButtonAbstractAction(this,"CerrarValorRubroVariable")); //GUARDAR CAMBIOS sMapKey = "GuardarCambiosTablaValorRubroVariable"; inputMap = this.jButtonGuardarCambiosTablaValorRubroVariable.getInputMap(FuncionesSwing.getTipoFocusedKeyEvent("NORMAL")); inputMap.put(KeyStroke.getKeyStroke(FuncionesSwing.getKeyEvent("GUARDAR_CAMBIOS") , FuncionesSwing.getMaskKey("GUARDAR_CAMBIOS")), sMapKey); this.jButtonGuardarCambiosTablaValorRubroVariable.getActionMap().put(sMapKey,new ButtonAbstractAction(this,"GuardarCambiosTablaValorRubroVariable")); //ABRIR ORDER BY if(!this.conCargarMinimo) { } //HOT KEYS this.jPanelParametrosReportesValorRubroVariable = new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true);//new JPanel(); this.jPanelParametrosReportesAccionesValorRubroVariable = new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true);//new JPanel(); this.jPanelPaginacionValorRubroVariable = new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true);//new JPanel(); this.jPanelParametrosAuxiliar1ValorRubroVariable= new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true);//new JPanel(); this.jPanelParametrosAuxiliar2ValorRubroVariable= new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true);//new JPanel(); this.jPanelParametrosAuxiliar3ValorRubroVariable= new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true);//new JPanel(); this.jPanelParametrosAuxiliar4ValorRubroVariable= new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true);//new JPanel(); //this.jPanelParametrosAuxiliar5ValorRubroVariable= new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true);//new JPanel(); this.jPanelParametrosReportesValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("Parametros Reportes-Acciones")); this.jPanelParametrosReportesValorRubroVariable.setName("jPanelParametrosReportesValorRubroVariable"); this.jPanelParametrosReportesAccionesValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("Parametros Acciones")); //this.jPanelParametrosReportesAccionesValorRubroVariable.setBorder(javax.swing.BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); this.jPanelParametrosReportesAccionesValorRubroVariable.setName("jPanelParametrosReportesAccionesValorRubroVariable"); FuncionesSwing.setBoldPanel(this.jPanelParametrosReportesValorRubroVariable, STIPO_TAMANIO_GENERAL,false,false,this); FuncionesSwing.setBoldPanel(this.jPanelParametrosReportesAccionesValorRubroVariable, STIPO_TAMANIO_GENERAL,false,false,this); this.jButtonRecargarInformacionValorRubroVariable = new JButtonMe(); this.jButtonRecargarInformacionValorRubroVariable.setText("Recargar"); this.jButtonRecargarInformacionValorRubroVariable.setToolTipText("Recargar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO + FuncionesSwing.getKeyMensaje("RECARGAR")); FuncionesSwing.addImagenButtonGeneral(this.jButtonRecargarInformacionValorRubroVariable,"recargar_button","Recargar"); this.jButtonProcesarInformacionValorRubroVariable = new JButtonMe(); this.jButtonProcesarInformacionValorRubroVariable.setText("Procesar"); this.jButtonProcesarInformacionValorRubroVariable.setToolTipText("Procesar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO); this.jButtonProcesarInformacionValorRubroVariable.setVisible(false); this.jButtonProcesarInformacionValorRubroVariable.setMinimumSize(new Dimension(185,25)); this.jButtonProcesarInformacionValorRubroVariable.setMaximumSize(new Dimension(185,25)); this.jButtonProcesarInformacionValorRubroVariable.setPreferredSize(new Dimension(185,25)); this.jComboBoxTiposArchivosReportesValorRubroVariable = new JComboBoxMe(); //this.jComboBoxTiposArchivosReportesValorRubroVariable.setText("TIPO"); this.jComboBoxTiposArchivosReportesValorRubroVariable.setToolTipText("Tipos De Archivo"); this.jComboBoxTiposReportesValorRubroVariable = new JComboBoxMe(); //this.jComboBoxTiposArchivosReportesValorRubroVariable.setText("TIPO"); this.jComboBoxTiposReportesValorRubroVariable.setToolTipText("Tipos De Reporte"); this.jComboBoxTiposGraficosReportesValorRubroVariable = new JComboBoxMe(); //this.jComboBoxTiposArchivosReportesValorRubroVariable.setText("TIPO"); this.jComboBoxTiposGraficosReportesValorRubroVariable.setToolTipText("Tipos De Reporte"); this.jComboBoxTiposPaginacionValorRubroVariable = new JComboBoxMe(); //this.jComboBoxTiposPaginacionValorRubroVariable.setText("Paginacion"); this.jComboBoxTiposPaginacionValorRubroVariable.setToolTipText("Tipos De Paginacion"); this.jComboBoxTiposRelacionesValorRubroVariable = new JComboBoxMe(); //this.jComboBoxTiposRelacionesValorRubroVariable.setText("Accion"); this.jComboBoxTiposRelacionesValorRubroVariable.setToolTipText("Tipos de Relaciones"); this.jComboBoxTiposAccionesValorRubroVariable = new JComboBoxMe(); //this.jComboBoxTiposAccionesValorRubroVariable.setText("Accion"); this.jComboBoxTiposAccionesValorRubroVariable.setToolTipText("Tipos de Acciones"); this.jComboBoxTiposSeleccionarValorRubroVariable = new JComboBoxMe(); //this.jComboBoxTiposSeleccionarValorRubroVariable.setText("Accion"); this.jComboBoxTiposSeleccionarValorRubroVariable.setToolTipText("Tipos de Seleccion"); this.jTextFieldValorCampoGeneralValorRubroVariable=new JTextFieldMe(); this.jTextFieldValorCampoGeneralValorRubroVariable.setMinimumSize(new Dimension(100,Constantes.ISWING_ALTO_CONTROL)); this.jTextFieldValorCampoGeneralValorRubroVariable.setMaximumSize(new Dimension(100,Constantes.ISWING_ALTO_CONTROL)); this.jTextFieldValorCampoGeneralValorRubroVariable.setPreferredSize(new Dimension(100,Constantes.ISWING_ALTO_CONTROL)); this.jLabelAccionesValorRubroVariable = new JLabelMe(); this.jLabelAccionesValorRubroVariable.setText("Acciones"); this.jLabelAccionesValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelAccionesValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelAccionesValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jCheckBoxSeleccionarTodosValorRubroVariable = new JCheckBoxMe(); this.jCheckBoxSeleccionarTodosValorRubroVariable.setText("Sel. Todos"); this.jCheckBoxSeleccionarTodosValorRubroVariable.setToolTipText("Sel. Todos"); this.jCheckBoxSeleccionadosValorRubroVariable = new JCheckBoxMe(); //this.jCheckBoxSeleccionadosValorRubroVariable.setText("Seleccionados"); this.jCheckBoxSeleccionadosValorRubroVariable.setToolTipText("SELECCIONAR SELECCIONADOS"); this.jCheckBoxConAltoMaximoTablaValorRubroVariable = new JCheckBoxMe(); //this.jCheckBoxConAltoMaximoTablaValorRubroVariable.setText("Con Maximo Alto Tabla"); this.jCheckBoxConAltoMaximoTablaValorRubroVariable.setToolTipText("Con Maximo Alto Tabla"); this.jCheckBoxConGraficoReporteValorRubroVariable = new JCheckBoxMe(); this.jCheckBoxConGraficoReporteValorRubroVariable.setText("Graf."); this.jCheckBoxConGraficoReporteValorRubroVariable.setToolTipText("Con Grafico"); this.jButtonAnterioresValorRubroVariable = new JButtonMe(); //this.jButtonAnterioresValorRubroVariable.setText("<<"); this.jButtonAnterioresValorRubroVariable.setToolTipText("Anteriores Datos" + FuncionesSwing.getKeyMensaje("ANTERIORES")); FuncionesSwing.addImagenButtonGeneral(this.jButtonAnterioresValorRubroVariable,"anteriores_button","<<"); FuncionesSwing.setBoldButton(this.jButtonAnterioresValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jButtonSiguientesValorRubroVariable = new JButtonMe(); //this.jButtonSiguientesValorRubroVariable.setText(">>"); this.jButtonSiguientesValorRubroVariable.setToolTipText("Siguientes Datos" + FuncionesSwing.getKeyMensaje("SIGUIENTES")); FuncionesSwing.addImagenButtonGeneral(this.jButtonSiguientesValorRubroVariable,"siguientes_button",">>"); FuncionesSwing.setBoldButton(this.jButtonSiguientesValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jButtonNuevoGuardarCambiosValorRubroVariable = new JButtonMe(); this.jButtonNuevoGuardarCambiosValorRubroVariable.setText("Nue"); this.jButtonNuevoGuardarCambiosValorRubroVariable.setToolTipText("Nuevo" + FuncionesSwing.getKeyMensaje("NUEVO_TABLA")); FuncionesSwing.addImagenButtonGeneral(this.jButtonNuevoGuardarCambiosValorRubroVariable,"nuevoguardarcambios_button","Nue",this.valorrubrovariableSessionBean.getEsGuardarRelacionado()); FuncionesSwing.setBoldButton(this.jButtonNuevoGuardarCambiosValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); //HOT KEYS2 /* T->Nuevo Tabla */ //NUEVO GUARDAR CAMBIOS O NUEVO TABLA sMapKey = "NuevoGuardarCambiosValorRubroVariable"; inputMap = this.jButtonNuevoGuardarCambiosValorRubroVariable.getInputMap(FuncionesSwing.getTipoFocusedKeyEvent("NORMAL")); inputMap.put(KeyStroke.getKeyStroke(FuncionesSwing.getKeyEvent("NUEVO_TABLA") , FuncionesSwing.getMaskKey("NUEVO_TABLA")), sMapKey); this.jButtonNuevoGuardarCambiosValorRubroVariable.getActionMap().put(sMapKey,new ButtonAbstractAction(this,"NuevoGuardarCambiosValorRubroVariable")); //RECARGAR sMapKey = "RecargarInformacionValorRubroVariable"; inputMap = this.jButtonRecargarInformacionValorRubroVariable.getInputMap(FuncionesSwing.getTipoFocusedKeyEvent("NORMAL")); inputMap.put(KeyStroke.getKeyStroke(FuncionesSwing.getKeyEvent("RECARGAR") , FuncionesSwing.getMaskKey("RECARGAR")), sMapKey); this.jButtonRecargarInformacionValorRubroVariable.getActionMap().put(sMapKey,new ButtonAbstractAction(this,"RecargarInformacionValorRubroVariable")); //SIGUIENTES sMapKey = "SiguientesValorRubroVariable"; inputMap = this.jButtonSiguientesValorRubroVariable.getInputMap(FuncionesSwing.getTipoFocusedKeyEvent("NORMAL")); inputMap.put(KeyStroke.getKeyStroke(FuncionesSwing.getKeyEvent("SIGUIENTES") , FuncionesSwing.getMaskKey("SIGUIENTES")), sMapKey); this.jButtonSiguientesValorRubroVariable.getActionMap().put(sMapKey,new ButtonAbstractAction(this,"SiguientesValorRubroVariable")); //ANTERIORES sMapKey = "AnterioresValorRubroVariable"; inputMap = this.jButtonAnterioresValorRubroVariable.getInputMap(FuncionesSwing.getTipoFocusedKeyEvent("NORMAL")); inputMap.put(KeyStroke.getKeyStroke(FuncionesSwing.getKeyEvent("ANTERIORES") , FuncionesSwing.getMaskKey("ANTERIORES")), sMapKey); this.jButtonAnterioresValorRubroVariable.getActionMap().put(sMapKey,new ButtonAbstractAction(this,"AnterioresValorRubroVariable")); //HOT KEYS2 //DETALLE //TOOLBAR //INDICES BUSQUEDA //INDICES BUSQUEDA_FIN //INDICES BUSQUEDA if(!this.conCargarMinimo) { this.inicializarElementosBusquedasValorRubroVariable(); } //INDICES BUSQUEDA_FIN //ELEMENTOS TABLAS PARAMETOS if(!this.conCargarMinimo) { } //ELEMENTOS TABLAS PARAMETOS_FIN //ELEMENTOS TABLAS PARAMETOS_FIN //ESTA EN BEAN /* this.jTabbedPaneRelacionesValorRubroVariable.setMinimumSize(new Dimension(this.getWidth(),ValorRubroVariableBean.ALTO_TABPANE_RELACIONES + FuncionesSwing.getValorProporcion(ValorRubroVariableBean.ALTO_TABPANE_RELACIONES,0))); this.jTabbedPaneRelacionesValorRubroVariable.setMaximumSize(new Dimension(this.getWidth(),ValorRubroVariableBean.ALTO_TABPANE_RELACIONES + FuncionesSwing.getValorProporcion(ValorRubroVariableBean.ALTO_TABPANE_RELACIONES,0))); this.jTabbedPaneRelacionesValorRubroVariable.setPreferredSize(new Dimension(this.getWidth(),ValorRubroVariableBean.ALTO_TABPANE_RELACIONES + FuncionesSwing.getValorProporcion(ValorRubroVariableBean.ALTO_TABPANE_RELACIONES,0))); */ int iPosXAccionPaginacion=0; GridBagLayout gridaBagLayoutPaginacionValorRubroVariable = new GridBagLayout(); this.jPanelPaginacionValorRubroVariable.setLayout(gridaBagLayoutPaginacionValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.EAST; this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = 0; this.gridBagConstraintsValorRubroVariable.gridx = iPosXAccionPaginacion++; this.jPanelPaginacionValorRubroVariable.add(this.jButtonAnterioresValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridx = iPosXAccionPaginacion++; this.gridBagConstraintsValorRubroVariable.gridy = 0; this.jPanelPaginacionValorRubroVariable.add(this.jButtonNuevoGuardarCambiosValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.gridx = iPosXAccionPaginacion++; this.gridBagConstraintsValorRubroVariable.gridy = 0; this.jPanelPaginacionValorRubroVariable.add(this.jButtonSiguientesValorRubroVariable, this.gridBagConstraintsValorRubroVariable); iPosXAccionPaginacion=0; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = 1; this.gridBagConstraintsValorRubroVariable.gridx = iPosXAccionPaginacion++; this.jPanelPaginacionValorRubroVariable.add(this.jButtonNuevoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); if(!this.valorrubrovariableSessionBean.getEsGuardarRelacionado() && !this.conCargarMinimo) { this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = 1; this.gridBagConstraintsValorRubroVariable.gridx = iPosXAccionPaginacion++; this.jPanelPaginacionValorRubroVariable.add(this.jButtonGuardarCambiosTablaValorRubroVariable, this.gridBagConstraintsValorRubroVariable); } this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = 1; this.gridBagConstraintsValorRubroVariable.gridx = iPosXAccionPaginacion++; this.jPanelPaginacionValorRubroVariable.add(this.jButtonDuplicarValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = 1; this.gridBagConstraintsValorRubroVariable.gridx = iPosXAccionPaginacion++; this.jPanelPaginacionValorRubroVariable.add(this.jButtonCopiarValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = 1; this.gridBagConstraintsValorRubroVariable.gridx = iPosXAccionPaginacion++; this.jPanelPaginacionValorRubroVariable.add(this.jButtonVerFormValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = 1; this.gridBagConstraintsValorRubroVariable.gridx = iPosXAccionPaginacion++; this.jPanelPaginacionValorRubroVariable.add(this.jButtonCerrarValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.jButtonRecargarInformacionValorRubroVariable.setMinimumSize(new Dimension(95,25)); this.jButtonRecargarInformacionValorRubroVariable.setMaximumSize(new Dimension(95,25)); this.jButtonRecargarInformacionValorRubroVariable.setPreferredSize(new Dimension(95,25)); FuncionesSwing.setBoldButton(this.jButtonRecargarInformacionValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jComboBoxTiposArchivosReportesValorRubroVariable.setMinimumSize(new Dimension(105,20)); this.jComboBoxTiposArchivosReportesValorRubroVariable.setMaximumSize(new Dimension(105,20)); this.jComboBoxTiposArchivosReportesValorRubroVariable.setPreferredSize(new Dimension(105,20)); FuncionesSwing.setBoldComboBox(this.jComboBoxTiposArchivosReportesValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; this.jComboBoxTiposReportesValorRubroVariable.setMinimumSize(new Dimension(100,20)); this.jComboBoxTiposReportesValorRubroVariable.setMaximumSize(new Dimension(100,20)); this.jComboBoxTiposReportesValorRubroVariable.setPreferredSize(new Dimension(100,20)); FuncionesSwing.setBoldComboBox(this.jComboBoxTiposReportesValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; this.jComboBoxTiposGraficosReportesValorRubroVariable.setMinimumSize(new Dimension(80,20)); this.jComboBoxTiposGraficosReportesValorRubroVariable.setMaximumSize(new Dimension(80,20)); this.jComboBoxTiposGraficosReportesValorRubroVariable.setPreferredSize(new Dimension(80,20)); FuncionesSwing.setBoldComboBox(this.jComboBoxTiposGraficosReportesValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; this.jComboBoxTiposPaginacionValorRubroVariable.setMinimumSize(new Dimension(80,20)); this.jComboBoxTiposPaginacionValorRubroVariable.setMaximumSize(new Dimension(80,20)); this.jComboBoxTiposPaginacionValorRubroVariable.setPreferredSize(new Dimension(80,20)); FuncionesSwing.setBoldComboBox(this.jComboBoxTiposPaginacionValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; this.jComboBoxTiposRelacionesValorRubroVariable.setMinimumSize(new Dimension(145,20)); this.jComboBoxTiposRelacionesValorRubroVariable.setMaximumSize(new Dimension(145,20)); this.jComboBoxTiposRelacionesValorRubroVariable.setPreferredSize(new Dimension(145,20)); FuncionesSwing.setBoldComboBox(this.jComboBoxTiposRelacionesValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; this.jComboBoxTiposAccionesValorRubroVariable.setMinimumSize(new Dimension(145,20)); this.jComboBoxTiposAccionesValorRubroVariable.setMaximumSize(new Dimension(145,20)); this.jComboBoxTiposAccionesValorRubroVariable.setPreferredSize(new Dimension(145,20)); FuncionesSwing.setBoldComboBox(this.jComboBoxTiposAccionesValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; this.jComboBoxTiposSeleccionarValorRubroVariable.setMinimumSize(new Dimension(145,20)); this.jComboBoxTiposSeleccionarValorRubroVariable.setMaximumSize(new Dimension(145,20)); this.jComboBoxTiposSeleccionarValorRubroVariable.setPreferredSize(new Dimension(145,20)); FuncionesSwing.setBoldComboBox(this.jComboBoxTiposSeleccionarValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; this.jCheckBoxConAltoMaximoTablaValorRubroVariable.setMinimumSize(new Dimension(20,20)); this.jCheckBoxConAltoMaximoTablaValorRubroVariable.setMaximumSize(new Dimension(20,20)); this.jCheckBoxConAltoMaximoTablaValorRubroVariable.setPreferredSize(new Dimension(20,20)); FuncionesSwing.setBoldCheckBox(this.jCheckBoxConAltoMaximoTablaValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; this.jCheckBoxConGraficoReporteValorRubroVariable.setMinimumSize(new Dimension(60,20)); this.jCheckBoxConGraficoReporteValorRubroVariable.setMaximumSize(new Dimension(60,20)); this.jCheckBoxConGraficoReporteValorRubroVariable.setPreferredSize(new Dimension(60,20)); FuncionesSwing.setBoldCheckBox(this.jCheckBoxConGraficoReporteValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this); this.jCheckBoxSeleccionarTodosValorRubroVariable.setMinimumSize(new Dimension(100,20)); this.jCheckBoxSeleccionarTodosValorRubroVariable.setMaximumSize(new Dimension(100,20)); this.jCheckBoxSeleccionarTodosValorRubroVariable.setPreferredSize(new Dimension(100,20)); FuncionesSwing.setBoldCheckBox(this.jCheckBoxSeleccionarTodosValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; this.jCheckBoxSeleccionadosValorRubroVariable.setMinimumSize(new Dimension(20,20)); this.jCheckBoxSeleccionadosValorRubroVariable.setMaximumSize(new Dimension(20,20)); this.jCheckBoxSeleccionadosValorRubroVariable.setPreferredSize(new Dimension(20,20)); FuncionesSwing.setBoldCheckBox(this.jCheckBoxSeleccionadosValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; GridBagLayout gridaBagParametrosReportesValorRubroVariable = new GridBagLayout(); GridBagLayout gridaBagParametrosReportesAccionesValorRubroVariable = new GridBagLayout(); GridBagLayout gridaBagParametrosAuxiliar1ValorRubroVariable = new GridBagLayout(); GridBagLayout gridaBagParametrosAuxiliar2ValorRubroVariable = new GridBagLayout(); GridBagLayout gridaBagParametrosAuxiliar3ValorRubroVariable = new GridBagLayout(); GridBagLayout gridaBagParametrosAuxiliar4ValorRubroVariable = new GridBagLayout(); int iGridxParametrosReportes=0; int iGridyParametrosReportes=0; int iGridxParametrosAuxiliar=0; int iGridyParametrosAuxiliar=0; this.jPanelParametrosReportesValorRubroVariable.setLayout(gridaBagParametrosReportesValorRubroVariable); this.jPanelParametrosReportesAccionesValorRubroVariable.setLayout(gridaBagParametrosReportesAccionesValorRubroVariable); this.jPanelParametrosAuxiliar1ValorRubroVariable.setLayout(gridaBagParametrosAuxiliar1ValorRubroVariable); this.jPanelParametrosAuxiliar2ValorRubroVariable.setLayout(gridaBagParametrosAuxiliar2ValorRubroVariable); this.jPanelParametrosAuxiliar3ValorRubroVariable.setLayout(gridaBagParametrosAuxiliar3ValorRubroVariable); this.jPanelParametrosAuxiliar4ValorRubroVariable.setLayout(gridaBagParametrosAuxiliar4ValorRubroVariable); //this.jPanelParametrosAuxiliar5ValorRubroVariable.setLayout(gridaBagParametrosAuxiliar2ValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx = iGridxParametrosReportes++; this.jPanelParametrosReportesValorRubroVariable.add(this.jButtonRecargarInformacionValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //PAGINACION this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosAuxiliar;//iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx = iGridxParametrosAuxiliar++;//iGridxParametrosReportes++; //this.jPanelParametrosReportes this.jPanelParametrosAuxiliar1ValorRubroVariable.add(this.jComboBoxTiposPaginacionValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //CON ALTO MAXIMO TABLA this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosAuxiliar;//iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx = iGridxParametrosAuxiliar++;//iGridxParametrosReportes++; //this.jPanelParametrosReportes this.jPanelParametrosAuxiliar1ValorRubroVariable.add(this.jCheckBoxConAltoMaximoTablaValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //TIPOS ARCHIVOS REPORTES this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosAuxiliar;//iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx = iGridxParametrosAuxiliar++;//iGridxParametrosReportes++; //this.jPanelParametrosReportes this.jPanelParametrosAuxiliar1ValorRubroVariable.add(this.jComboBoxTiposArchivosReportesValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //USANDO AUXILIAR this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx = iGridxParametrosReportes++; //this.jPanelParametrosReportes this.jPanelParametrosReportesValorRubroVariable.add(this.jPanelParametrosAuxiliar1ValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //USANDO AUXILIAR FIN //AUXILIAR4 TIPOS REPORTES Y TIPOS GRAFICOS REPORTES iGridxParametrosAuxiliar=0; iGridyParametrosAuxiliar=0; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy =iGridxParametrosAuxiliar;//iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx =iGridyParametrosAuxiliar++;//iGridxParametrosReportes++; //this.jPanelParametrosReportes this.jPanelParametrosAuxiliar4ValorRubroVariable.add(this.jComboBoxTiposReportesValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy =iGridxParametrosAuxiliar;//iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx =iGridyParametrosAuxiliar++;//iGridxParametrosReportes++; //this.jPanelParametrosReportes //POR EL MOMENTO SOLO SE UTILIZA EN REPORTES DINAMICOS SIMPLES //this.jPanelParametrosAuxiliar4ValorRubroVariable.add(this.jComboBoxTiposGraficosReportesValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //AUXILIAR4 TIPOS REPORTES Y TIPOS GRAFICOS REPORTES //USANDO AUXILIAR 4 this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx = iGridxParametrosReportes++; //this.jPanelParametrosReportes this.jPanelParametrosReportesValorRubroVariable.add(this.jPanelParametrosAuxiliar4ValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //USANDO AUXILIAR 4 FIN //TIPOS REPORTES /* this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosReportes;//iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx = iGridxParametrosReportes++;//iGridxParametrosReportes++; //this.jPanelParametrosReportes this.jPanelParametrosReportesValorRubroVariable.add(this.jComboBoxTiposReportesValorRubroVariable, this.gridBagConstraintsValorRubroVariable); */ //GENERAR REPORTE (jCheckBoxExportar) /* this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx = iGridxParametrosReportes++; this.jPanelParametrosReportesValorRubroVariable.add(this.jCheckBoxGenerarReporteValorRubroVariable, this.gridBagConstraintsValorRubroVariable); */ iGridxParametrosAuxiliar=0; iGridyParametrosAuxiliar=0; //USANDO AUXILIAR this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx = iGridxParametrosReportes++; //this.jPanelParametrosReportes this.jPanelParametrosReportesValorRubroVariable.add(this.jPanelParametrosAuxiliar2ValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //USANDO AUXILIAR FIN //PARAMETROS ACCIONES //iGridxParametrosReportes=1; iGridxParametrosReportes=0; iGridyParametrosReportes=1; /* this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx =iGridxParametrosReportes++; this.jPanelParametrosReportesValorRubroVariable.add(this.jLabelAccionesValorRubroVariable, this.gridBagConstraintsValorRubroVariable); */ //PARAMETROS_ACCIONES-PARAMETROS_REPORTES //ORDER BY if(!this.conCargarMinimo) { this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx = iGridxParametrosReportes++; this.jPanelParametrosReportesValorRubroVariable.add(this.jButtonAbrirOrderByValorRubroVariable, this.gridBagConstraintsValorRubroVariable); } //PARAMETROS_ACCIONES-PARAMETROS_REPORTES this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx = iGridxParametrosReportes++; this.jPanelParametrosReportesValorRubroVariable.add(this.jComboBoxTiposSeleccionarValorRubroVariable, this.gridBagConstraintsValorRubroVariable); /* this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx =iGridxParametrosReportes++; this.jPanelParametrosReportesValorRubroVariable.add(this.jCheckBoxSeleccionarTodosValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx =iGridxParametrosReportes++; this.jPanelParametrosReportesValorRubroVariable.add(this.jCheckBoxConGraficoReporteValorRubroVariable, this.gridBagConstraintsValorRubroVariable); */ iGridxParametrosAuxiliar=0; iGridyParametrosAuxiliar=0; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy =iGridxParametrosAuxiliar;//iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx =iGridyParametrosAuxiliar++;//iGridxParametrosReportes++; //this.jPanelParametrosReportes this.jPanelParametrosAuxiliar3ValorRubroVariable.add(this.jCheckBoxSeleccionarTodosValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy =iGridxParametrosAuxiliar;//iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx =iGridyParametrosAuxiliar++;//iGridxParametrosReportes++; //this.jPanelParametrosReportes this.jPanelParametrosAuxiliar3ValorRubroVariable.add(this.jCheckBoxSeleccionadosValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy =iGridxParametrosAuxiliar;//iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx =iGridyParametrosAuxiliar++;//iGridxParametrosReportes++; //this.jPanelParametrosReportes this.jPanelParametrosAuxiliar3ValorRubroVariable.add(this.jCheckBoxConGraficoReporteValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //USANDO AUXILIAR3 this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx = iGridxParametrosReportes++; //this.jPanelParametrosReportes this.jPanelParametrosReportesValorRubroVariable.add(this.jPanelParametrosAuxiliar3ValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //USANDO AUXILIAR3 FIN this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx = iGridxParametrosReportes++; this.jPanelParametrosReportesValorRubroVariable.add(this.jComboBoxTiposAccionesValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy = iGridyParametrosReportes; this.gridBagConstraintsValorRubroVariable.gridx = iGridxParametrosReportes++; this.jPanelParametrosReportesValorRubroVariable.add(this.jTextFieldValorCampoGeneralValorRubroVariable, this.gridBagConstraintsValorRubroVariable); ; //ELEMENTOS TABLAS PARAMETOS //SUBPANELES POR CAMPO if(!this.conCargarMinimo) { //SUBPANELES EN PANEL CAMPOS } //ELEMENTOS TABLAS PARAMETOS_FIN /* GridBagLayout gridaBagLayoutDatosValorRubroVariable = new GridBagLayout(); this.jScrollPanelDatosValorRubroVariable.setLayout(gridaBagLayoutDatosValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = 0; this.gridBagConstraintsValorRubroVariable.gridx = 0; this.jScrollPanelDatosValorRubroVariable.add(this.jTableDatosValorRubroVariable, this.gridBagConstraintsValorRubroVariable); */ this.redimensionarTablaDatos(-1); this.jScrollPanelDatosValorRubroVariable.setViewportView(this.jTableDatosValorRubroVariable); this.jTableDatosValorRubroVariable.setFillsViewportHeight(true); this.jTableDatosValorRubroVariable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); Integer iGridXParametrosAccionesFormulario=0; Integer iGridYParametrosAccionesFormulario=0; GridBagLayout gridaBagLayoutAccionesValorRubroVariable= new GridBagLayout(); this.jPanelAccionesValorRubroVariable.setLayout(gridaBagLayoutAccionesValorRubroVariable); /* this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = 0; this.gridBagConstraintsValorRubroVariable.gridx = 0; this.jPanelAccionesValorRubroVariable.add(this.jButtonNuevoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); */ int iPosXAccion=0; if(!this.conCargarMinimo) { //BYDAN_BUSQUEDAS GridBagLayout gridaBagLayoutFK_IdEmpleadoValorRubroVariable= new GridBagLayout(); gridaBagLayoutFK_IdEmpleadoValorRubroVariable.rowHeights = new int[] {1}; gridaBagLayoutFK_IdEmpleadoValorRubroVariable.columnWidths = new int[] {1}; gridaBagLayoutFK_IdEmpleadoValorRubroVariable.rowWeights = new double[]{0.0, 0.0, 0.0}; gridaBagLayoutFK_IdEmpleadoValorRubroVariable.columnWeights = new double[]{0.0, 1.0}; jPanelFK_IdEmpleadoValorRubroVariable.setLayout(gridaBagLayoutFK_IdEmpleadoValorRubroVariable); gridBagConstraintsValorRubroVariable = new GridBagConstraints(); gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; gridBagConstraintsValorRubroVariable.gridy = 0; gridBagConstraintsValorRubroVariable.gridx = 0; jPanelFK_IdEmpleadoValorRubroVariable.add(jLabelid_empleadoFK_IdEmpleadoValorRubroVariable, gridBagConstraintsValorRubroVariable); gridBagConstraintsValorRubroVariable = new GridBagConstraints(); gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; gridBagConstraintsValorRubroVariable.gridy = 0; gridBagConstraintsValorRubroVariable.gridx = 1; jPanelFK_IdEmpleadoValorRubroVariable.add(jComboBoxid_empleadoFK_IdEmpleadoValorRubroVariable, gridBagConstraintsValorRubroVariable); gridBagConstraintsValorRubroVariable = new GridBagConstraints(); gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; gridBagConstraintsValorRubroVariable.gridy = 1; gridBagConstraintsValorRubroVariable.gridx =1; jPanelFK_IdEmpleadoValorRubroVariable.add(jButtonFK_IdEmpleadoValorRubroVariable, gridBagConstraintsValorRubroVariable); jTabbedPaneBusquedasValorRubroVariable.addTab("1.-Por Empleado ", jPanelFK_IdEmpleadoValorRubroVariable); jTabbedPaneBusquedasValorRubroVariable.setMnemonicAt(0, KeyEvent.VK_1); GridBagLayout gridaBagLayoutFK_IdRubroEmpleaValorRubroVariable= new GridBagLayout(); gridaBagLayoutFK_IdRubroEmpleaValorRubroVariable.rowHeights = new int[] {1}; gridaBagLayoutFK_IdRubroEmpleaValorRubroVariable.columnWidths = new int[] {1}; gridaBagLayoutFK_IdRubroEmpleaValorRubroVariable.rowWeights = new double[]{0.0, 0.0, 0.0}; gridaBagLayoutFK_IdRubroEmpleaValorRubroVariable.columnWeights = new double[]{0.0, 1.0}; jPanelFK_IdRubroEmpleaValorRubroVariable.setLayout(gridaBagLayoutFK_IdRubroEmpleaValorRubroVariable); gridBagConstraintsValorRubroVariable = new GridBagConstraints(); gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; gridBagConstraintsValorRubroVariable.gridy = 0; gridBagConstraintsValorRubroVariable.gridx = 0; jPanelFK_IdRubroEmpleaValorRubroVariable.add(jLabelid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable, gridBagConstraintsValorRubroVariable); gridBagConstraintsValorRubroVariable = new GridBagConstraints(); gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; gridBagConstraintsValorRubroVariable.gridy = 0; gridBagConstraintsValorRubroVariable.gridx = 1; jPanelFK_IdRubroEmpleaValorRubroVariable.add(jComboBoxid_rubro_empleaFK_IdRubroEmpleaValorRubroVariable, gridBagConstraintsValorRubroVariable); gridBagConstraintsValorRubroVariable = new GridBagConstraints(); gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.WEST; gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; gridBagConstraintsValorRubroVariable.gridy = 1; gridBagConstraintsValorRubroVariable.gridx =1; jPanelFK_IdRubroEmpleaValorRubroVariable.add(jButtonFK_IdRubroEmpleaValorRubroVariable, gridBagConstraintsValorRubroVariable); jTabbedPaneBusquedasValorRubroVariable.addTab("2.-Por Rubro Emplea ", jPanelFK_IdRubroEmpleaValorRubroVariable); jTabbedPaneBusquedasValorRubroVariable.setMnemonicAt(1, KeyEvent.VK_2); } //this.setJProgressBarToJPanel(); GridBagLayout gridaBagLayoutValorRubroVariable = new GridBagLayout(); this.jContentPane.setLayout(gridaBagLayoutValorRubroVariable); if(this.parametroGeneralUsuario.getcon_botones_tool_bar() && !this.valorrubrovariableSessionBean.getEsGuardarRelacionado()) { this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy = iGridyPrincipal++; this.gridBagConstraintsValorRubroVariable.gridx = 0; //this.gridBagConstraintsValorRubroVariable.fill =GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.CENTER;//.CENTER;NORTH this.gridBagConstraintsValorRubroVariable.ipadx = 100; this.jContentPane.add(this.jTtoolBarValorRubroVariable, this.gridBagConstraintsValorRubroVariable); } //PROCESANDO EN OTRA PANTALLA /* this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy = iGridyPrincipal++; this.gridBagConstraintsValorRubroVariable.gridx = 0; //this.gridBagConstraintsValorRubroVariable.fill =GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.CENTER; this.gridBagConstraintsValorRubroVariable.ipadx = 100; this.jContentPane.add(this.jPanelProgressProcess, this.gridBagConstraintsValorRubroVariable); */ int iGridxBusquedasParametros=0; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); if(!this.conCargarMinimo) { this.gridBagConstraintsValorRubroVariable.gridy = iGridyPrincipal++; this.gridBagConstraintsValorRubroVariable.gridx = 0; this.gridBagConstraintsValorRubroVariable.fill =GridBagConstraints.VERTICAL;//GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.anchor = GridBagConstraints.NORTHWEST; this.gridBagConstraintsValorRubroVariable.ipadx = 150; if(!this.conCargarMinimo) { this.jContentPane.add(this.jTabbedPaneBusquedasValorRubroVariable, this.gridBagConstraintsValorRubroVariable); } } //PARAMETROS TABLAS PARAMETROS if(!this.conCargarMinimo) { } //PARAMETROS TABLAS PARAMETROS_FIN //PARAMETROS REPORTES this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy = iGridyPrincipal++; this.gridBagConstraintsValorRubroVariable.gridx = 0; this.jContentPane.add(this.jPanelParametrosReportesValorRubroVariable, this.gridBagConstraintsValorRubroVariable); /* this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy = iGridyPrincipal++; this.gridBagConstraintsValorRubroVariable.gridx = 0; this.jContentPane.add(this.jPanelParametrosReportesAccionesValorRubroVariable, this.gridBagConstraintsValorRubroVariable); */ this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy =iGridyPrincipal++; this.gridBagConstraintsValorRubroVariable.gridx =0; this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.BOTH; //this.gridBagConstraintsValorRubroVariable.ipady =150; this.jContentPane.add(this.jScrollPanelDatosValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy = iGridyPrincipal++; this.gridBagConstraintsValorRubroVariable.gridx = 0; this.jContentPane.add(this.jPanelPaginacionValorRubroVariable, this.gridBagConstraintsValorRubroVariable); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); iWidthScroll=(screenSize.width-screenSize.width/Constantes.ISWING_RESTOPARTE_DIFERENCIA_ANCHO_RELSCROLL)+(250*0); iHeightScroll=(screenSize.height-screenSize.height/Constantes.ISWING_RESTOPARTE_DIFERENCIA_ALTO_RELSCROLL); if(ValorRubroVariableJInternalFrame.CON_DATOS_FRAME) { this.jPanelBusquedasParametrosValorRubroVariable= new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true);//new JPanel(); int iGridyRelaciones=0; GridBagLayout gridaBagLayoutBusquedasParametrosValorRubroVariable = new GridBagLayout(); this.jPanelBusquedasParametrosValorRubroVariable.setLayout(gridaBagLayoutBusquedasParametrosValorRubroVariable); if(this.parametroGeneralUsuario.getcon_botones_tool_bar()) { } this.jScrollPanelDatosGeneralValorRubroVariable= new JScrollPane(jContentPane,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); this.jScrollPanelDatosGeneralValorRubroVariable.setMinimumSize(new Dimension(iWidthScroll,iHeightScroll)); this.jScrollPanelDatosGeneralValorRubroVariable.setMaximumSize(new Dimension(iWidthScroll,iHeightScroll)); this.jScrollPanelDatosGeneralValorRubroVariable.setPreferredSize(new Dimension(iWidthScroll,iHeightScroll)); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); //if(!this.conCargarMinimo) { //} this.conMaximoRelaciones=true; if(this.parametroGeneralUsuario.getcon_cargar_por_parte()) { } Boolean tieneColumnasOcultas=false; tieneColumnasOcultas=true; if(!Constantes.ISDEVELOPING) { } else { if(tieneColumnasOcultas) { } } } else { //DISENO_DETALLE COMENTAR Y //DISENO_DETALLE(Solo Descomentar Seccion Inferior) //NOTA-DISENO_DETALLE(Si cambia lo de abajo, cambiar lo comentado, Al final no es lo mismo) } //DISENO_DETALLE-(Descomentar) /* this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy = iGridyPrincipal++; this.gridBagConstraintsValorRubroVariable.gridx = 0; this.jContentPane.add(this.jPanelCamposValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy = iGridyPrincipal++; this.gridBagConstraintsValorRubroVariable.gridx = 0; this.jContentPane.add(this.jPanelCamposOcultosValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy =iGridyPrincipal++; this.gridBagConstraintsValorRubroVariable.gridx =0; this.jContentPane.add(this.jPanelAccionesValorRubroVariable, this.gridBagConstraintsValorRubroVariable); */ //pack(); return this.jScrollPanelDatosGeneralValorRubroVariable;//jContentPane; } /* public void cargarReporteDinamicoValorRubroVariable() throws Exception { int iWidthReporteDinamico=350; int iHeightReporteDinamico=450;//250;400; iHeightReporteDinamico+=180; int iPosXReporteDinamico=0; int iPosYReporteDinamico=0; GridBagLayout gridaBagLayoutReporteDinamicoValorRubroVariable = new GridBagLayout(); //PANEL this.jPanelReporteDinamicoValorRubroVariable = new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true); this.jPanelReporteDinamicoValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("Campos")); this.jPanelReporteDinamicoValorRubroVariable.setName("jPanelReporteDinamicoValorRubroVariable"); this.jPanelReporteDinamicoValorRubroVariable.setMinimumSize(new Dimension(iWidthReporteDinamico,iHeightReporteDinamico)); this.jPanelReporteDinamicoValorRubroVariable.setMaximumSize(new Dimension(iWidthReporteDinamico,iHeightReporteDinamico)); this.jPanelReporteDinamicoValorRubroVariable.setPreferredSize(new Dimension(iWidthReporteDinamico,iHeightReporteDinamico)); this.jPanelReporteDinamicoValorRubroVariable.setLayout(gridaBagLayoutReporteDinamicoValorRubroVariable); this.jInternalFrameReporteDinamicoValorRubroVariable= new ReporteDinamicoJInternalFrame(); this.jScrollPanelReporteDinamicoValorRubroVariable = new JScrollPane(); //PANEL_CONTROLES //this.jScrollColumnasSelectReporteValorRubroVariable= new JScrollPane(); //JINTERNAL FRAME this.jInternalFrameReporteDinamicoValorRubroVariable.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); this.jInternalFrameReporteDinamicoValorRubroVariable.setjInternalFrameParent(this); this.jInternalFrameReporteDinamicoValorRubroVariable.setTitle("REPORTE DINAMICO"); this.jInternalFrameReporteDinamicoValorRubroVariable.setSize(iWidthReporteDinamico+70,iHeightReporteDinamico+100); this.jInternalFrameReporteDinamicoValorRubroVariable.setLocation(xOffset*(openFrameCount + Constantes.INUM_MAX_VENTANAS_DET_X), yOffset*(openFrameCount+Constantes.INUM_MAX_VENTANAS_DET_Y)); this.jInternalFrameReporteDinamicoValorRubroVariable.setResizable(true); this.jInternalFrameReporteDinamicoValorRubroVariable.setClosable(true); this.jInternalFrameReporteDinamicoValorRubroVariable.setMaximizable(true); //SCROLL PANEL //this.jScrollPanelReporteDinamicoValorRubroVariable.setMinimumSize(new Dimension(iWidthReporteDinamico,iHeightReporteDinamico)); //this.jScrollPanelReporteDinamicoValorRubroVariable.setMaximumSize(new Dimension(iWidthReporteDinamico,iHeightReporteDinamico)); //this.jScrollPanelReporteDinamicoValorRubroVariable.setPreferredSize(new Dimension(iWidthReporteDinamico,iHeightReporteDinamico)); //this.jScrollPanelReporteDinamicoValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos Valor Rubro Variables")); //CONTROLES-ELEMENTOS //LABEL SELECT COLUMNAS this.jLabelColumnasSelectReporteValorRubroVariable = new JLabelMe(); this.jLabelColumnasSelectReporteValorRubroVariable.setText("Columnas Seleccion"); this.jLabelColumnasSelectReporteValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelColumnasSelectReporteValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelColumnasSelectReporteValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); iPosXReporteDinamico=0; iPosYReporteDinamico=0; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jLabelColumnasSelectReporteValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //LISTA SELECT COLUMNAS this.jListColumnasSelectReporteValorRubroVariable = new JList<Reporte>(); this.jListColumnasSelectReporteValorRubroVariable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); this.jListColumnasSelectReporteValorRubroVariable.setToolTipText("Tipos de Seleccion"); this.jListColumnasSelectReporteValorRubroVariable.setMinimumSize(new Dimension(145,300)); this.jListColumnasSelectReporteValorRubroVariable.setMaximumSize(new Dimension(145,300)); this.jListColumnasSelectReporteValorRubroVariable.setPreferredSize(new Dimension(145,300)); //SCROLL_PANEL_CONTROL this.jScrollColumnasSelectReporteValorRubroVariable=new JScrollPane(this.jListColumnasSelectReporteValorRubroVariable); this.jScrollColumnasSelectReporteValorRubroVariable.setMinimumSize(new Dimension(180,150)); this.jScrollColumnasSelectReporteValorRubroVariable.setMaximumSize(new Dimension(180,150)); this.jScrollColumnasSelectReporteValorRubroVariable.setPreferredSize(new Dimension(180,150)); this.jScrollColumnasSelectReporteValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("COLUMNAS")); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; //this.jPanelReporteDinamicoValorRubroVariable.add(this.jListColumnasSelectReporteValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.jPanelReporteDinamicoValorRubroVariable.add(this.jScrollColumnasSelectReporteValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //LABEL SELECT RELACIONES this.jLabelRelacionesSelectReporteValorRubroVariable = new JLabelMe(); this.jLabelRelacionesSelectReporteValorRubroVariable.setText("Relaciones Seleccion"); this.jLabelRelacionesSelectReporteValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelRelacionesSelectReporteValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelRelacionesSelectReporteValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); //LABEL SELECT RELACIONES_FIN //LISTA SELECT RELACIONES this.jListRelacionesSelectReporteValorRubroVariable = new JList<Reporte>(); this.jListRelacionesSelectReporteValorRubroVariable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); this.jListRelacionesSelectReporteValorRubroVariable.setToolTipText("Tipos de Seleccion"); this.jListRelacionesSelectReporteValorRubroVariable.setMinimumSize(new Dimension(145,300)); this.jListRelacionesSelectReporteValorRubroVariable.setMaximumSize(new Dimension(145,300)); this.jListRelacionesSelectReporteValorRubroVariable.setPreferredSize(new Dimension(145,300)); //SCROLL_PANEL_CONTROL this.jScrollRelacionesSelectReporteValorRubroVariable=new JScrollPane(this.jListRelacionesSelectReporteValorRubroVariable); this.jScrollRelacionesSelectReporteValorRubroVariable.setMinimumSize(new Dimension(180,120)); this.jScrollRelacionesSelectReporteValorRubroVariable.setMaximumSize(new Dimension(180,120)); this.jScrollRelacionesSelectReporteValorRubroVariable.setPreferredSize(new Dimension(180,120)); this.jScrollRelacionesSelectReporteValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("RELACIONES")); this.jCheckBoxConGraficoDinamicoValorRubroVariable = new JCheckBoxMe(); this.jComboBoxColumnaCategoriaGraficoValorRubroVariable = new JComboBoxMe(); this.jListColumnasValoresGraficoValorRubroVariable = new JList<Reporte>(); //COMBO TIPOS REPORTES this.jComboBoxTiposReportesDinamicoValorRubroVariable = new JComboBoxMe(); this.jComboBoxTiposReportesDinamicoValorRubroVariable.setToolTipText("Tipos De Reporte"); this.jComboBoxTiposReportesDinamicoValorRubroVariable.setMinimumSize(new Dimension(100,20)); this.jComboBoxTiposReportesDinamicoValorRubroVariable.setMaximumSize(new Dimension(100,20)); this.jComboBoxTiposReportesDinamicoValorRubroVariable.setPreferredSize(new Dimension(100,20)); FuncionesSwing.setBoldComboBox(this.jComboBoxTiposReportesDinamicoValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; //COMBO TIPOS REPORTES //COMBO TIPOS ARCHIVOS this.jComboBoxTiposArchivosReportesDinamicoValorRubroVariable = new JComboBoxMe(); this.jComboBoxTiposArchivosReportesDinamicoValorRubroVariable.setToolTipText("Tipos Archivos"); this.jComboBoxTiposArchivosReportesDinamicoValorRubroVariable.setMinimumSize(new Dimension(100,20)); this.jComboBoxTiposArchivosReportesDinamicoValorRubroVariable.setMaximumSize(new Dimension(100,20)); this.jComboBoxTiposArchivosReportesDinamicoValorRubroVariable.setPreferredSize(new Dimension(100,20)); FuncionesSwing.setBoldComboBox(this.jComboBoxTiposArchivosReportesDinamicoValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; //COMBO TIPOS ARCHIVOS //LABEL CON GRAFICO DINAMICO this.jLabelConGraficoDinamicoValorRubroVariable = new JLabelMe(); this.jLabelConGraficoDinamicoValorRubroVariable.setText("Con Grafico"); this.jLabelConGraficoDinamicoValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelConGraficoDinamicoValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelConGraficoDinamicoValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); iPosXReporteDinamico=0; iPosYReporteDinamico++; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jLabelConGraficoDinamicoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //CHECKBOX CON GRAFICO DINAMICO this.jCheckBoxConGraficoDinamicoValorRubroVariable = new JCheckBoxMe(); this.jCheckBoxConGraficoDinamicoValorRubroVariable.setText("Graf."); this.jCheckBoxConGraficoDinamicoValorRubroVariable.setToolTipText("Con Grafico"); this.jCheckBoxConGraficoDinamicoValorRubroVariable.setMinimumSize(new Dimension(100,20)); this.jCheckBoxConGraficoDinamicoValorRubroVariable.setMaximumSize(new Dimension(100,20)); this.jCheckBoxConGraficoDinamicoValorRubroVariable.setPreferredSize(new Dimension(100,20)); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jCheckBoxConGraficoDinamicoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //LABEL COMBO COLUMNA CATEGORIA this.jLabelColumnaCategoriaGraficoValorRubroVariable = new JLabelMe(); this.jLabelColumnaCategoriaGraficoValorRubroVariable.setText("Categoria Grafico"); this.jLabelColumnaCategoriaGraficoValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelColumnaCategoriaGraficoValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelColumnaCategoriaGraficoValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); iPosXReporteDinamico=0; iPosYReporteDinamico++; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jLabelColumnaCategoriaGraficoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //COMBO COLUMNA CATEGORIA this.jComboBoxColumnaCategoriaGraficoValorRubroVariable = new JComboBoxMe(); //this.jComboBoxColumnaCategoriaGraficoValorRubroVariable.setText("Accion"); this.jComboBoxColumnaCategoriaGraficoValorRubroVariable.setToolTipText("Tipos de Seleccion"); this.jComboBoxColumnaCategoriaGraficoValorRubroVariable.setMinimumSize(new Dimension(145,20)); this.jComboBoxColumnaCategoriaGraficoValorRubroVariable.setMaximumSize(new Dimension(145,20)); this.jComboBoxColumnaCategoriaGraficoValorRubroVariable.setPreferredSize(new Dimension(145,20)); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jComboBoxColumnaCategoriaGraficoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //LABEL COMBO COLUMNA CATEGORIA VALOR this.jLabelColumnaCategoriaValorValorRubroVariable = new JLabelMe(); this.jLabelColumnaCategoriaValorValorRubroVariable.setText("Categoria Valor"); this.jLabelColumnaCategoriaValorValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelColumnaCategoriaValorValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelColumnaCategoriaValorValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); iPosXReporteDinamico=0; iPosYReporteDinamico++; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jLabelColumnaCategoriaValorValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //COMBO COLUMNA CATEGORIA VALOR this.jComboBoxColumnaCategoriaValorValorRubroVariable = new JComboBoxMe(); //this.jComboBoxColumnaCategoriaValorValorRubroVariable.setText("Accion"); this.jComboBoxColumnaCategoriaValorValorRubroVariable.setToolTipText("Tipos de Seleccion"); this.jComboBoxColumnaCategoriaValorValorRubroVariable.setMinimumSize(new Dimension(145,20)); this.jComboBoxColumnaCategoriaValorValorRubroVariable.setMaximumSize(new Dimension(145,20)); this.jComboBoxColumnaCategoriaValorValorRubroVariable.setPreferredSize(new Dimension(145,20)); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jComboBoxColumnaCategoriaValorValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //LABEL VALORES GRAFICO COLUMNAS this.jLabelColumnasValoresGraficoValorRubroVariable = new JLabelMe(); this.jLabelColumnasValoresGraficoValorRubroVariable.setText("Columnas Valor Graf."); this.jLabelColumnasValoresGraficoValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelColumnasValoresGraficoValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelColumnasValoresGraficoValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); iPosXReporteDinamico=0; iPosYReporteDinamico++; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jLabelColumnasValoresGraficoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //LISTA VALORES GRAFICO COLUMNAS this.jListColumnasValoresGraficoValorRubroVariable = new JList<Reporte>(); this.jListColumnasValoresGraficoValorRubroVariable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); this.jListColumnasValoresGraficoValorRubroVariable.setToolTipText("VALORES GRAFICO"); this.jListColumnasValoresGraficoValorRubroVariable.setMinimumSize(new Dimension(145,300)); this.jListColumnasValoresGraficoValorRubroVariable.setMaximumSize(new Dimension(145,300)); this.jListColumnasValoresGraficoValorRubroVariable.setPreferredSize(new Dimension(145,300)); //SCROLL_VALORES GRAFICO COLUMNAS this.jScrollColumnasValoresGraficoValorRubroVariable=new JScrollPane(this.jListColumnasValoresGraficoValorRubroVariable); this.jScrollColumnasValoresGraficoValorRubroVariable.setMinimumSize(new Dimension(180,150)); this.jScrollColumnasValoresGraficoValorRubroVariable.setMaximumSize(new Dimension(180,150)); this.jScrollColumnasValoresGraficoValorRubroVariable.setPreferredSize(new Dimension(180,150)); this.jScrollColumnasValoresGraficoValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("COLUMNAS")); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; //this.jPanelReporteDinamicoValorRubroVariable.add(this.jListColumnasSelectReporteValorRubroVariable, this.gridBagConstraintsValorRubroVariable); this.jPanelReporteDinamicoValorRubroVariable.add(this.jScrollColumnasValoresGraficoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //LABEL TIPOS GRAFICO REPORTES this.jLabelTiposGraficosReportesDinamicoValorRubroVariable = new JLabelMe(); this.jLabelTiposGraficosReportesDinamicoValorRubroVariable.setText("Tipo Grafico"); this.jLabelTiposGraficosReportesDinamicoValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelTiposGraficosReportesDinamicoValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelTiposGraficosReportesDinamicoValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); iPosXReporteDinamico=0; iPosYReporteDinamico++; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jLabelTiposGraficosReportesDinamicoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //COMBO TIPO GRAFICO REPORTE this.jComboBoxTiposGraficosReportesDinamicoValorRubroVariable = new JComboBoxMe(); //this.jComboBoxColumnaCategoriaGraficoValorRubroVariable.setText("Accion"); this.jComboBoxTiposGraficosReportesDinamicoValorRubroVariable.setToolTipText("Tipos de Seleccion"); this.jComboBoxTiposGraficosReportesDinamicoValorRubroVariable.setMinimumSize(new Dimension(145,20)); this.jComboBoxTiposGraficosReportesDinamicoValorRubroVariable.setMaximumSize(new Dimension(145,20)); this.jComboBoxTiposGraficosReportesDinamicoValorRubroVariable.setPreferredSize(new Dimension(145,20)); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jComboBoxTiposGraficosReportesDinamicoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //LABEL GENERAR EXCEL this.jLabelGenerarExcelReporteDinamicoValorRubroVariable = new JLabelMe(); this.jLabelGenerarExcelReporteDinamicoValorRubroVariable.setText("Tipos de Reporte"); this.jLabelGenerarExcelReporteDinamicoValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelGenerarExcelReporteDinamicoValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelGenerarExcelReporteDinamicoValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); iPosXReporteDinamico=0; iPosYReporteDinamico++; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jLabelGenerarExcelReporteDinamicoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //BOTON GENERAR EXCEL this.jButtonGenerarExcelReporteDinamicoValorRubroVariable = new JButtonMe(); this.jButtonGenerarExcelReporteDinamicoValorRubroVariable.setText("Generar Excel"); FuncionesSwing.addImagenButtonGeneral(this.jButtonGenerarExcelReporteDinamicoValorRubroVariable,"generar_excel_reporte_dinamico_button","Generar EXCEL"); this.jButtonGenerarExcelReporteDinamicoValorRubroVariable.setToolTipText("Generar EXCEL"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO); //this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); //this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; //this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; //this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; //this.jPanelReporteDinamicoValorRubroVariable.add(this.jButtonGenerarExcelReporteDinamicoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //COMBO TIPOS REPORTES this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jComboBoxTiposReportesDinamicoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //LABEL TIPOS DE ARCHIVO this.jLabelTiposArchivoReporteDinamicoValorRubroVariable = new JLabelMe(); this.jLabelTiposArchivoReporteDinamicoValorRubroVariable.setText("Tipos de Archivo"); this.jLabelTiposArchivoReporteDinamicoValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelTiposArchivoReporteDinamicoValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelTiposArchivoReporteDinamicoValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); iPosXReporteDinamico=0; iPosYReporteDinamico++; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jLabelTiposArchivoReporteDinamicoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //COMBO TIPOS ARCHIVOS this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jComboBoxTiposArchivosReportesDinamicoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //BOTON GENERAR this.jButtonGenerarReporteDinamicoValorRubroVariable = new JButtonMe(); this.jButtonGenerarReporteDinamicoValorRubroVariable.setText("Generar"); FuncionesSwing.addImagenButtonGeneral(this.jButtonGenerarReporteDinamicoValorRubroVariable,"generar_reporte_dinamico_button","Generar"); this.jButtonGenerarReporteDinamicoValorRubroVariable.setToolTipText("Generar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO); iPosXReporteDinamico=0; iPosYReporteDinamico++; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jButtonGenerarReporteDinamicoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //BOTON CERRAR this.jButtonCerrarReporteDinamicoValorRubroVariable = new JButtonMe(); this.jButtonCerrarReporteDinamicoValorRubroVariable.setText("Cancelar"); FuncionesSwing.addImagenButtonGeneral(this.jButtonCerrarReporteDinamicoValorRubroVariable,"cerrar_reporte_dinamico_button","Cancelar"); this.jButtonCerrarReporteDinamicoValorRubroVariable.setToolTipText("Cancelar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx = iPosXReporteDinamico++; this.jPanelReporteDinamicoValorRubroVariable.add(this.jButtonCerrarReporteDinamicoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //GLOBAL AGREGAR PANELES GridBagLayout gridaBagLayoutReporteDinamicoPrincipalValorRubroVariable = new GridBagLayout(); this.jScrollPanelReporteDinamicoValorRubroVariable= new JScrollPane(jPanelReporteDinamicoValorRubroVariable,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); this.jScrollPanelReporteDinamicoValorRubroVariable.setMinimumSize(new Dimension(iWidthReporteDinamico+90,iHeightReporteDinamico+90)); this.jScrollPanelReporteDinamicoValorRubroVariable.setMaximumSize(new Dimension(iWidthReporteDinamico+90,iHeightReporteDinamico+90)); this.jScrollPanelReporteDinamicoValorRubroVariable.setPreferredSize(new Dimension(iWidthReporteDinamico+90,iHeightReporteDinamico+90)); this.jScrollPanelReporteDinamicoValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos Valor Rubro Variables")); iPosXReporteDinamico=0; iPosYReporteDinamico=0; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy =iPosYReporteDinamico; this.gridBagConstraintsValorRubroVariable.gridx =iPosXReporteDinamico; this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.BOTH; this.jInternalFrameReporteDinamicoValorRubroVariable.setContentPane(new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true)); this.jInternalFrameReporteDinamicoValorRubroVariable.getContentPane().setLayout(gridaBagLayoutReporteDinamicoPrincipalValorRubroVariable); this.jInternalFrameReporteDinamicoValorRubroVariable.getContentPane().add(this.jScrollPanelReporteDinamicoValorRubroVariable, this.gridBagConstraintsValorRubroVariable); } */ /* public void cargarImportacionValorRubroVariable() throws Exception { int iWidthImportacion=350; int iHeightImportacion=250;//400; int iPosXImportacion=0; int iPosYImportacion=0; GridBagLayout gridaBagLayoutImportacionValorRubroVariable = new GridBagLayout(); //PANEL this.jPanelImportacionValorRubroVariable = new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true); this.jPanelImportacionValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("Campos")); this.jPanelImportacionValorRubroVariable.setName("jPanelImportacionValorRubroVariable"); this.jPanelImportacionValorRubroVariable.setMinimumSize(new Dimension(iWidthImportacion,iHeightImportacion)); this.jPanelImportacionValorRubroVariable.setMaximumSize(new Dimension(iWidthImportacion,iHeightImportacion)); this.jPanelImportacionValorRubroVariable.setPreferredSize(new Dimension(iWidthImportacion,iHeightImportacion)); this.jPanelImportacionValorRubroVariable.setLayout(gridaBagLayoutImportacionValorRubroVariable); this.jInternalFrameImportacionValorRubroVariable= new ImportacionJInternalFrame(); //this.jInternalFrameImportacionValorRubroVariable= new ImportacionJInternalFrame(); this.jScrollPanelImportacionValorRubroVariable = new JScrollPane(); //PANEL_CONTROLES //this.jScrollColumnasSelectReporteValorRubroVariable= new JScrollPane(); //JINTERNAL FRAME this.jInternalFrameImportacionValorRubroVariable.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); this.jInternalFrameImportacionValorRubroVariable.setjInternalFrameParent(this); this.jInternalFrameImportacionValorRubroVariable.setTitle("REPORTE DINAMICO"); this.jInternalFrameImportacionValorRubroVariable.setSize(iWidthImportacion+70,iHeightImportacion+100); this.jInternalFrameImportacionValorRubroVariable.setLocation(xOffset*(openFrameCount + Constantes.INUM_MAX_VENTANAS_DET_X), yOffset*(openFrameCount+Constantes.INUM_MAX_VENTANAS_DET_Y)); this.jInternalFrameImportacionValorRubroVariable.setResizable(true); this.jInternalFrameImportacionValorRubroVariable.setClosable(true); this.jInternalFrameImportacionValorRubroVariable.setMaximizable(true); //JINTERNAL FRAME IMPORTACION this.jInternalFrameImportacionValorRubroVariable.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); this.jInternalFrameImportacionValorRubroVariable.setjInternalFrameParent(this); this.jInternalFrameImportacionValorRubroVariable.setTitle("IMPORTACION"); this.jInternalFrameImportacionValorRubroVariable.setSize(iWidthImportacion+70,iHeightImportacion+100); this.jInternalFrameImportacionValorRubroVariable.setLocation(xOffset*(openFrameCount + Constantes.INUM_MAX_VENTANAS_DET_X), yOffset*(openFrameCount+Constantes.INUM_MAX_VENTANAS_DET_Y)); this.jInternalFrameImportacionValorRubroVariable.setResizable(true); this.jInternalFrameImportacionValorRubroVariable.setClosable(true); this.jInternalFrameImportacionValorRubroVariable.setMaximizable(true); //SCROLL PANEL this.jScrollPanelImportacionValorRubroVariable.setMinimumSize(new Dimension(iWidthImportacion,iHeightImportacion)); this.jScrollPanelImportacionValorRubroVariable.setMaximumSize(new Dimension(iWidthImportacion,iHeightImportacion)); this.jScrollPanelImportacionValorRubroVariable.setPreferredSize(new Dimension(iWidthImportacion,iHeightImportacion)); this.jScrollPanelImportacionValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos Valor Rubro Variables")); //LABEL ARCHIVO IMPORTACION this.jLabelArchivoImportacionValorRubroVariable = new JLabelMe(); this.jLabelArchivoImportacionValorRubroVariable.setText("ARCHIVO IMPORTACION"); this.jLabelArchivoImportacionValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelArchivoImportacionValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelArchivoImportacionValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); iPosXImportacion=0; iPosYImportacion++; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYImportacion; this.gridBagConstraintsValorRubroVariable.gridx = iPosXImportacion++; this.jPanelImportacionValorRubroVariable.add(this.jLabelArchivoImportacionValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //BOTON ABRIR IMPORTACION this.jFileChooserImportacionValorRubroVariable = new JFileChooser(); this.jFileChooserImportacionValorRubroVariable.setToolTipText("ESCOGER ARCHIVO"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO); this.jButtonAbrirImportacionValorRubroVariable = new JButtonMe(); this.jButtonAbrirImportacionValorRubroVariable.setText("ESCOGER"); FuncionesSwing.addImagenButtonGeneral(this.jButtonAbrirImportacionValorRubroVariable,"generar_importacion_button","ESCOGER"); this.jButtonAbrirImportacionValorRubroVariable.setToolTipText("Generar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYImportacion; this.gridBagConstraintsValorRubroVariable.gridx = iPosXImportacion++; this.jPanelImportacionValorRubroVariable.add(this.jButtonAbrirImportacionValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //LABEL PATH IMPORTACION this.jLabelPathArchivoImportacionValorRubroVariable = new JLabelMe(); this.jLabelPathArchivoImportacionValorRubroVariable.setText("PATH ARCHIVO"); this.jLabelPathArchivoImportacionValorRubroVariable.setMinimumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelPathArchivoImportacionValorRubroVariable.setMaximumSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); this.jLabelPathArchivoImportacionValorRubroVariable.setPreferredSize(new Dimension(Constantes.ISWING_ANCHO_CONTROL,Constantes.ISWING_ALTO_CONTROL)); iPosXImportacion=0; iPosYImportacion++; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.HORIZONTAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYImportacion; this.gridBagConstraintsValorRubroVariable.gridx = iPosXImportacion++; this.jPanelImportacionValorRubroVariable.add(this.jLabelPathArchivoImportacionValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //PATH IMPORTACION this.jTextFieldPathArchivoImportacionValorRubroVariable=new JTextFieldMe(); this.jTextFieldPathArchivoImportacionValorRubroVariable.setMinimumSize(new Dimension(150,Constantes.ISWING_ALTO_CONTROL)); this.jTextFieldPathArchivoImportacionValorRubroVariable.setMaximumSize(new Dimension(150,Constantes.ISWING_ALTO_CONTROL)); this.jTextFieldPathArchivoImportacionValorRubroVariable.setPreferredSize(new Dimension(150,Constantes.ISWING_ALTO_CONTROL)); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYImportacion; this.gridBagConstraintsValorRubroVariable.gridx = iPosXImportacion++; this.jPanelImportacionValorRubroVariable.add(this.jTextFieldPathArchivoImportacionValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //BOTON IMPORTACION this.jButtonGenerarImportacionValorRubroVariable = new JButtonMe(); this.jButtonGenerarImportacionValorRubroVariable.setText("IMPORTAR"); FuncionesSwing.addImagenButtonGeneral(this.jButtonGenerarImportacionValorRubroVariable,"generar_importacion_button","IMPORTAR"); this.jButtonGenerarImportacionValorRubroVariable.setToolTipText("Generar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO); iPosXImportacion=0; iPosYImportacion++; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYImportacion; this.gridBagConstraintsValorRubroVariable.gridx = iPosXImportacion++; this.jPanelImportacionValorRubroVariable.add(this.jButtonGenerarImportacionValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //BOTON CERRAR this.jButtonCerrarImportacionValorRubroVariable = new JButtonMe(); this.jButtonCerrarImportacionValorRubroVariable.setText("Cancelar"); FuncionesSwing.addImagenButtonGeneral(this.jButtonCerrarImportacionValorRubroVariable,"cerrar_reporte_dinamico_button","Cancelar"); this.jButtonCerrarImportacionValorRubroVariable.setToolTipText("Cancelar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO); this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYImportacion; this.gridBagConstraintsValorRubroVariable.gridx = iPosXImportacion++; this.jPanelImportacionValorRubroVariable.add(this.jButtonCerrarImportacionValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //GLOBAL AGREGAR PANELES GridBagLayout gridaBagLayoutImportacionPrincipalValorRubroVariable = new GridBagLayout(); this.jScrollPanelImportacionValorRubroVariable= new JScrollPane(jPanelImportacionValorRubroVariable,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); iPosXImportacion=0; iPosYImportacion=0; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy =iPosYImportacion; this.gridBagConstraintsValorRubroVariable.gridx =iPosXImportacion; this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.BOTH; this.jInternalFrameImportacionValorRubroVariable.setContentPane(new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true)); this.jInternalFrameImportacionValorRubroVariable.getContentPane().setLayout(gridaBagLayoutImportacionPrincipalValorRubroVariable); this.jInternalFrameImportacionValorRubroVariable.getContentPane().add(this.jScrollPanelImportacionValorRubroVariable, this.gridBagConstraintsValorRubroVariable); } */ /* public void cargarOrderByValorRubroVariable(Boolean cargaMinima) throws Exception { String sMapKey = ""; InputMap inputMap =null; int iWidthOrderBy=350; int iHeightOrderBy=300;//400; int iPosXOrderBy=0; int iPosYOrderBy=0; if(!cargaMinima) { this.jButtonAbrirOrderByValorRubroVariable = new JButtonMe(); this.jButtonAbrirOrderByValorRubroVariable.setText("Orden"); this.jButtonAbrirOrderByValorRubroVariable.setToolTipText("Orden"+FuncionesSwing.getKeyMensaje("ORDEN")); FuncionesSwing.addImagenButtonGeneral(this.jButtonAbrirOrderByValorRubroVariable,"orden_button","Orden"); FuncionesSwing.setBoldButton(this.jButtonAbrirOrderByValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; sMapKey = "AbrirOrderByValorRubroVariable"; inputMap = this.jButtonAbrirOrderByValorRubroVariable.getInputMap(FuncionesSwing.getTipoFocusedKeyEvent("NORMAL")); inputMap.put(KeyStroke.getKeyStroke(FuncionesSwing.getKeyEvent("ORDEN") , FuncionesSwing.getMaskKey("ORDEN")), sMapKey); this.jButtonAbrirOrderByValorRubroVariable.getActionMap().put(sMapKey,new ButtonAbstractAction(this,"AbrirOrderByValorRubroVariable")); GridBagLayout gridaBagLayoutOrderByValorRubroVariable = new GridBagLayout(); //PANEL this.jPanelOrderByValorRubroVariable = new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true); this.jPanelOrderByValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("Campos")); this.jPanelOrderByValorRubroVariable.setName("jPanelOrderByValorRubroVariable"); this.jPanelOrderByValorRubroVariable.setMinimumSize(new Dimension(iWidthOrderBy,iHeightOrderBy)); this.jPanelOrderByValorRubroVariable.setMaximumSize(new Dimension(iWidthOrderBy,iHeightOrderBy)); this.jPanelOrderByValorRubroVariable.setPreferredSize(new Dimension(iWidthOrderBy,iHeightOrderBy)); FuncionesSwing.setBoldPanel(this.jPanelOrderByValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; this.jPanelOrderByValorRubroVariable.setLayout(gridaBagLayoutOrderByValorRubroVariable); this.jTableDatosValorRubroVariableOrderBy = new JTableMe(); this.jTableDatosValorRubroVariableOrderBy.setAutoCreateRowSorter(true); FuncionesSwing.setBoldTable(jTableDatosValorRubroVariableOrderBy,STIPO_TAMANIO_GENERAL,false,true,this); this.jScrollPanelDatosValorRubroVariableOrderBy = new JScrollPane(); this.jScrollPanelDatosValorRubroVariableOrderBy.setBorder(javax.swing.BorderFactory.createTitledBorder("Orden")); this.jScrollPanelDatosValorRubroVariableOrderBy.setViewportView(this.jTableDatosValorRubroVariableOrderBy); this.jTableDatosValorRubroVariableOrderBy.setFillsViewportHeight(true); this.jTableDatosValorRubroVariableOrderBy.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); this.jInternalFrameOrderByValorRubroVariable= new OrderByJInternalFrame(); this.jInternalFrameOrderByValorRubroVariable= new OrderByJInternalFrame(); this.jScrollPanelOrderByValorRubroVariable = new JScrollPane(); //PANEL_CONTROLES //this.jScrollColumnasSelectReporteValorRubroVariable= new JScrollPane(); //JINTERNAL FRAME OrderBy this.jInternalFrameOrderByValorRubroVariable.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); this.jInternalFrameOrderByValorRubroVariable.setjInternalFrameParent(this); this.jInternalFrameOrderByValorRubroVariable.setTitle("Orden"); this.jInternalFrameOrderByValorRubroVariable.setSize(iWidthOrderBy+70,iHeightOrderBy+100); this.jInternalFrameOrderByValorRubroVariable.setLocation(xOffset*(openFrameCount + Constantes.INUM_MAX_VENTANAS_DET_X), yOffset*(openFrameCount+Constantes.INUM_MAX_VENTANAS_DET_Y)); this.jInternalFrameOrderByValorRubroVariable.setResizable(true); this.jInternalFrameOrderByValorRubroVariable.setClosable(true); this.jInternalFrameOrderByValorRubroVariable.setMaximizable(true); //FuncionesSwing.setBoldPanel(this.jInternalFrameOrderByValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; //SCROLL PANEL this.jScrollPanelOrderByValorRubroVariable.setMinimumSize(new Dimension(iWidthOrderBy,iHeightOrderBy)); this.jScrollPanelOrderByValorRubroVariable.setMaximumSize(new Dimension(iWidthOrderBy,iHeightOrderBy)); this.jScrollPanelOrderByValorRubroVariable.setPreferredSize(new Dimension(iWidthOrderBy,iHeightOrderBy)); FuncionesSwing.setBoldScrollPanel(this.jScrollPanelOrderByValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; this.jScrollPanelOrderByValorRubroVariable.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos Valor Rubro Variables")); //DATOS TOTALES this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy =iPosYOrderBy++; this.gridBagConstraintsValorRubroVariable.gridx =iPosXOrderBy; this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.BOTH; //this.gridBagConstraintsValorRubroVariable.ipady =150; this.jPanelOrderByValorRubroVariable.add(jScrollPanelDatosValorRubroVariableOrderBy, this.gridBagConstraintsValorRubroVariable);//this.jTableDatosValorRubroVariableTotales //BOTON CERRAR this.jButtonCerrarOrderByValorRubroVariable = new JButtonMe(); this.jButtonCerrarOrderByValorRubroVariable.setText("Salir"); FuncionesSwing.addImagenButtonGeneral(this.jButtonCerrarOrderByValorRubroVariable,"cerrar","Salir");//cerrar_reporte_dinamico_button this.jButtonCerrarOrderByValorRubroVariable.setToolTipText("Cancelar"+" "+ValorRubroVariableConstantesFunciones.SCLASSWEBTITULO); FuncionesSwing.setBoldButton(this.jButtonCerrarOrderByValorRubroVariable, STIPO_TAMANIO_GENERAL,false,true,this);; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.VERTICAL; this.gridBagConstraintsValorRubroVariable.gridy = iPosYOrderBy++; this.gridBagConstraintsValorRubroVariable.gridx = iPosXOrderBy; this.jPanelOrderByValorRubroVariable.add(this.jButtonCerrarOrderByValorRubroVariable, this.gridBagConstraintsValorRubroVariable); //GLOBAL AGREGAR PANELES GridBagLayout gridaBagLayoutOrderByPrincipalValorRubroVariable = new GridBagLayout(); this.jScrollPanelOrderByValorRubroVariable= new JScrollPane(jPanelOrderByValorRubroVariable,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); iPosXOrderBy=0; iPosYOrderBy=0; this.gridBagConstraintsValorRubroVariable = new GridBagConstraints(); this.gridBagConstraintsValorRubroVariable.gridy =iPosYOrderBy; this.gridBagConstraintsValorRubroVariable.gridx =iPosXOrderBy; this.gridBagConstraintsValorRubroVariable.fill = GridBagConstraints.BOTH; this.jInternalFrameOrderByValorRubroVariable.setContentPane(new JPanelMe(FuncionesSwing.getFondoImagen(parametroGeneralUsuario.getid_tipo_fondo()),true)); this.jInternalFrameOrderByValorRubroVariable.getContentPane().setLayout(gridaBagLayoutOrderByPrincipalValorRubroVariable); this.jInternalFrameOrderByValorRubroVariable.getContentPane().add(this.jScrollPanelOrderByValorRubroVariable, this.gridBagConstraintsValorRubroVariable); } else { this.jButtonAbrirOrderByValorRubroVariable = new JButtonMe(); } } */ public void redimensionarTablaDatos(int iNumFilas) { this.redimensionarTablaDatos(iNumFilas,0); } public void redimensionarTablaDatos(int iNumFilas,int iTamanioFilaTabla) { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int iWidthTable=screenSize.width*2;//screenSize.width - (screenSize.width/8); int iWidthTableScroll=screenSize.width - (screenSize.width/8); int iWidthTableCalculado=0;//1230 int iHeightTable=0;//screenSize.height/3; int iHeightTableTotal=0; //ANCHO COLUMNAS SIMPLES iWidthTableCalculado+=630; //ANCHO COLUMNAS OCULTAS if(Constantes.ISDEVELOPING) { iWidthTableCalculado+=600; } //ANCHO COLUMNAS RELACIONES iWidthTableCalculado+=0; //ESPACION PARA SELECT RELACIONES if(this.conMaximoRelaciones && this.valorrubrovariableSessionBean.getConGuardarRelaciones() ) { } //SI CALCULADO ES MENOR QUE MAXIMO /* if(iWidthTableCalculado<=iWidthTable) { iWidthTable=iWidthTableCalculado; } */ //SI TABLA ES MENOR QUE SCROLL if(iWidthTableCalculado<=iWidthTableScroll) { iWidthTableScroll=iWidthTableCalculado; } //NO VALE SIEMPRE PONE TAMANIO COLUMNA 200 /* int iTotalWidth=0; int iWidthColumn=0; int iCountColumns=this.jTableDatosValorRubroVariable.getColumnModel().getColumnCount(); if(iCountColumns>0) { for(int i = 0; i < this.jTableDatosValorRubroVariable.getColumnModel().getColumnCount(); i++) { TableColumn column = this.jTableDatosValorRubroVariable.getColumnModel().getColumn(i); iWidthColumn=column.getWidth(); iTotalWidth+=iWidthColumn; } //iWidthTableCalculado=iTotalWidth; } */ if(iTamanioFilaTabla<=0) { iTamanioFilaTabla=this.jTableDatosValorRubroVariable.getRowHeight();//ValorRubroVariableConstantesFunciones.ITAMANIOFILATABLA; } if(iNumFilas>0) { iHeightTable=(iNumFilas * iTamanioFilaTabla); } else { iHeightTable=iTamanioFilaTabla; } iHeightTableTotal=iHeightTable; if(!this.valorrubrovariableSessionBean.getEsGuardarRelacionado()) { if(iHeightTable > ValorRubroVariableConstantesFunciones.TAMANIO_ALTO_MAXIMO_TABLADATOS) { //Constantes.ISWING_TAMANIOMAXIMO_TABLADATOS) { //SI SE SELECCIONA MAXIMO TABLA SE AMPLIA A ALTO MAXIMO DE SCROLL, PARA QUE SCROLL NO SEA TAN PEQUE?O if(!this.jCheckBoxConAltoMaximoTablaValorRubroVariable.isSelected()) { iHeightTable=ValorRubroVariableConstantesFunciones.TAMANIO_ALTO_MAXIMO_TABLADATOS; //Constantes.ISWING_TAMANIOMAXIMO_TABLADATOS; } else { iHeightTable=iHeightTableTotal + FuncionesSwing.getValorProporcion(iHeightTableTotal,30); } } else { if(iHeightTable < ValorRubroVariableConstantesFunciones.TAMANIO_ALTO_MINIMO_TABLADATOS) {//Constantes.ISWING_TAMANIOMINIMO_TABLADATOS) { iHeightTable=ValorRubroVariableConstantesFunciones.TAMANIO_ALTO_MINIMO_TABLADATOS; //Constantes.ISWING_TAMANIOMINIMO_TABLADATOS; } } } else { if(iHeightTable > ValorRubroVariableConstantesFunciones.TAMANIO_ALTO_MAXIMO_TABLADATOSREL) { //Constantes.ISWING_TAMANIOMAXIMO_TABLADATOS) { //SI SE SELECCIONA MAXIMO TABLA SE AMPLIA A ALTO MAXIMO DE SCROLL, PARA QUE SCROLL NO SEA TAN PEQUE?O if(!this.jCheckBoxConAltoMaximoTablaValorRubroVariable.isSelected()) { iHeightTable=ValorRubroVariableConstantesFunciones.TAMANIO_ALTO_MAXIMO_TABLADATOSREL; //Constantes.ISWING_TAMANIOMAXIMO_TABLADATOS; } else { iHeightTable=iHeightTableTotal + FuncionesSwing.getValorProporcion(iHeightTableTotal,30); } } else { if(iHeightTable < ValorRubroVariableConstantesFunciones.TAMANIO_ALTO_MINIMO_TABLADATOSREL) {//Constantes.ISWING_TAMANIOMINIMO_TABLADATOS) { iHeightTable=ValorRubroVariableConstantesFunciones.TAMANIO_ALTO_MINIMO_TABLADATOSREL; //Constantes.ISWING_TAMANIOMINIMO_TABLADATOS; } } } //OJO:SE DESHABILITA CALCULADO //NO SE UTILIZA CALCULADO SI POR DEFINICION if(iWidthTableDefinicion>0) { iWidthTableCalculado=iWidthTableDefinicion; } this.jTableDatosValorRubroVariable.setMinimumSize(new Dimension(iWidthTableCalculado,iHeightTableTotal)); this.jTableDatosValorRubroVariable.setMaximumSize(new Dimension(iWidthTableCalculado,iHeightTableTotal)); this.jTableDatosValorRubroVariable.setPreferredSize(new Dimension(iWidthTableCalculado,iHeightTableTotal));//iWidthTable this.jScrollPanelDatosValorRubroVariable.setMinimumSize(new Dimension(iWidthTableScroll,iHeightTable)); this.jScrollPanelDatosValorRubroVariable.setMaximumSize(new Dimension(iWidthTableScroll,iHeightTable)); this.jScrollPanelDatosValorRubroVariable.setPreferredSize(new Dimension(iWidthTableScroll,iHeightTable)); //ORDER BY //OrderBy int iHeightTableOrderBy=0; int iNumFilasOrderBy=this.arrOrderBy.size(); int iTamanioFilaTablaOrderBy=0; if(this.jInternalFrameOrderByValorRubroVariable!=null && this.jInternalFrameOrderByValorRubroVariable.getjTableDatosOrderBy()!=null) { //if(!this.valorrubrovariableSessionBean.getEsGuardarRelacionado()) { iTamanioFilaTablaOrderBy=this.jInternalFrameOrderByValorRubroVariable.getjTableDatosOrderBy().getRowHeight(); if(iNumFilasOrderBy>0) { iHeightTableOrderBy=iNumFilasOrderBy * iTamanioFilaTablaOrderBy; } else { iHeightTableOrderBy=iTamanioFilaTablaOrderBy; } this.jInternalFrameOrderByValorRubroVariable.getjTableDatosOrderBy().setMinimumSize(new Dimension(Constantes2.ISWING_TAMANIO_ANCHO_TABLADATOS_ORDERBY,iHeightTableOrderBy));//iWidthTableCalculado/4 this.jInternalFrameOrderByValorRubroVariable.getjTableDatosOrderBy().setMaximumSize(new Dimension(Constantes2.ISWING_TAMANIO_ANCHO_TABLADATOS_ORDERBY,iHeightTableOrderBy)); this.jInternalFrameOrderByValorRubroVariable.getjTableDatosOrderBy().setPreferredSize(new Dimension(Constantes2.ISWING_TAMANIO_ANCHO_TABLADATOS_ORDERBY,iHeightTableOrderBy));//iWidthTable this.jInternalFrameOrderByValorRubroVariable.getjScrollPanelDatosOrderBy().setMinimumSize(new Dimension(Constantes2.ISWING_TAMANIO_ANCHO_TABLADATOS_ORDERBY+30,Constantes2.ISWING_TAMANIO_ALTO_TABLADATOS_ORDERBY));//iHeightTableOrderBy,iWidthTableScroll this.jInternalFrameOrderByValorRubroVariable.getjScrollPanelDatosOrderBy().setMaximumSize(new Dimension(Constantes2.ISWING_TAMANIO_ANCHO_TABLADATOS_ORDERBY+30,Constantes2.ISWING_TAMANIO_ALTO_TABLADATOS_ORDERBY)); this.jInternalFrameOrderByValorRubroVariable.getjScrollPanelDatosOrderBy().setPreferredSize(new Dimension(Constantes2.ISWING_TAMANIO_ANCHO_TABLADATOS_ORDERBY+30,Constantes2.ISWING_TAMANIO_ALTO_TABLADATOS_ORDERBY)); } //ORDER BY //this.jScrollPanelDatosValorRubroVariable.setMinimumSize(new Dimension(iWidthTableScroll,iHeightTable)); //this.jScrollPanelDatosValorRubroVariable.setMaximumSize(new Dimension(iWidthTableScroll,iHeightTable)); //this.jScrollPanelDatosValorRubroVariable.setPreferredSize(new Dimension(iWidthTableScroll,iHeightTable)); //VERSION 0 /* //SI CALCULADO ES MENOR QUE MAXIMO if(iWidthTableCalculado<=iWidthTable) { iWidthTable=iWidthTableCalculado; } //SI TABLA ES MENOR QUE SCROLL if(iWidthTable<=iWidthTableScroll) { iWidthTableScroll=iWidthTable; } */ } public void redimensionarTablaDatosConTamanio(int iTamanioFilaTabla) throws Exception { int iSizeTabla=0; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { iSizeTabla=valorrubrovariableLogic.getValorRubroVariables().size(); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { iSizeTabla=valorrubrovariables.size(); } //ARCHITECTURE this.redimensionarTablaDatos(iSizeTabla,iTamanioFilaTabla); } //PARA REPORTES public static List<ValorRubroVariable> TraerValorRubroVariableBeans(List<ValorRubroVariable> valorrubrovariables,ArrayList<Classe> classes)throws Exception { try { for(ValorRubroVariable valorrubrovariable:valorrubrovariables) { if(!(ValorRubroVariableConstantesFunciones.S_TIPOREPORTE_EXTRA.equals(Constantes2.S_REPORTE_EXTRA_GROUP_GENERICO) || ValorRubroVariableConstantesFunciones.S_TIPOREPORTE_EXTRA.equals(Constantes2.S_REPORTE_EXTRA_GROUP_TOTALES_GENERICO)) ) { valorrubrovariable.setsDetalleGeneralEntityReporte(ValorRubroVariableConstantesFunciones.getValorRubroVariableDescripcion(valorrubrovariable)); } else { //valorrubrovariable.setsDetalleGeneralEntityReporte(valorrubrovariable.getsDetalleGeneralEntityReporte()); } //valorrubrovariablebeans.add(valorrubrovariablebean); } } catch(Exception ex) { throw ex; } return valorrubrovariables; } //PARA REPORTES FIN }
50.930595
376
0.819596
43d3ed9b7ddb690d02e2f5d2a10ccbe793abbbe2
815
package com.heilou.iot.packet; import com.heilou.iot.support.ChannelAttributeHelper; import io.netty.channel.Channel; import io.netty.handler.codec.mqtt.MqttMessageIdVariableHeader; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; /** * @description: PUBCOMP连接处理 * @author heilou * @date 2021/4/2 10:08 * @version 1.0 */ @Slf4j @Component public class PubCompPacket { public void processPubComp(Channel channel, MqttMessageIdVariableHeader variableHeader){ int messageId = variableHeader.messageId(); log.info("PUBCOMP - clientId: {}, messageId: {}", ChannelAttributeHelper.getClientId(channel), messageId); // DupPubRelMessageStoreService.remove((String)channel.attr(AttributeKey.valueOf("clientId")).get(), variableHeader.messageId()); } }
32.6
136
0.759509
9cd334885d8d4fc2019a6483ea362761f8b43291
649
package swift.crdt.core; import swift.api.CRDTIdentifier; import swift.clocks.CausalityClock; import sys.KryoLib; public class ObjectUpdatesInfo { protected CausalityClock pruneClock; protected CRDTObjectUpdatesGroup<?> update; public ObjectUpdatesInfo() { } public ObjectUpdatesInfo(CausalityClock pruneClock, CRDTObjectUpdatesGroup<?> update) { this.update = update; this.pruneClock = pruneClock; } /** * @return id of the object */ public CRDTIdentifier getId() { return update.id; } public ObjectUpdatesInfo clone() { return KryoLib.copy(this); } public CausalityClock getPruneClock() { return pruneClock; } }
18.542857
88
0.750385
8c56ac8527c85d04189049b9ccd8fdfc01b34260
2,900
package com.youngmanster.collectionlibrary.utils; /** * @author yangyan * @Date on 2019/8/17 * @ Description: */ import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * 1. 线程池管理类 */ public class ThreadPoolManager { //1.将请求任务放到请求队列中 //通过阻塞式队列来存储任务 private LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<>(); //2.把队列中的任务放到线程池 private ThreadPoolExecutor threadPoolExecutor; private LinkedBlockingQueue<Runnable> removeTask = new LinkedBlockingQueue<>(); //单例模式 private static ThreadPoolManager singleInstance = new ThreadPoolManager(); public static ThreadPoolManager getSingleInstance() { return singleInstance; } //私有化的构造方法 private ThreadPoolManager() { threadPoolExecutor = new ThreadPoolExecutor(4, 20, 15, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(4), rejectedExecutionHandler); //运行线程池 threadPoolExecutor.execute(runnable); } //添加任务 public void execute(Runnable runnable) { if (runnable != null) { try { queue.put(runnable); } catch (InterruptedException e) { e.printStackTrace(); } } } //当线程数超过maxPoolSize或者keep-alive时间超时时执行拒绝策略 private RejectedExecutionHandler rejectedExecutionHandler = new RejectedExecutionHandler() { /** * @param runnable 超时被线程池抛弃的线程 * @param threadPoolExecutor */ @Override public void rejectedExecution(Runnable runnable, ThreadPoolExecutor threadPoolExecutor) { //将该线程重新放入请求队列中 try { queue.put(runnable); } catch (InterruptedException e) { e.printStackTrace(); } } }; //3.让他们开始工作起来 //整个的工作线程 private Runnable runnable = new Runnable() { @Override public void run() { while (true) { Runnable runnable = null; //不断从从请求队列中取出请求 try { runnable = queue.take(); } catch (InterruptedException e) { e.printStackTrace(); } //如果不为空,放入线程池中执行 if (runnable != null) { if (!removeTask.contains(runnable)) { threadPoolExecutor.execute(runnable); } } } } }; public void remove(Runnable runnable) { try { removeTask.put(runnable); } catch (InterruptedException e) { e.printStackTrace(); } } public void reset() { removeTask.clear(); queue.clear(); } }
27.619048
144
0.583103
e0e40ed6a9444b2bf476416aced95b94637cbf4e
6,864
package com.misscellapp.news.article; import android.animation.ObjectAnimator; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.annotation.Nullable; import android.util.Log; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.webkit.WebSettings; import android.webkit.WebView; import android.widget.ImageButton; import android.widget.RelativeLayout; import com.misscellapp.news.BaseActivity; import com.misscellapp.news.comment.CommentActivity; import com.misscellapp.news.Feed; import com.misscellapp.news.R; import com.misscellapp.news.utils.ErrorListener; import com.misscellapp.news.utils.Listener; import com.misscellapp.news.utils.NetworkRequest; import com.misscellapp.news.utils.Utils; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import static android.text.TextUtils.isEmpty; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; /** * Created by jishichen on 2017/5/2. */ public class DetailsActivity extends BaseActivity implements Listener<Article>, ErrorListener, JSCallback, View.OnClickListener { private static final int TAG_SHARE = 233; private static final int TAG_FAVORITE = 234; private static final int TAG_COMMENT = 235; private WebView mWebView; private Feed mFeed; private Article mArticle; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_details); Bundle args = getIntent().getExtras(); mFeed = args.getParcelable("feed"); String url = mFeed.url; findViewById(R.id.title_layout).setOnClickListener(this); mWebView = (WebView) findViewById(R.id.web_view); mWebView.setHorizontalScrollBarEnabled(false); mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); WebSettings settings = mWebView.getSettings(); settings.setJavaScriptEnabled(true); mWebView.addJavascriptInterface(new JavaScriptBridge(this), "U148"); showLoading(); NetworkRequest.getInstance().getArticle(url, Article.class, this, this); generateButtons(); } @Override public void onResponse(Article response) { hideLoading(); if (null == response) return; mArticle = response; renderPage(response); } @Override public void onErrorResponse() { setError(); } @Override public void onImageClicked(String url) { Intent intent = new Intent(this, ImageActivity.class); intent.putExtra("imgsrc", url); intent.putStringArrayListExtra("image_list", mArticle.imageList); startActivity(intent); } @Override public void onVideoClicked(String url) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(url)); startActivity(intent); } @Override public void onThemeChange() { } private void renderPage(Article article) { Document doc = Jsoup.parse(article.content); if (null == doc) return; handleVideos(doc); article.content = doc.html(); String template = Utils.readFromAssets(this, "usite.html"); template = template.replace("{TITLE}", mFeed.title); template = template.replace("{U_AUTHOR}", mFeed.time); template = template.replace("{U_COMMENT}", mFeed.views); template = template.replace("{CONTENT}", article.content); mWebView.loadDataWithBaseURL(null, template, "text/html", "UTF-8", null); } private void handleVideos(Document doc) { Elements videos = doc.select("p"); String videoText = getString(R.string.video_url); for (Element el : videos) { String text = el.text(); if (!isEmpty(text) && text.contains(videoText)) { Elements links = el.select("a"); if (null != links && links.size() > 0) { String url = links.get(0).attr("href"); String html = videoText + ":<a href=\"" + url + "\">" + url + "</a><img src=\"file:///android_asset/video.png\" title=\"" + url + "\" />"; el.html(html); } } } } @Override public void onClick(View v) { if (v.getId() == R.id.title_layout) { ObjectAnimator animator = ObjectAnimator.ofInt(mWebView, "scrollY", mWebView.getScrollY(), 0); animator.setDuration(360); animator.setInterpolator(new AccelerateInterpolator()); animator.start(); return; } if (null == v.getTag()) return; int tag = (Integer) v.getTag(); switch (tag) { case TAG_COMMENT: if (mFeed.commentNum > 0) { Intent intent = new Intent(this, CommentActivity.class); intent.putExtra("post_id", mFeed.id); startActivity(intent); } else { Utils.toast(this, R.string.no_comments); } break; } } private void generateButtons() { RelativeLayout layout = (RelativeLayout) findViewById(R.id.right_view); layout.removeAllViews(); int[] icons = {R.drawable.ic_social_share, R.drawable.ic_favorite, R.drawable.ic_comment}; // if (mDatabase.isFavorite(mFeed.url)) { // icons[1] = R.drawable.ic_favorite_full; // } for (int i = 0; i < icons.length; i++) { RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(dp2px(48), MATCH_PARENT); lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); lp.rightMargin = i * dp2px(48); ImageButton button = getImageButton(icons[i]); button.setTag(i + TAG_SHARE); button.setOnClickListener(this); layout.addView(button, lp); } if (mFeed.commentNum > 0) { RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(dp2px(12), dp2px(12)); lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); lp.rightMargin = dp2px(48) * 2 + dp2px(4); lp.topMargin = dp2px(8); CircleView numView = new CircleView(this); numView.setNumber(mFeed.commentNum); layout.addView(numView, lp); } } protected ImageButton getImageButton(int resId) { ImageButton button = new ImageButton(this); button.setBackgroundResource(R.drawable.highlight_bkg); button.setImageResource(resId); return button; } }
33.647059
104
0.627477
aec1cb6391c7cd43369dca93769ba3a78fa962c2
3,632
package ru.intertrust.cm.core.business.schedule; import java.text.ParseException; import java.util.HashSet; import java.util.Set; import javax.ejb.EJBContext; import javax.ejb.SessionContext; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import static org.mockito.Mockito.*; import org.mockito.runners.MockitoJUnitRunner; import ru.intertrust.cm.core.business.api.ClusterManager; import ru.intertrust.cm.core.business.api.ScheduleService; import ru.intertrust.cm.core.business.api.schedule.ScheduleTask; import ru.intertrust.cm.core.business.api.schedule.ScheduleTaskHandle; import ru.intertrust.cm.core.business.api.schedule.ScheduleTaskParameters; import ru.intertrust.cm.core.business.shedule.ScheduleTaskLoaderImpl; @RunWith(MockitoJUnitRunner.class) public class TestSchedule { @Mock private ClusterManager clusterManager; @InjectMocks private ScheduleTaskLoaderImpl taskLoaderImpl = new ScheduleTaskLoaderImpl(); private class ScheduleTaskLoaderImplInt extends ScheduleTaskLoaderImpl { public String getDefaultParametersInt(ScheduleTask configuration) { return getDefaultParameters(configuration); } } @ScheduleTask(name = "TestScheduleWithDefaultParams", minute = "*/1", configClass = DefaultParameter.class) public class TestScheduleWithDefaultParams implements ScheduleTaskHandle { @Override public String execute(EJBContext ejbContext, SessionContext sessionContext, ScheduleTaskParameters parameters) { return "OK"; } } @Test public void testLoadDefaultParameters() throws ParseException { String etalon = "<scheduleTaskConfig>\n"; etalon += " <parameters class=\"ru.intertrust.cm.core.business.schedule.Parameters\">\n"; etalon += " <parameters result=\"OK\"/>\n"; etalon += " </parameters>\n"; etalon += "</scheduleTaskConfig>"; ScheduleTaskLoaderImplInt sheduleTaskLoader = new ScheduleTaskLoaderImplInt(); ScheduleTask configuration = TestScheduleWithDefaultParams.class.getAnnotation(ScheduleTask.class); String result = sheduleTaskLoader.getDefaultParametersInt(configuration); Assert.assertTrue("Check schedulr param", result.equals(etalon)); } @Test public void testClusterGetNextNode() throws ParseException { Set<String> nodes = new HashSet<String>(); //Одна доступная нода nodes.add("aaa"); when(clusterManager.getNodesWithRole(ScheduleService.SCHEDULE_EXECUTOR_ROLE_NAME)).thenReturn(nodes); String nodeId1, nodeId2, nodeId3; nodeId1 = taskLoaderImpl.getNextNodeId(); Assert.assertTrue("Check return node", nodeId1 != null); //2 доступных ноды nodes.add("bbb"); nodeId1 = taskLoaderImpl.getNextNodeId(); nodeId2 = taskLoaderImpl.getNextNodeId(); Assert.assertTrue("Check return node", nodeId1 != null && nodeId2 != null); Assert.assertTrue("Check node different", !nodeId1.equals(nodeId2)); //3 доступных ноды nodes.add("ccc"); nodeId1 = taskLoaderImpl.getNextNodeId(); nodeId2 = taskLoaderImpl.getNextNodeId(); nodeId3 = taskLoaderImpl.getNextNodeId(); Assert.assertTrue("Check return node", nodeId1 != null && nodeId2 != null && nodeId3 != null); Assert.assertTrue("Check node different", !nodeId1.equals(nodeId2) && !nodeId1.equals(nodeId3) && !nodeId2.equals(nodeId3)); } }
37.833333
132
0.709251
9351b4d9468adf7399fcd9a804760438901c4998
2,448
package com.experts.core.biller.statemachine.api.rovo.awsxray.config.mdc; import org.apache.camel.AsyncCallback; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.TypeConversionException; import org.apache.camel.impl.MDCUnitOfWork; import org.apache.camel.spi.UnitOfWork; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; import java.lang.invoke.MethodHandles; public class CustomMDCUnitOfWork extends MDCUnitOfWork { private static Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); protected final String[] headerNames; public CustomMDCUnitOfWork(Exchange exchange) { super(exchange); this.headerNames = new String[] { "SomeDefaultHeader" }; } public CustomMDCUnitOfWork(Exchange exchange, final String[] headerNames) { super(exchange); this.headerNames = headerNames; } @Override public UnitOfWork newInstance(Exchange exchange) { return new CustomMDCUnitOfWork(exchange); } protected String[] getHeaderNames() { return headerNames; } private void addOptional(Exchange exchange, String headerName) { String optionalValue; try { optionalValue = exchange.getIn().getHeader(headerName, String.class); if (optionalValue != null) { MDC.put(headerName, optionalValue); LOG.trace("Adding header ({}={}) to MDC logging", headerName, optionalValue); } } catch (TypeConversionException e) { LOG.warn(e.getMessage(), e); } } @Override public AsyncCallback beforeProcess(Processor processor, Exchange exchange, AsyncCallback callback) { for (String headerName : getHeaderNames()) { addOptional(exchange, headerName); } return super.beforeProcess(processor, exchange, callback); } @Override public String toString() { StringBuilder strb = new StringBuilder(); for (String headerName : getHeaderNames()) { strb.append(headerName); strb.append(";"); } return "CustomMDCUnitOfWork [" + strb.toString() + "]"; } @Override public void clear() { super.clear(); for (String headerName : getHeaderNames()) { MDC.remove(headerName); } } }
29.493976
94
0.646242
0daab1f247a0096b5a9dda9b42e89f5587de1537
1,023
package com.diboot.wechat.open.service; import com.diboot.wechat.open.model.WxMemberCardInfo; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.mp.api.WxMpCardService; public interface WxMpMemberCardService extends WxMpCardService { final String CARD_CREATE = "https://api.weixin.qq.com/card/create"; final String CARD_UPDATE = "https://api.weixin.qq.com/card/update"; final String CARD_MSG_CONTENT = "https://api.weixin.qq.com/card/mpnews/gethtml"; /*** * 创建会员卡 * @param model * @return * @throws WxErrorException */ boolean createCard(WxMemberCardInfo model) throws WxErrorException; /*** * 更新会员卡 * @param model * @return * @throws WxErrorException */ boolean updateCard(WxMemberCardInfo model) throws WxErrorException; /*** * 获取会员卡消息推送的消息内容,群发卡券时使用 * @param cardId * @return * @throws WxErrorException */ String getMessageContent(String cardId) throws WxErrorException; }
27.648649
84
0.697947
f186b29f4c8ab784fda92e6b492e1c1fab80d4d7
3,212
package es.udc.fi.dc.fd.test.unit.dtos; import es.udc.fi.dc.fd.controller.chat.ChatMessage; import es.udc.fi.dc.fd.dtos.AgeUserProfileDto; import es.udc.fi.dc.fd.dtos.AgelessUserProfileDto; import es.udc.fi.dc.fd.dtos.BlockDto; import es.udc.fi.dc.fd.dtos.DateUserProfileDto; import es.udc.fi.dc.fd.dtos.ErrorsDto; import es.udc.fi.dc.fd.dtos.FieldErrorDto; import es.udc.fi.dc.fd.dtos.FriendHeaderDto; import es.udc.fi.dc.fd.dtos.FullUserProfileDto; import es.udc.fi.dc.fd.dtos.IdDto; import es.udc.fi.dc.fd.dtos.ImageDataDto; import es.udc.fi.dc.fd.dtos.ImageDto; import es.udc.fi.dc.fd.dtos.LoginParamsDto; import es.udc.fi.dc.fd.dtos.MessageDetailsDto; import es.udc.fi.dc.fd.dtos.RateDto; import es.udc.fi.dc.fd.dtos.RatedFriendDto; import es.udc.fi.dc.fd.dtos.RegisterParamsDto; import es.udc.fi.dc.fd.dtos.SearchCriteriaDto; import es.udc.fi.dc.fd.dtos.SearchUsersDto; import es.udc.fi.dc.fd.dtos.UnratedFriendDto; import es.udc.fi.dc.fd.dtos.UserAuthenticatedDto; import es.udc.fi.dc.fd.test.utils.EntityTestUtils; import org.junit.jupiter.api.Test; class DtoTests { @Test void testAgelessUserProfileDto() { EntityTestUtils.testEntity(AgelessUserProfileDto.class); } @Test void testAgeUserProfileDto() { EntityTestUtils.testEntity(AgeUserProfileDto.class); } @Test void testRatedFriendDto() { EntityTestUtils.testEntity(RatedFriendDto.class); } @Test void testBlockDto() { EntityTestUtils.testEntity(BlockDto.class); } @Test void testErrorsDto() { EntityTestUtils.testEntity(ErrorsDto.class); } @Test void testFieldErrorDto() { EntityTestUtils.testEntity(FieldErrorDto.class); } @Test void testFriendDto() { EntityTestUtils.testEntity(UnratedFriendDto.class); } @Test void testGetFriendListOutDto() { EntityTestUtils.testEntity(RatedFriendDto.class); } @Test void testIdDto() { EntityTestUtils.testEntity(IdDto.class); } @Test void testImageCreationDto() { EntityTestUtils.testEntity(ImageDataDto.class); } @Test void testLoginParamsDto() { EntityTestUtils.testEntity(LoginParamsDto.class); } @Test void testRegisterParamsDto() { EntityTestUtils.testEntity(RegisterParamsDto.class); } @Test void testReturnedImagesDto() { EntityTestUtils.testEntity(ImageDto.class); } @Test void testSearchCriteriaDto() { EntityTestUtils.testEntity(SearchCriteriaDto.class); } @Test void testUpdateProfileInDto() { EntityTestUtils.testEntity(DateUserProfileDto.class); } @Test void testUserAuthenticatedDto() { EntityTestUtils.testEntity(UserAuthenticatedDto.class); } @Test void testUserDataDto() { EntityTestUtils.testEntity(FullUserProfileDto.class); } @Test void testChatMessage() { EntityTestUtils.testEntity(ChatMessage.class); } @Test void testRateDto() { EntityTestUtils.testEntity(RateDto.class); } @Test void testMessageDetailsDto() { EntityTestUtils.testEntity(MessageDetailsDto.class); } @Test void testFriendHeaderDto() { EntityTestUtils.testEntity(FriendHeaderDto.class); } @Test void testSearchUsersDto() { EntityTestUtils.testEntity(SearchUsersDto.class); } }
22.942857
60
0.744707
424f3cc8ff6c76a7455f515a9f492cfe6012a5cc
598
package edu.stanford.protege.webprotege.jackson; import com.fasterxml.jackson.annotation.JsonIncludeProperties; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import uk.ac.manchester.cs.owl.owlapi.OWLDatatypeRestrictionImpl; /** * Matthew Horridge * Stanford Center for Biomedical Informatics Research * 2021-09-21 */ @JsonTypeName("DatatypeRestriction") @JsonDeserialize(as = OWLDatatypeRestrictionImpl.class) @JsonIncludeProperties({"datatype", "facetRestrictions"}) public interface OWLDatatypeRestrictionMixin { }
31.473684
65
0.829431
f420e7d3f91835ce9212e768082c603618807b0e
358
package deltix.qsrv.hf.tickdb.pub; /** * Unchecked exception thrown by a cursor e.g. cursor.next() */ public class StreamCursorException extends CursorException { public StreamCursorException(String message) { super (message); } public StreamCursorException(String message, Throwable cause) { super(message, cause); } }
23.866667
67
0.698324
6fd512710f3f903de89d1284e0b51ce8a3bc629c
376
package backjun.level1; import java.math.BigInteger; import java.util.Scanner; public class Main1271 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); BigInteger n = sc.nextBigInteger(); BigInteger m = sc.nextBigInteger(); System.out.println(n.divide(m)); System.out.println(n.remainder(m)); } }
25.066667
44
0.654255
9e6610ea85373543594c25fa4d3fb3ad31134e9b
736
package de.mann.tictactoeframework.tictactoeGame; /** * Preference which player begins */ public enum FirstPlayerOrder { ALTERNATING(0), WINNER(1), LOSER(2), RANDOM(3), ALWAYS_FIRST_PLAYER(4), ALWAYS_SECOND_PLAYER(5); private int id; FirstPlayerOrder(int id) { this.id = id; } public static FirstPlayerOrder fromInt(int i) { switch (i) { case 0: return ALTERNATING; case 1: return WINNER; case 2: return LOSER; case 4: return ALWAYS_FIRST_PLAYER; case 5: return ALWAYS_SECOND_PLAYER; default: return RANDOM; } } }
23
100
0.532609
794e9d57f10b3d0bbdb68791fa897230d31e10cd
1,293
package org.psjava.algo.sequence.search; import java.util.Comparator; import java.util.function.Function; import org.psjava.ds.numbersystrem.IntegerDivisableNumberSystem; import org.psjava.formula.FloorDivide; public class BinarySearchFirst { public static <I, O> I search(IntegerDivisableNumberSystem<I> inputNumberSystem, Function<I, O> f, Comparator<O> sortedOrder, I begin, I end, O target, I def) { I r = searchFirstPositionCanBeInserted(inputNumberSystem, begin, end, target, f, sortedOrder); if (!r.equals(end) && f.apply(r).equals(target)) return r; else return def; } private static <I, O> I searchFirstPositionCanBeInserted(IntegerDivisableNumberSystem<I> ns, I begin, I end, O value, Function<I, O> f, Comparator<O> sortedOrder) { I one = ns.getOne(); I two = ns.add(one, one); while (ns.compare(begin, end) < 0) { I midKey = FloorDivide.calc(ns, ns.add(begin, end), two); O midValue = f.apply(midKey); if (sortedOrder.compare(midValue, value) < 0) begin = ns.add(midKey, one); else end = midKey; } return end; } private BinarySearchFirst() { } }
34.945946
169
0.614076
78fef5d68d67099f636931e93bd85fed2511f001
20,503
package andrevictor.com.jarbas.Telas; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Color; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.NavigationView; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.os.Bundle; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.LatLngBounds; import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.Polyline; import com.google.android.gms.maps.model.PolylineOptions; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.List; import andrevictor.com.jarbas.API.Direcoes; import andrevictor.com.jarbas.API.Utils; import andrevictor.com.jarbas.ClassesDiversas.AdapterListViewPrincipal; import andrevictor.com.jarbas.ClassesDiversas.AdapterListViewRota; import andrevictor.com.jarbas.ClassesDiversas.ItemListView; import andrevictor.com.jarbas.R; import static andrevictor.com.jarbas.API.Utils.EnderecoMercado; import static andrevictor.com.jarbas.API.Utils.LatitudeMercado; import static andrevictor.com.jarbas.API.Utils.LongitudeMercado; import static andrevictor.com.jarbas.API.Utils.controlaIntrucoesRota; import static andrevictor.com.jarbas.API.Utils.controlaPolilynesRota; import static andrevictor.com.jarbas.API.Utils.enderecoPromotor; import static andrevictor.com.jarbas.API.Utils.latitudePromotor; import static andrevictor.com.jarbas.API.Utils.listlatlong; import static andrevictor.com.jarbas.API.Utils.locais; import static andrevictor.com.jarbas.API.Utils.longitudePromotor; import static andrevictor.com.jarbas.API.Utils.lugares; import static andrevictor.com.jarbas.API.Utils.nomePromotor; import static andrevictor.com.jarbas.API.Utils.polilynesRota; import static andrevictor.com.jarbas.API.Utils.precoRota; import static andrevictor.com.jarbas.Telas.TelaPrincipal.adapterListView; import static andrevictor.com.jarbas.Telas.TelaPrincipal.itens; import static andrevictor.com.jarbas.Telas.TelaPrincipal.letrasAtivas; import static andrevictor.com.jarbas.Telas.TelaPrincipal.letrasVisitadas; import static andrevictor.com.jarbas.Telas.TelaPrincipal.linhaAtiva; import static andrevictor.com.jarbas.Telas.TelaPrincipal.listaPrincipal; public class TelaRota extends AppCompatActivity implements AdapterView.OnItemClickListener,OnMapReadyCallback,NavigationView.OnNavigationItemSelectedListener { //Array que copulam a listview private Polyline polyline; private AdapterListViewRota adapterListViewRota; private ArrayList<ItemListView> itensRota; public static ArrayList<String> arrayTarefa; int PosicaoList; //Componentes private GoogleMap mMap; ListView listaRota; FloatingActionButton btnFinalizarRota; TextView textPreco; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_rota); // Obtain the SupportMapFragment and get notified when the map is ready to be used. SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.fragmentPrincipal); mapFragment.getMapAsync(this); //Obtem a posicao do item clicado na lista da tela anterior Intent intent = getIntent(); Bundle bundle = intent.getExtras(); PosicaoList = bundle.getInt("posicao"); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); textPreco = (TextView) findViewById(R.id.textPreco); textPreco.setText("VALOR DA VIAGEM: R$0,00"); //Botao flutuante - Finalizar rota btnFinalizarRota = (FloatingActionButton) findViewById(R.id.fabConcluir); btnFinalizarRota.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(linhaAtiva == PosicaoList) { //Troca o icone,cor do texto e cor da linha ativa itens.get(linhaAtiva).setIconeRid(letrasVisitadas.get(linhaAtiva)); itens.get(linhaAtiva).setColor("#EBEBEB"); itens.get(linhaAtiva).setCorLinha("#A4A4A4"); //Troca o icone, cor do texto e cor da linha da proxima try{ itens.get(linhaAtiva + 1).setIconeRid(letrasAtivas.get(linhaAtiva + 1)); itens.get(linhaAtiva + 1).setColor("#26A79B"); itens.get(linhaAtiva + 1).setCorLinha("#FFFFFF"); }catch (IndexOutOfBoundsException e){ } ///////////////////////////////////////////////////////// listaPrincipal.setAdapter(adapterListView); linhaAtiva++; finish(); }else{ finish(); } } }); //Comeco da parte que mexe com menu lateral ////////////////////////////////////////////////////////////////////////////// DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.setDrawerListener(toggle); toggle.syncState(); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); //Fim da parte que mexe com menu lateral ////////////////////////////////////////////////////////////////////////////// listaRota = (ListView) findViewById(R.id.ListPrincipal); listaRota.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent intent = new Intent(getApplicationContext(), TelaRotaListViewCompleto.class); startActivity(intent); } }); createListView(); } private void createListView() { //Criamos nossa lista que preenchera o ListView itensRota = new ArrayList<ItemListView>(); arrayTarefa = new ArrayList<>(); int contador = 0; ItemListView item; if(linhaAtiva > 0 && linhaAtiva == PosicaoList){ for (contador = controlaIntrucoesRota.get(linhaAtiva-1); contador < controlaIntrucoesRota.get(linhaAtiva); contador++){ if (lugares.get(contador).toLowerCase().contains("ônibus")){ item = new ItemListView(lugares.get(contador), R.drawable.ic_onibus_g); }else if(lugares.get(contador).toLowerCase().contains("metro")){ item = new ItemListView(lugares.get(contador), R.drawable.ic_metro_g); }else if(lugares.get(contador).toLowerCase().contains("trem")){ item = new ItemListView(lugares.get(contador), R.drawable.ic_trem_g); }else{ item = new ItemListView(lugares.get(contador), R.drawable.ic_caminhar_g); } itensRota.add(item); arrayTarefa.add(lugares.get(contador)); } }else if(linhaAtiva == PosicaoList){ for (contador = 0; contador < controlaIntrucoesRota.get(linhaAtiva); contador++) { if (lugares.get(contador).toLowerCase().contains("ônibus")){ item = new ItemListView(lugares.get(contador), R.drawable.ic_onibus_g); }else if(lugares.get(contador).toLowerCase().contains("metro")){ item = new ItemListView(lugares.get(contador), R.drawable.ic_metro_g); }else if(lugares.get(contador).toLowerCase().contains("trem")){ item = new ItemListView(lugares.get(contador), R.drawable.ic_trem_g); }else{ item = new ItemListView(lugares.get(contador), R.drawable.ic_caminhar_g); } itensRota.add(item); arrayTarefa.add(lugares.get(contador)); } }else if(PosicaoList == 0 && linhaAtiva != PosicaoList){ for (contador = 0; contador < controlaIntrucoesRota.get(PosicaoList); contador++) { if (lugares.get(contador).toLowerCase().contains("ônibus")){ item = new ItemListView(lugares.get(contador), R.drawable.ic_onibus_g); }else if(lugares.get(contador).toLowerCase().contains("metro")){ item = new ItemListView(lugares.get(contador), R.drawable.ic_metro_g); }else if(lugares.get(contador).toLowerCase().contains("trem")){ item = new ItemListView(lugares.get(contador), R.drawable.ic_trem_g); }else{ item = new ItemListView(lugares.get(contador), R.drawable.ic_caminhar_g); } itensRota.add(item); arrayTarefa.add(lugares.get(contador)); } }else if(PosicaoList > 0 && linhaAtiva != PosicaoList){ for (contador = controlaIntrucoesRota.get(PosicaoList-1); contador < controlaIntrucoesRota.get(PosicaoList); contador++){ if (lugares.get(contador).toLowerCase().contains("ônibus")){ item = new ItemListView(lugares.get(contador), R.drawable.ic_onibus_g); }else if(lugares.get(contador).toLowerCase().contains("metro")){ item = new ItemListView(lugares.get(contador), R.drawable.ic_metro_g); }else if(lugares.get(contador).toLowerCase().contains("trem")){ item = new ItemListView(lugares.get(contador), R.drawable.ic_trem_g); }else{ item = new ItemListView(lugares.get(contador), R.drawable.ic_caminhar_g); } itensRota.add(item); arrayTarefa.add(lugares.get(contador)); } } //Cria o adapter adapterListViewRota = new AdapterListViewRota(this, itensRota); //Define o Adapter listaRota.setAdapter(adapterListViewRota); } //Todos os metodos abaixo tem a ver com o menu lateral ///////////////////////////////////////////////////////////////////////////////// //Faz aparecer o menu passando o dedo para o lado @Override public void onBackPressed() { DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); if (drawer.isDrawerOpen(GravityCompat.START)) { drawer.closeDrawer(GravityCompat.START); } else { super.onBackPressed(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); return super.onOptionsItemSelected(item); } @SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { // Handle navigation view item clicks here. int id = item.getItemId(); if (id == R.id.nav_principal) { finish(); } else if (id == R.id.nav_rotas) { HistoricoDeRotas(); } else if (id == R.id.nav_perfil) { //Vai pro perfil Intent intent = new Intent(getApplicationContext(), TelaPerfil.class); startActivity(intent); finish(); }else if (id == R.id.nav_informacoes) { //Vai pro informacoes Intent intent = new Intent(getApplicationContext(), TelaInformacoes.class); startActivity(intent); finish(); } else if (id == R.id.nav_sair) { //Vai pra tela de login //Intent intent = new Intent(getApplicationContext(), TelaLogin.class); //startActivity(intent); } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; } //Fim dos metodos que tem a ver com o menu lateral ///////////////////////////////////////////////////////////////////////////////// @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { } //Metodo para desenhar no mapa public void drawRoute(){ PolylineOptions po; if(polyline == null){ po = new PolylineOptions(); for(int i = 0, tam = listlatlong.size(); i < tam; i++){ po.add(listlatlong.get(i)); } po.color(Color.rgb(36,166,154)).width(8); polyline = mMap.addPolyline(po); } else { polyline.setPoints(listlatlong); } } @Override public void onMapReady(GoogleMap googleMap) { textPreco.setText("VALOR DA VIAGEM: R$"+ new DecimalFormat("#0.00").format(precoRota.get(PosicaoList))); mMap = googleMap; //mMap.setMyLocationEnabled(true); //Essa e a linha caso precise usar a localizacao mMap.setTrafficEnabled(false); //Tira os botoes de baixo no mapa final LatLng pontoA; final String nome1; final String desc1; final String nome2; final String desc2; //Marcador if(PosicaoList == 0){ pontoA = new LatLng(latitudePromotor,longitudePromotor); nome1 = nomePromotor; desc1 = enderecoPromotor; mMap.addMarker(new MarkerOptions().title(nomePromotor).snippet(enderecoPromotor).position(pontoA)); }else { pontoA = new LatLng(LatitudeMercado.get(PosicaoList-1), LongitudeMercado.get(PosicaoList-1)); nome1 = locais.get(PosicaoList-1); desc1 = EnderecoMercado.get(PosicaoList-1); mMap.addMarker(new MarkerOptions().title(locais.get(PosicaoList-1)).snippet(EnderecoMercado.get(PosicaoList-1)).position(pontoA)); } final LatLng pontoB; if(PosicaoList < locais.size() && PosicaoList == 0) { pontoB = new LatLng(LatitudeMercado.get(PosicaoList), LongitudeMercado.get(PosicaoList)); nome2 = locais.get(PosicaoList); desc2 = EnderecoMercado.get(PosicaoList); mMap.addMarker(new MarkerOptions().title(locais.get(PosicaoList)).snippet(EnderecoMercado.get(PosicaoList)).position(pontoB)); }else if(PosicaoList < locais.size()) { pontoB = new LatLng(LatitudeMercado.get(PosicaoList), LongitudeMercado.get(PosicaoList)); nome2 = locais.get(PosicaoList); desc2 = EnderecoMercado.get(PosicaoList); mMap.addMarker(new MarkerOptions().title(locais.get(PosicaoList)).snippet(EnderecoMercado.get(PosicaoList)).position(pontoB)); }else{ pontoB = new LatLng(latitudePromotor, longitudePromotor); nome2 = nomePromotor; desc2 = enderecoPromotor; mMap.addMarker(new MarkerOptions().title(nomePromotor).snippet(enderecoPromotor).position(pontoB)); } mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(pontoA, 13)); int contador2 = 0; listlatlong = new ArrayList<>(); if(linhaAtiva > 0 && linhaAtiva == PosicaoList){ for (contador2 = controlaPolilynesRota.get(linhaAtiva-1); contador2 < controlaPolilynesRota.get(linhaAtiva); contador2++){ for(LatLng p : decodePolyline(polilynesRota.get(contador2))){ listlatlong.add(p); } } }else if (linhaAtiva == PosicaoList){ for (contador2 = 0; contador2 < controlaPolilynesRota.get(linhaAtiva); contador2++) { for(LatLng p : decodePolyline(polilynesRota.get(contador2))){ listlatlong.add(p); } } }else if (PosicaoList == 0 && linhaAtiva != PosicaoList) { for (contador2 = 0; contador2 < controlaPolilynesRota.get(PosicaoList); contador2++) { for(LatLng p : decodePolyline(polilynesRota.get(contador2))){ listlatlong.add(p); } } }else if (PosicaoList > 0 && linhaAtiva != PosicaoList){ for (contador2 = controlaPolilynesRota.get(PosicaoList-1); contador2 < controlaPolilynesRota.get(PosicaoList); contador2++){ for(LatLng p : decodePolyline(polilynesRota.get(contador2))){ listlatlong.add(p); } } } drawRoute(); mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() { @Override public void onMapClick(LatLng latLng) { Bundle bundle = new Bundle(); bundle.putDouble("mLat1", pontoA.latitude); bundle.putDouble("mLng1", pontoA.longitude); bundle.putDouble("mLat2", pontoB.latitude); bundle.putDouble("mLng2", pontoB.longitude); bundle.putString("mNome1", nome1); bundle.putString("mDesc1",desc1); bundle.putString("mNome2", nome2); bundle.putString("mDesc2",desc2); Intent intent = new Intent(getApplicationContext(), TelaRotaMapaCompleto.class); intent.putExtras(bundle); startActivity(intent); } }); } // DECODE POLYLINE private List<LatLng> decodePolyline(String encoded) { List<LatLng> listPoints = new ArrayList<LatLng>(); int index = 0, len = encoded.length(); int lat = 0, lng = 0; while (index < len) { int b, shift = 0, result = 0; do { b = encoded.charAt(index++) - 63; result |= (b & 0x1f) << shift; shift += 5; } while (b >= 0x20); int dlat = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1)); lat += dlat; shift = 0; result = 0; do { b = encoded.charAt(index++) - 63; result |= (b & 0x1f) << shift; shift += 5; } while (b >= 0x20); int dlng = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1)); lng += dlng; LatLng p = new LatLng((((double) lat / 1E5)), (((double) lng / 1E5))); listPoints.add(p); } return listPoints; } public void HistoricoDeRotas(){ //Alerta do historico de rotas AlertDialog.Builder builder = new AlertDialog.Builder(this); builder .setTitle("Historico de rotas") .setMessage("Enviar historico por e-mail?") .setIcon(R.drawable.ic_history_black_24dp) .setPositiveButton("Sim", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Toast.makeText(TelaRota.this, "E-mail enviado", Toast.LENGTH_SHORT).show(); //Colocar metodo para mandar solicitação para o back mandar o e-mail } }) .setNegativeButton("Não", null) .show(); } }
42.62578
159
0.614788
ff19c48eeee1adab699bacdf86c3c8681cc3858f
3,666
package org.insightcentre.nlp.saffron.taxonomy.wordnet; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; import java.io.FileOutputStream; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.zip.GZIPOutputStream; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; /** * This is used to translate a WordNet XML dump into a hypernym file, as follows: * * mvn exec:java -Dexec.mainClass="org.insightcentre.nlp.saffron.taxonomy.wordnet.ProcessWNXML" -Dexec.args="../../../jmccrae/gwn-scala-api/wordnets/wn31.xml ../models/wn-hyps.json.gz" * * @author John McCrae */ public class ProcessWNXML { public static void main(String[] args) throws Exception { SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); SAXParser saxParser = saxParserFactory.newSAXParser(); WNXMLHandler handler = new WNXMLHandler(); saxParser.parse(new File(args[0]), handler); Set<Hypernym> hypernyms = new HashSet<>(); for(Map.Entry<String, Set<String>> e : handler.hypernyms.entrySet()) { for(String hyp : e.getValue()) { for(String hypTerm : getAllHyps(hyp, handler)) { for(String hypoTerm : handler.synsetWords.get(e.getKey())) { hypernyms.add(new Hypernym(hypoTerm, hypTerm)); } } } } ObjectMapper mapper = new ObjectMapper(); GZIPOutputStream gos = new GZIPOutputStream(new FileOutputStream(args[1])); mapper.writerWithDefaultPrettyPrinter().writeValue(gos, hypernyms); } private static Set<String> getAllHyps(String hyp, WNXMLHandler handler) { Set<String> values = new HashSet<>(); values.addAll(handler.synsetWords.get(hyp)); if(handler.hypernyms.containsKey(hyp)) { for(String hyp2 : handler.hypernyms.get(hyp)) { values.addAll(getAllHyps(hyp2, handler)); } } return values; } public static class WNXMLHandler extends DefaultHandler { public final HashMap<String, Set<String>> synsetWords = new HashMap<>(); public final HashMap<String, Set<String>> hypernyms = new HashMap<>(); private String lemma; private String synsetRef; @Override public void startElement(String uri, String _localName, String qName, Attributes attributes) throws SAXException { if("Lemma".equals(qName)) { lemma = attributes.getValue("writtenForm"); } else if("Sense".equals(qName)) { synsetRef = attributes.getValue("synset"); if(!synsetWords.containsKey(synsetRef)) { synsetWords.put(synsetRef, new HashSet<String>()); } synsetWords.get(synsetRef).add(lemma); } else if("Synset".equals(qName)) { synsetRef = attributes.getValue("id"); } else if("SynsetRelation".equals(qName)) { if("hypernym".equals(attributes.getValue("relType"))) { String target = attributes.getValue("target"); if(!hypernyms.containsKey(synsetRef)) { hypernyms.put(synsetRef, new HashSet<String>()); } hypernyms.get(synsetRef).add(target); } } super.startElement(uri, _localName, qName, attributes); } } }
41.191011
184
0.621113
f1e2bf685f183012d6ace64e5c3a30164da2fe34
9,601
package project.gps; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.List; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.content.res.AssetManager; import android.graphics.drawable.Drawable; import android.location.Address; import android.location.Geocoder; import android.location.Location; import java.util.Locale; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.os.Handler; import android.provider.Settings; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnLongClickListener; import android.widget.Button; import android.widget.ImageButton; import android.widget.SlidingDrawer; import android.widget.SlidingDrawer.OnDrawerCloseListener; import android.widget.SlidingDrawer.OnDrawerOpenListener; import android.widget.Toast; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import com.google.android.maps.OverlayItem; public class GpsprojectActivity extends MapActivity { ImageButton btnslider=null; ImageButton btngps=null; ImageButton start_loc=null; ImageButton des_loc=null; ImageButton distance=null; ImageButton search=null; ImageButton cost=null; private MapController mapController; private MapView mapView; private LocationManager locationManager; private Location location; private Myoverlays itemizedoverlay; double cur_latitude; double cur_longitude; double des_latitude; double des_longitude; protected ProgressDialog pdDialog; double dist; List<Address> myList; List<Address> myList1; String sgeo; String dgeo; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); copyAssets(); btnslider=(ImageButton) findViewById(R.id.btnHandle); btngps=(ImageButton) findViewById(R.id.btngps); start_loc=(ImageButton) findViewById(R.id.start_loc); des_loc=(ImageButton) findViewById(R.id.des_loc); distance=(ImageButton)findViewById(R.id.distance); search=(ImageButton)findViewById(R.id.search); cost=(ImageButton)findViewById(R.id.cost); final SlidingDrawer sd=(SlidingDrawer) findViewById(R.id.slider); locationManager=(LocationManager) this.getSystemService(LOCATION_SERVICE); locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0,0, new GeoUpdateHandler()); des_loc.setVisibility(View.GONE); distance.setVisibility(View.GONE); cost.setVisibility(View.GONE); sd.setOnDrawerOpenListener(new OnDrawerOpenListener() { public void onDrawerOpened() { btngps.setVisibility(View.GONE); start_loc.setVisibility(View.GONE); des_loc.setVisibility(View.GONE); distance.setVisibility(View.GONE); search.setVisibility(View.GONE); cost.setVisibility(View.GONE); } }); sd.setOnDrawerCloseListener(new OnDrawerCloseListener() { public void onDrawerClosed() { btngps.setVisibility(View.VISIBLE); start_loc.setVisibility(View.VISIBLE); start_loc.setClickable(true); search.setVisibility(View.VISIBLE); des_loc.setClickable(true); distance.setClickable(true); search.setClickable(true); cost.setClickable(true); } }); btngps.setOnClickListener(new OnClickListener() { public void onClick(View v) { sd.open(); } }); search.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent it = new Intent(GpsprojectActivity.this,search.class); startActivity(it); } }); btngps.setOnLongClickListener(new OnLongClickListener() { public boolean onLongClick(View v) { sd.close(); return false; } }); start_loc.setOnClickListener(new OnClickListener() { public void onClick(View v) { location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); System.out.println("Location="+location); if(location!=null) { System.out.println("LocaTION="+location); cur_latitude= location.getLatitude(); cur_longitude= location.getLongitude(); Toast.makeText(GpsprojectActivity.this, "Location::"+location.getLatitude()+""+location.getLongitude(), Toast.LENGTH_LONG).show(); des_loc.setVisibility(View.VISIBLE); start_loc.setClickable(false); } else { System.out.println(" Location not found"); Toast.makeText(GpsprojectActivity.this, "Location not found", Toast.LENGTH_LONG).show(); des_loc.setVisibility(View.VISIBLE); start_loc.setClickable(false); } } }); des_loc.setOnClickListener(new OnClickListener() { public void onClick(View v) { location = locationManager .getLastKnownLocation(LocationManager.GPS_PROVIDER); System.out.println("LocaTION=" + location); if (location != null) { Toast.makeText(GpsprojectActivity.this,"Location::" + location.getLatitude() + ""+ location.getLongitude(),Toast.LENGTH_LONG).show(); des_latitude = location.getLatitude(); des_longitude = location.getLongitude(); distance.setVisibility(View.VISIBLE); des_loc.setClickable(false); } else { System.out.println("location not found"); Toast.makeText(GpsprojectActivity.this, "Location not found", Toast.LENGTH_LONG).show(); distance.setVisibility(View.VISIBLE); des_loc.setClickable(false); } } }); distance.setOnClickListener(new OnClickListener() { public void onClick(View v) { distance(); cost.setVisibility(View.VISIBLE); distance.setClickable(false); } }); cost.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent it= new Intent(GpsprojectActivity.this,cost.class); String s=""+1000; String s1=""+dist; it.putExtra( s,s1); startActivity(it); } }); // showCurrentLocation(); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); // Either satellite or 2d mapView.setSatellite(true); mapController = mapView.getController(); mapController.setZoom(18); // Zoom 1 is world view locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); boolean enabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); if (!enabled) { Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); startActivity(intent); } else{ locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,0, new GeoUpdateHandler()); Drawable drawable = this.getResources().getDrawable(R.drawable.point2); itemizedoverlay = new Myoverlays(drawable); createMarker(); } } protected boolean isRouteDisplayed() { return false; } public class GeoUpdateHandler implements LocationListener { public void onLocationChanged(Location loc) { System.out.println("function called"); location = loc; int lat = (int) (location.getLatitude() * 1E6); int lng = (int) (location.getLongitude() * 1E6); GeoPoint point = new GeoPoint(lat, lng); createMarker(); mapController.animateTo(point); // mapController.setCenter(point); } public void onProviderDisabled(String provider) { } public void onProviderEnabled(String provider) { } public void onStatusChanged(String provider, int status, Bundle extras) { } } private void createMarker() { GeoPoint p = mapView.getMapCenter(); OverlayItem overlayitem = new OverlayItem(p, "", ""); itemizedoverlay.addOverlay(overlayitem); mapView.getOverlays().add(itemizedoverlay); } void distance() { Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); float result[]=new float[5]; location.distanceBetween(cur_latitude, cur_longitude, des_latitude, des_longitude, result); System.out.println(result[0]); dist=result[0]; Toast.makeText(GpsprojectActivity.this, ""+result[0], Toast.LENGTH_LONG).show(); } private void copyAssets() { AssetManager assetManager = getAssets(); String[] files = null; try { files = assetManager.list(""); String s=files[0]; } catch (IOException e) { e.printStackTrace(); } for(String s : files) { InputStream in = null; OutputStream out = null; try { in = assetManager.open(s); out = new FileOutputStream("/sdcard/" + s); copyFile(in, out); in.close(); in = null; out.flush(); out.close(); out = null; }catch(Exception e) { } } } private void copyFile(InputStream in, OutputStream out) throws IOException { byte[] buffer = new byte[1024]; int read; while((read = in.read(buffer)) != -1){ out.write(buffer, 0, read); } } }
20.514957
133
0.67545
7c1b00553b25734327a0a6e232d2147cf0f41a70
465
package exception; public class B8 { public static void main(String[] args) { System.out.println(m()); } static int m() { System.out.println("starts"); try { System.out.println(10/0); } finally { System.err.println("RUNTIME exception occured"); return 1; } //System.out.println("excecuting lines after exception occured");//Unreachable code } }
11.923077
86
0.537634
9625935819ab173d7c843ea89c91bc0381f25f43
429
package com.atguigu.gulimall.member.dao; import com.atguigu.gulimall.member.entity.MemberCollectSubjectEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; /** * ��Ա�ղص�ר�� * * @author katrinani * @email lichenkatrinani@gmail.com * @date 2021-02-12 20:59:49 */ @Mapper public interface MemberCollectSubjectDao extends BaseMapper<MemberCollectSubjectEntity> { }
23.833333
89
0.778555
cf1751f4c7ef545f15714302592749e7bf976b22
258
package com.wondernect.stars.user.em; /** * Copyright (C), 2017-2018, wondernect.com * FileName: UserRegistType * Author: chenxun * Date: 2018/12/29 10:33 * Description: 用户注册类型 */ public enum UserType { LOCAL, // 本地用户注册 THIRD, // 第三方用户注册 }
15.176471
43
0.662791
183c75e433fa485ea570371b02065682e8e40bb4
214
package com.shop.shopping.entity; public interface PayState { int START_PAY = 1; int PAY_ERROR = 2; int PAY_OK = 3; int PAY_LAST_ERROR = 4; int PAY_CANCEL = 5; int PAY_RECEIVE_MONEY = 6; }
19.454545
33
0.654206
040f5575dc660c8610d77cc08330235207820e4d
511
package org.infinispan.scattered.stream; import org.infinispan.configuration.cache.CacheMode; import org.infinispan.stream.BaseStreamIteratorEvictionTest; import org.testng.annotations.Test; /** * @author Radim Vansa &lt;rvansa@redhat.com&gt; */ @Test(groups = "functional", testName = "stream.ScatteredIteratorEvictionTest") public class ScatteredIteratorEvictionTest extends BaseStreamIteratorEvictionTest { public ScatteredIteratorEvictionTest() { super(false, CacheMode.SCATTERED_SYNC); } }
31.9375
83
0.800391
31865cc390b1be02b9c275666be2f984cad0e0aa
728
package com.feihua.framework.message.api; import com.feihua.framework.message.dto.BaseMessageTargetClientUserRelDto; import com.feihua.framework.message.po.BaseMessageTargetClientUserRelPo; /** * This class was generated by MyBatis Generator. * @author yangwei 2018-11-02 17:25:55 */ public interface ApiBaseMessageTargetClientUserRelPoService extends feihua.jdbc.api.service.ApiBaseService<BaseMessageTargetClientUserRelPo, BaseMessageTargetClientUserRelDto, String> { /** * 根据客户端id和用户id查询,应该是一条数据才对 * @param targetClientId * @param userId * @param isRead * @return */ BaseMessageTargetClientUserRelPo selectByClientIdAndUserId(String targetClientId,String userId,String isRead); }
33.090909
185
0.787088
06881085ff3695357dfefcb94d2556f24fb9cfaa
4,472
/* * Copyright © 2009 HotPads (admin@hotpads.com) * * 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 io.datarouter.client.memcached.client; import java.time.Duration; import java.util.Collection; import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.datarouter.instrumentation.trace.TraceSpanGroupType; import io.datarouter.instrumentation.trace.TracerTool; import io.datarouter.instrumentation.trace.TracerTool.TraceSpanInfoBuilder; import io.datarouter.scanner.Scanner; import io.datarouter.storage.client.ClientId; import io.datarouter.util.tuple.Pair; public class MemcachedOps{ private static final Logger logger = LoggerFactory.getLogger(MemcachedOps.class); private final MemcachedClientManager memcachedClientManager; public MemcachedOps(MemcachedClientManager memcachedClientManager){ this.memcachedClientManager = memcachedClientManager; } public void delete( ClientId clientId, String nodeName, String memcachedStringKey, Duration timeout){ try(var $ = TracerTool.startSpan(nodeName + " " + "delete", TraceSpanGroupType.DATABASE)){ long start = System.currentTimeMillis(); try{ memcachedClientManager.getSpyMemcachedClient(clientId) .delete(memcachedStringKey) .get(timeout.toMillis(), TimeUnit.MILLISECONDS); }catch(TimeoutException e){ TracerTool.appendToSpanInfo("memcached timeout"); long elapsedMs = System.currentTimeMillis() - start; String details = "timeout after " + elapsedMs + "ms"; throw new RuntimeException(details, e); }catch(ExecutionException | InterruptedException e){ TracerTool.appendToSpanInfo("memcached exception"); throw new RuntimeException(e); } } } public Scanner<Pair<String,Object>> fetch( ClientId clientId, String nodeName, Collection<String> memcachedStringKeys, long timeoutMs, boolean ignoreExceptions){ if(memcachedStringKeys.isEmpty()){ return Scanner.empty(); } long start = System.currentTimeMillis(); try(var $ = TracerTool.startSpan(nodeName + " get bulk", TraceSpanGroupType.DATABASE)){ try{ Map<String,Object> results = memcachedClientManager.getSpyMemcachedClient(clientId) .asyncGetBulk(memcachedStringKeys) .get(timeoutMs, TimeUnit.MILLISECONDS); TracerTool.appendToSpanInfo(new TraceSpanInfoBuilder() .add("keys", memcachedStringKeys.size()) .add("results", results.size())); return Scanner.of(results.entrySet()) .map(entry -> new Pair<>(entry.getKey(), entry.getValue())); }catch(TimeoutException e){ TracerTool.appendToSpanInfo("memcached timeout"); long elapsedMs = System.currentTimeMillis() - start; String details = "timeout after " + elapsedMs + "ms"; if(ignoreExceptions){ logger.error(details, e); return Scanner.empty(); } throw new RuntimeException(details, e); }catch(ExecutionException | InterruptedException e){ TracerTool.appendToSpanInfo("memcached exception"); if(ignoreExceptions){ logger.error("", e); return Scanner.empty(); } throw new RuntimeException(e); } } } public long increment(ClientId clientId, String memcachedStringKey, int delta, int expiration){ // this cannot be async and use the client wide operationTimeout, with default of 2.5s return memcachedClientManager .getSpyMemcachedClient(clientId) .incr(memcachedStringKey, delta, delta, expiration); } public void set( ClientId clientId, String nodeName, String memcachedStringKey, int expiration, byte[] bytes){ try(var $ = TracerTool.startSpan(nodeName + " " + "set", TraceSpanGroupType.DATABASE)){ TracerTool.appendToSpanInfo("bytes", bytes.length); memcachedClientManager .getSpyMemcachedClient(clientId) .set(memcachedStringKey, expiration, bytes); } } }
35.212598
96
0.745528
1dbdba355e3a73ead6aee4cfd43e613e01bd1d74
1,092
package com.bitmonlab.osiris.api.map.rest.api; import javax.ws.rs.core.Response; import com.bitmonlab.osiris.api.core.map.exceptions.FeatureNotExistException; import com.bitmonlab.osiris.api.core.map.exceptions.MongoGeospatialException; import com.bitmonlab.osiris.api.core.map.transferobject.FeatureDTO; import com.bitmonlab.osiris.commons.model.security.BasicAuth; import com.bitmonlab.osiris.core.assembler.AssemblyException; public interface FeatureResource { Response storeFeature(BasicAuth principal,String appIdentifier, FeatureDTO featureDTO) throws AssemblyException, MongoGeospatialException; Response deleteFeature(BasicAuth principal,String appIdentifier, String idFeature) throws FeatureNotExistException; Response updateFeature(BasicAuth principal,String appIdentifier, String idFeature, FeatureDTO featureDTO) throws AssemblyException, FeatureNotExistException, MongoGeospatialException; Response getFeatureByID(BasicAuth principal,String appIdentifier, String idFeature) throws AssemblyException, FeatureNotExistException; }
45.5
185
0.831502
1f06bd8939bfe120fac0697fa174824ab0bf44b0
848
package com.stackroute.innovatorprofile.exception; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; @ControllerAdvice public class GlobalExceptionHandler { @ExceptionHandler(EmailIdAlreadyExistsException.class) public ResponseEntity<?> handleUserNameNotFoundException(EmailIdAlreadyExistsException e){ return new ResponseEntity<String>("Email is already exist !", HttpStatus.NOT_FOUND); } @ExceptionHandler(EmailIdNotFoundException.class) public ResponseEntity<?> handleUserNameOrPasswordEmptyException(EmailIdNotFoundException e){ return new ResponseEntity<String>("User Email Id/Password is Empty !", HttpStatus.NOT_FOUND); } }
38.545455
101
0.811321
6d45be07b980511da1001708254df2d67a95886e
12,867
/* * Autopsy Forensic Browser * * Copyright 2018 Basis Technology Corp. * Contact: carrier <at> sleuthkit <dot> org * * 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 org.sleuthkit.autopsy.casemodule; import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.TreeSet; import javax.swing.JFileChooser; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import java.util.logging.Level; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.PathValidator; /** * A panel which allows the user to select a Logical Evidence File (L01) */ @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives final class LogicalEvidenceFilePanel extends javax.swing.JPanel implements DocumentListener { private static final long serialVersionUID = 1L; private final Set<File> currentFiles = new TreeSet<>(); //keep currents in a set to disallow duplicates per add private static final Logger logger = Logger.getLogger(LocalFilesPanel.class.getName()); private String displayName = ""; /** * Creates new form LogicalEvidenceFilePanel */ private LogicalEvidenceFilePanel() { initComponents(); logicalEvidenceFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); logicalEvidenceFileChooser.setAcceptAllFileFilterUsed(false); logicalEvidenceFileChooser.setMultiSelectionEnabled(false); logicalEvidenceFileChooser.setFileFilter(LocalFilesDSProcessor.getLogicalEvidenceFilter()); } /** * Create a new LogicalEvidencePanel. * * @return */ static LogicalEvidenceFilePanel createInstance() { synchronized (LogicalEvidenceFilePanel.class) { final LogicalEvidenceFilePanel instance = new LogicalEvidenceFilePanel(); // post-constructor initialization of listener support without leaking references of uninitialized objects instance.logicalEvidencePathField.getDocument().addDocumentListener(instance); return instance; } } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { logicalEvidenceFileChooser = new javax.swing.JFileChooser(); selectButton = new javax.swing.JButton(); logicalEvidencePathField = new javax.swing.JTextField(); errorLabel = new javax.swing.JLabel(); logicalEvidenceFileChooser.setApproveButtonText(org.openide.util.NbBundle.getMessage(LogicalEvidenceFilePanel.class, "LogicalEvidenceFilePanel.logicalEvidenceFileChooser.approveButtonText")); // NOI18N logicalEvidenceFileChooser.setApproveButtonToolTipText(org.openide.util.NbBundle.getMessage(LogicalEvidenceFilePanel.class, "LogicalEvidenceFilePanel.logicalEvidenceFileChooser.approveButtonToolTipText")); // NOI18N logicalEvidenceFileChooser.setDialogTitle(org.openide.util.NbBundle.getMessage(LogicalEvidenceFilePanel.class, "LogicalEvidenceFilePanel.logicalEvidenceFileChooser.dialogTitle")); // NOI18N logicalEvidenceFileChooser.setFileSelectionMode(javax.swing.JFileChooser.FILES_AND_DIRECTORIES); org.openide.awt.Mnemonics.setLocalizedText(selectButton, org.openide.util.NbBundle.getMessage(LogicalEvidenceFilePanel.class, "LogicalEvidenceFilePanel.selectButton.text")); // NOI18N selectButton.setToolTipText(org.openide.util.NbBundle.getMessage(LogicalEvidenceFilePanel.class, "LogicalEvidenceFilePanel.selectButton.toolTipText")); // NOI18N selectButton.setActionCommand(org.openide.util.NbBundle.getMessage(LogicalEvidenceFilePanel.class, "LogicalEvidenceFilePanel.selectButton.actionCommand")); // NOI18N selectButton.setMaximumSize(new java.awt.Dimension(70, 23)); selectButton.setMinimumSize(new java.awt.Dimension(70, 23)); selectButton.setPreferredSize(new java.awt.Dimension(70, 23)); selectButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { selectButtonActionPerformed(evt); } }); logicalEvidencePathField.setText(org.openide.util.NbBundle.getMessage(LogicalEvidenceFilePanel.class, "LogicalEvidenceFilePanel.logicalEvidencePathField.text")); // NOI18N logicalEvidencePathField.setPreferredSize(new java.awt.Dimension(379, 20)); errorLabel.setForeground(new java.awt.Color(255, 0, 0)); org.openide.awt.Mnemonics.setLocalizedText(errorLabel, org.openide.util.NbBundle.getMessage(LogicalEvidenceFilePanel.class, "LogicalEvidenceFilePanel.errorLabel.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(errorLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) .addGroup(layout.createSequentialGroup() .addComponent(logicalEvidencePathField, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(selectButton, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(4, 4, 4)))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(0, 0, 0) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(selectButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(logicalEvidencePathField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addComponent(errorLabel) .addContainerGap(105, Short.MAX_VALUE)) ); }// </editor-fold>//GEN-END:initComponents private void selectButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectButtonActionPerformed final int returnVal = logicalEvidenceFileChooser.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { final File file = logicalEvidenceFileChooser.getSelectedFile(); final StringBuilder allPaths = new StringBuilder(); currentFiles.add(file); allPaths.append(file.getAbsolutePath()); logicalEvidencePathField.setText(allPaths.toString()); logicalEvidencePathField.setToolTipText(allPaths.toString()); } fireChange(); }//GEN-LAST:event_selectButtonActionPerformed /* * Clear previously selected items on the panel. */ void reset() { currentFiles.clear(); logicalEvidencePathField.setText(""); logicalEvidencePathField.setToolTipText(""); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel errorLabel; private javax.swing.JFileChooser logicalEvidenceFileChooser; private javax.swing.JTextField logicalEvidencePathField; private javax.swing.JButton selectButton; // End of variables declaration//GEN-END:variables /** * Check if the current selection exists and is a logical evidence file and * therefore the panel is valid. * * @return true for a valid selection, false for an invalid or empty * selection */ @Messages({ "LogicalEvidenceFilePanel.validatePanel.nonL01Error.text=Only files with the .l01 file extension are supported here.", "LogicalEvidenceFilePanel.pathValidation.dataSourceOnCDriveError=Warning: Path to multi-user data source is on \"C:\" drive", "LogicalEvidenceFilePanel.pathValidation.getOpenCase.Error=Warning: Exception while getting open case." }) boolean validatePanel() { errorLabel.setVisible(false); // display warning if there is one (but don't disable "next" button) final String path = logicalEvidencePathField.getText(); if (StringUtils.isBlank(path)) { return false; } // display warning if there is one (but don't disable "next" button) try { if (!PathValidator.isValidForCaseType(path, Case.getCurrentCaseThrows().getCaseType())) { errorLabel.setVisible(true); errorLabel.setText(Bundle.LogicalEvidenceFilePanel_pathValidation_dataSourceOnCDriveError()); return false; } } catch (NoCurrentCaseException ex) { errorLabel.setVisible(true); errorLabel.setText(Bundle.LogicalEvidenceFilePanel_pathValidation_getOpenCase_Error()); return false; } //check the extension incase the path was manually entered if (!LocalFilesDSProcessor.getLogicalEvidenceFilter().accept(new File(path))) { errorLabel.setVisible(true); errorLabel.setText(Bundle.LogicalEvidenceFilePanel_validatePanel_nonL01Error_text()); return false; } displayName = FilenameUtils.getName(path); return new File(path).isFile(); } /** * Get the path(s) which have been selected on this panel * * @return a List of Strings representing the path(s) for the selected files */ List<String> getContentPaths() { final List<String> pathsList = new ArrayList<>(); if (currentFiles == null) { return pathsList; } for (final File f : currentFiles) { pathsList.add(f.getAbsolutePath()); } return pathsList; } /** * Get the name of the logical evidence file which was selected. * * @return the name of the logical evidence file */ String getFileSetName() { return displayName; } @Override public void insertUpdate(final DocumentEvent docEvent) { fireChange(); } @Override public void removeUpdate(final DocumentEvent docEvent) { fireChange(); } @Override public void changedUpdate(final DocumentEvent docEvent) { fireChange(); } @Messages({ "LogicalEvidenceFilePanel.moduleErr.name=Module Error", "LogicalEvidenceFilePanel.moduleErr.msg=A module caused an error listening to LogicalEvidenceFilePanel updates. See log to determine which module. Some data could be incomplete." }) private void fireChange() { try { firePropertyChange(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString(), false, true); } catch (Exception e) { logger.log(Level.SEVERE, "LogicalEvidenceFilePanel listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "LogicalEvidenceFilePanel.moduleErr"), NbBundle.getMessage(this.getClass(), "LogicalEvidenceFilePanel.moduleErr.msg"), MessageNotifyUtil.MessageType.ERROR); } } }
47.655556
223
0.707391
60e0688853c2c541da7c08034125b9fca8b91c03
1,698
/* * Copyright (c) 2013-2017 Cinchapi Inc. * * 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.cinchapi.concourse.lang; /** * A {@link Symbol} that represents a key in a {@link Criteria}. * * @author Jeff Nelson */ public class KeySymbol extends AbstractSymbol { /** * Create a new {@link KeySymbol} for the given {@code key}. * * @param key * @return the symbol */ public static KeySymbol create(String key) { return new KeySymbol(key); } /** * Parse a {@link KeySymbol} from the given {@code string}. * * @param string * @return the symbol */ public static KeySymbol parse(String string) { return new KeySymbol(string); } /** * The associated key. */ private final String key; /** * Construct a new instance. * * @param key */ private KeySymbol(String key) { this.key = key; } /** * Return the key associated with this {@link Symbol}. * * @return the key */ public String getKey() { return key; } @Override public String toString() { return key; } }
22.945946
75
0.614841
c37ecc4a268f6ed6445f2a0483ed90d1bf636736
296
package com.jurengis.mancala.domain; import lombok.*; import javax.persistence.Embeddable; @Getter @Setter @NoArgsConstructor @AllArgsConstructor @Builder @Embeddable public class Pit { public enum Type { LITTLE, BIG } private Type type = Type.LITTLE; private int stoneCount; }
12.869565
36
0.746622
3923a908702fb59bcf765fa4ab3b707c51fb0b61
25,375
// Copyright 2018 Rygaard Technologies, LLC // // 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. // // 3. Neither the name of the copyright holder 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 HOLDER 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 com.undercamber; final class DependencyWindow { private javafx.stage.Stage _stage; private javafx.scene.control.Button _closeButton; private Undercamber _undercamber; DependencyWindow( TestData testData, boolean showTestPopupMenu, Undercamber undercamber, javafx.stage.Window ownerWindow ) { javafx.scene.Scene scene; _undercamber = undercamber; scene = new javafx.scene.Scene( buildContentPane(testData, showTestPopupMenu, undercamber, ownerWindow) ); _stage = new javafx.stage.Stage(); _stage.setScene( scene ); scene.addEventFilter( javafx.scene.input.KeyEvent.KEY_PRESSED, event -> handleKeyPress(event) ); _stage.addEventFilter( javafx.scene.input.KeyEvent.KEY_PRESSED, event -> handleKeyPress(event) ); if ( (testData.getTotalPrerequisiteCount()>0) && (testData.getTotalDependentCount()>0) ) { _stage.setTitle( "Dependencies for " + testData.getHeading() ); } else if ( testData.getTotalPrerequisiteCount() > 0 ) { _stage.setTitle( "Prerequisites for " + testData.getHeading() ); } else if ( testData.getTotalDependentCount() > 0 ) { _stage.setTitle( "Dependents for " + testData.getHeading() ); } _stage.setScene( scene ); _stage.initOwner( ownerWindow ); _stage.setOnCloseRequest( event -> onCloseRequest() ); _stage.show(); } final private javafx.scene.layout.Pane buildContentPane( TestData testData, boolean showTestPopupMenu, Undercamber undercamber, javafx.stage.Window ownerWindow ) { if ( (testData.getTotalPrerequisiteCount()>0) && (testData.getTotalDependentCount()>0) ) { return buildPaneWithPrerequisitesAndDependents( testData, showTestPopupMenu, undercamber, ownerWindow ); } else if ( testData.getTotalPrerequisiteCount() > 0 ) { return buildPrerequisitesPane( testData, showTestPopupMenu, undercamber, ownerWindow ); } else if ( testData.getTotalDependentCount() > 0 ) { return buildDependentsPane( testData, showTestPopupMenu, undercamber, ownerWindow ); } else { return null; } } final private javafx.scene.layout.Pane buildPaneWithPrerequisitesAndDependents( TestData testData, boolean showTestPopupMenu, Undercamber undercamber, javafx.stage.Window ownerWindow ) { javafx.scene.control.Label prerequisitesLabel; javafx.scene.control.TableView<DependencyTableRowData> prerequisiteTable; javafx.scene.layout.GridPane prerequisitesPane; javafx.scene.control.Label dependentsLabel; javafx.scene.control.TableView<DependencyTableRowData> dependentsTable; javafx.scene.layout.GridPane dependentsPane; javafx.scene.layout.ColumnConstraints column0Constraints; javafx.scene.layout.RowConstraints row0Constraints; javafx.scene.layout.RowConstraints row1Constraints; javafx.scene.control.SplitPane splitPane; javafx.scene.layout.Pane buttonPane; javafx.scene.layout.GridPane pane; prerequisitesLabel = new javafx.scene.control.Label( "Prerequisites" ); prerequisiteTable = makePrerequisiteTable( testData, showTestPopupMenu, undercamber, ownerWindow ); prerequisitesPane = new javafx.scene.layout.GridPane(); column0Constraints = new javafx.scene.layout.ColumnConstraints(); column0Constraints.setHgrow( javafx.scene.layout.Priority.ALWAYS ); prerequisitesPane.getColumnConstraints().addAll( column0Constraints ); row0Constraints = new javafx.scene.layout.RowConstraints(); row0Constraints.setVgrow( javafx.scene.layout.Priority.NEVER ); row1Constraints = new javafx.scene.layout.RowConstraints(); row1Constraints.setVgrow( javafx.scene.layout.Priority.ALWAYS ); prerequisitesPane.getRowConstraints().addAll( row0Constraints, row1Constraints ); javafx.scene.layout.GridPane.setConstraints( prerequisitesLabel, 0, 0, 1, 1, javafx.geometry.HPos.LEFT, javafx.geometry.VPos.CENTER ); javafx.scene.layout.GridPane.setConstraints( prerequisiteTable, 0, 1, 1, 1, javafx.geometry.HPos.CENTER, javafx.geometry.VPos.CENTER ); prerequisitesPane.getChildren().addAll( prerequisitesLabel, prerequisiteTable ); dependentsLabel = new javafx.scene.control.Label( "Dependents" ); dependentsTable = makeDependentTable( testData, showTestPopupMenu, undercamber, ownerWindow ); dependentsPane = new javafx.scene.layout.GridPane(); column0Constraints = new javafx.scene.layout.ColumnConstraints(); column0Constraints.setHgrow( javafx.scene.layout.Priority.ALWAYS ); dependentsPane.getColumnConstraints().addAll( column0Constraints ); row0Constraints = new javafx.scene.layout.RowConstraints(); row0Constraints.setVgrow( javafx.scene.layout.Priority.NEVER ); row1Constraints = new javafx.scene.layout.RowConstraints(); row1Constraints.setVgrow( javafx.scene.layout.Priority.ALWAYS ); dependentsPane.getRowConstraints().addAll( row0Constraints, row1Constraints ); javafx.scene.layout.GridPane.setConstraints( dependentsLabel, 0, 0, 1, 1, javafx.geometry.HPos.LEFT, javafx.geometry.VPos.CENTER ); javafx.scene.layout.GridPane.setConstraints( dependentsTable, 0, 1, 1, 1, javafx.geometry.HPos.CENTER, javafx.geometry.VPos.CENTER ); dependentsPane.getChildren().addAll( dependentsLabel, dependentsTable ); splitPane = new javafx.scene.control.SplitPane( prerequisitesPane, dependentsPane ); buttonPane = makeButtonPane(); pane = new javafx.scene.layout.GridPane(); column0Constraints = new javafx.scene.layout.ColumnConstraints(); column0Constraints.setHgrow( javafx.scene.layout.Priority.ALWAYS ); pane.getColumnConstraints().addAll( column0Constraints ); row0Constraints = new javafx.scene.layout.RowConstraints(); row0Constraints.setVgrow( javafx.scene.layout.Priority.ALWAYS ); row1Constraints = new javafx.scene.layout.RowConstraints(); row1Constraints.setVgrow( javafx.scene.layout.Priority.NEVER ); pane.getRowConstraints().addAll( row0Constraints, row1Constraints ); javafx.scene.layout.GridPane.setConstraints( splitPane, 0, 0, 1, 1, javafx.geometry.HPos.CENTER, javafx.geometry.VPos.CENTER ); javafx.scene.layout.GridPane.setConstraints( buttonPane, 0, 1, 1, 1, javafx.geometry.HPos.CENTER, javafx.geometry.VPos.CENTER ); pane.getChildren().addAll( splitPane, buttonPane ); return pane; } final private javafx.scene.layout.Pane buildPrerequisitesPane( TestData testData, boolean showTestPopupMenu, Undercamber undercamber, javafx.stage.Window ownerWindow ) { javafx.scene.control.TableView<DependencyTableRowData> prerequisiteTable; javafx.scene.layout.Pane buttonPane; javafx.scene.layout.GridPane pane; javafx.scene.layout.ColumnConstraints column0Constraints; javafx.scene.layout.RowConstraints row0Constraints; javafx.scene.layout.RowConstraints row1Constraints; prerequisiteTable = makePrerequisiteTable( testData, showTestPopupMenu, undercamber, ownerWindow ); buttonPane = makeButtonPane(); pane = new javafx.scene.layout.GridPane(); column0Constraints = new javafx.scene.layout.ColumnConstraints(); column0Constraints.setHgrow( javafx.scene.layout.Priority.ALWAYS ); pane.getColumnConstraints().addAll( column0Constraints ); row0Constraints = new javafx.scene.layout.RowConstraints(); row0Constraints.setVgrow( javafx.scene.layout.Priority.ALWAYS ); row1Constraints = new javafx.scene.layout.RowConstraints(); row1Constraints.setVgrow( javafx.scene.layout.Priority.NEVER ); pane.getRowConstraints().addAll( row0Constraints, row1Constraints ); javafx.scene.layout.GridPane.setConstraints( prerequisiteTable, 0, 0, 1, 1, javafx.geometry.HPos.CENTER, javafx.geometry.VPos.CENTER ); javafx.scene.layout.GridPane.setConstraints( buttonPane, 0, 1, 1, 1, javafx.geometry.HPos.CENTER, javafx.geometry.VPos.CENTER ); pane.getChildren().addAll( prerequisiteTable, buttonPane ); return pane; } final private javafx.scene.layout.Pane buildDependentsPane( TestData testData, boolean showTestPopupMenu, Undercamber undercamber, javafx.stage.Window ownerWindow ) { javafx.scene.control.TableView<DependencyTableRowData> dependentsTable; javafx.scene.layout.Pane buttonPane; javafx.scene.layout.GridPane pane; javafx.scene.layout.ColumnConstraints column0Constraints; javafx.scene.layout.RowConstraints row0Constraints; javafx.scene.layout.RowConstraints row1Constraints; dependentsTable = makeDependentTable( testData, showTestPopupMenu, undercamber, ownerWindow ); buttonPane = makeButtonPane(); pane = new javafx.scene.layout.GridPane(); column0Constraints = new javafx.scene.layout.ColumnConstraints(); column0Constraints.setHgrow( javafx.scene.layout.Priority.ALWAYS ); pane.getColumnConstraints().addAll( column0Constraints ); row0Constraints = new javafx.scene.layout.RowConstraints(); row0Constraints.setVgrow( javafx.scene.layout.Priority.ALWAYS ); row1Constraints = new javafx.scene.layout.RowConstraints(); row1Constraints.setVgrow( javafx.scene.layout.Priority.NEVER ); pane.getRowConstraints().addAll( row0Constraints, row1Constraints ); javafx.scene.layout.GridPane.setConstraints( dependentsTable, 0, 0, 1, 1, javafx.geometry.HPos.CENTER, javafx.geometry.VPos.CENTER ); javafx.scene.layout.GridPane.setConstraints( buttonPane, 0, 1, 1, 1, javafx.geometry.HPos.CENTER, javafx.geometry.VPos.CENTER ); pane.getChildren().addAll( dependentsTable, buttonPane ); return pane; } final private javafx.scene.control.TableView<DependencyTableRowData> makePrerequisiteTable( TestData testData, boolean showTestPopupMenu, Undercamber undercamber, javafx.stage.Window ownerWindow ) { javafx.scene.control.TableView<DependencyTableRowData> table; javafx.scene.control.TableColumn<DependencyTableRowData,DependencyTableRowData> tableColumn; java.util.Set<DependencyTableRowData> prerequisites; java.util.List<DependencyTableRowData> prerequisiteList; table = new javafx.scene.control.TableView<DependencyTableRowData>(); tableColumn = new javafx.scene.control.TableColumn<DependencyTableRowData,DependencyTableRowData>( "Test Set" ); tableColumn.setCellValueFactory( cellDataFactory -> new NoOpObservable<DependencyTableRowData>(cellDataFactory.getValue()) ); tableColumn.setCellFactory( column -> new DependencyTableCell(showTestPopupMenu, DependencyTableCell.Column.TEST_SET, ownerWindow) ); tableColumn.setSortable( false ); table.getColumns().add( tableColumn ); tableColumn = new javafx.scene.control.TableColumn<DependencyTableRowData,DependencyTableRowData>( "Prerequisite" ); tableColumn.setCellValueFactory( cellDataFactory -> new NoOpObservable<DependencyTableRowData>(cellDataFactory.getValue()) ); tableColumn.setCellFactory( column -> new DependencyTableCell(showTestPopupMenu, DependencyTableCell.Column.DEPENDENCY, ownerWindow) ); tableColumn.setSortable( false ); table.getColumns().add( tableColumn ); tableColumn = new javafx.scene.control.TableColumn<DependencyTableRowData,DependencyTableRowData>( "Type" ); tableColumn.setCellValueFactory( cellDataFactory -> new NoOpObservable<DependencyTableRowData>(cellDataFactory.getValue()) ); tableColumn.setCellFactory( column -> new DependencyTableCell(showTestPopupMenu, DependencyTableCell.Column.TYPE, ownerWindow) ); tableColumn.setSortable( false ); table.getColumns().add( tableColumn ); prerequisites = new java.util.HashSet<DependencyTableRowData>(); for ( TestData prerequisite : testData.listFixedPrerequisites() ) { prerequisites.add( new DependencyTableRowData(undercamber, prerequisite, Prerequisite.Type.FIXED) ); } for ( TestData prerequisite : testData.listUnsatisfiedConditionalPrerequisites() ) { prerequisites.add( new DependencyTableRowData(undercamber, prerequisite, Prerequisite.Type.CONDITIONAL_NOT_PREVIOUSLY_SATISFIED) ); } for ( TestData prerequisite : testData.listPreviouslySatisfiedConditionalPrerequisites() ) { prerequisites.add( new DependencyTableRowData(undercamber, prerequisite, Prerequisite.Type.CONDITIONAL_PREVIOUSLY_SATISFIED) ); } prerequisiteList = new java.util.ArrayList<DependencyTableRowData>(); prerequisiteList.addAll( prerequisites ); java.util.Collections.sort( prerequisiteList ); table.getItems().addAll( prerequisiteList ); return table; } final private javafx.scene.control.TableView<DependencyTableRowData> makeDependentTable( TestData testData, boolean showTestPopupMenu, Undercamber undercamber, javafx.stage.Window ownerWindow ) { javafx.scene.control.TableView<DependencyTableRowData> table; javafx.scene.control.TableColumn<DependencyTableRowData,DependencyTableRowData> tableColumn; java.util.Set<DependencyTableRowData> dependents; java.util.List<DependencyTableRowData> dependentList; table = new javafx.scene.control.TableView<DependencyTableRowData>(); tableColumn = new javafx.scene.control.TableColumn<DependencyTableRowData,DependencyTableRowData>( "Test Set" ); tableColumn.setCellValueFactory( cellDataFactory -> new NoOpObservable<DependencyTableRowData>(cellDataFactory.getValue()) ); tableColumn.setCellFactory( column -> new DependencyTableCell(showTestPopupMenu, DependencyTableCell.Column.TEST_SET, _stage) ); tableColumn.setSortable( false ); table.getColumns().add( tableColumn ); tableColumn = new javafx.scene.control.TableColumn<DependencyTableRowData,DependencyTableRowData>( "Dependent" ); tableColumn.setCellValueFactory( cellDataFactory -> new NoOpObservable<DependencyTableRowData>(cellDataFactory.getValue()) ); tableColumn.setCellFactory( column -> new DependencyTableCell(showTestPopupMenu, DependencyTableCell.Column.DEPENDENCY, _stage) ); tableColumn.setSortable( false ); table.getColumns().add( tableColumn ); tableColumn = new javafx.scene.control.TableColumn<DependencyTableRowData,DependencyTableRowData>( "Type" ); tableColumn.setCellValueFactory( cellDataFactory -> new NoOpObservable<DependencyTableRowData>(cellDataFactory.getValue()) ); tableColumn.setCellFactory( column -> new DependencyTableCell(showTestPopupMenu, DependencyTableCell.Column.TYPE, _stage) ); tableColumn.setSortable( false ); table.getColumns().add( tableColumn ); dependents = new java.util.HashSet<DependencyTableRowData>(); for ( TestData dependent : testData.listFixedDependents() ) { dependents.add( new DependencyTableRowData(undercamber, dependent, Prerequisite.Type.FIXED) ); } for ( TestData dependent : testData.listUnsatisfiedConditionalDependents() ) { dependents.add( new DependencyTableRowData(undercamber, dependent, Prerequisite.Type.CONDITIONAL_NOT_PREVIOUSLY_SATISFIED) ); } for ( TestData dependent : testData.listSatisfiedConditionalDependents() ) { dependents.add( new DependencyTableRowData(undercamber, dependent, Prerequisite.Type.CONDITIONAL_PREVIOUSLY_SATISFIED) ); } dependentList = new java.util.ArrayList<DependencyTableRowData>(); dependentList.addAll( dependents ); java.util.Collections.sort( dependentList ); table.getItems().addAll( dependentList ); return table; } final private javafx.scene.layout.Pane makeButtonPane() { javafx.scene.layout.GridPane buttonPane; javafx.scene.layout.ColumnConstraints column0Constraints; javafx.scene.layout.RowConstraints row0Constraints; _closeButton = new javafx.scene.control.Button( "Close" ); _closeButton.setOnAction( event -> onCloseRequest() ); buttonPane = new javafx.scene.layout.GridPane(); column0Constraints = new javafx.scene.layout.ColumnConstraints(); column0Constraints.setHgrow( javafx.scene.layout.Priority.ALWAYS ); buttonPane.getColumnConstraints().addAll( column0Constraints ); row0Constraints = new javafx.scene.layout.RowConstraints(); row0Constraints.setVgrow( javafx.scene.layout.Priority.ALWAYS ); buttonPane.getRowConstraints().addAll( row0Constraints ); javafx.scene.layout.GridPane.setConstraints( _closeButton, 0, 0, 1, 1, javafx.geometry.HPos.CENTER, javafx.geometry.VPos.CENTER ); buttonPane.getChildren().addAll( _closeButton ); return buttonPane; } final private void handleKeyPress( javafx.scene.input.KeyEvent event ) { if ( Utilities.ENTER_KEYBOARD_COMBINATION.match(event) ) { if ( _undercamber != null ) { _undercamber.runGUISelectedTests(); event.consume(); } } else if ( Undercamber.CONTROL_A_KEYBOARD_COMBINATION.match(event) ) { if ( _undercamber != null ) { event.consume(); _undercamber.runAllTests(); } } else if ( Utilities.ESCAPE_KEYBOARD_COMBINATION.match(event) ) { _stage.close(); event.consume(); } } final void onCloseRequest() { _stage.setWidth( _stage.getWidth() ); _stage.setHeight( _stage.getHeight() ); _stage.setX( _stage.getX() ); _stage.setY( _stage.getY() ); _stage.close(); } final void show() { _stage.show(); _stage.requestFocus(); } }
51.159274
143
0.564966
807d3606213fc25b724950e39c622d3d144e61fb
1,427
/* * Copyright (c) 2011-2025 PiChen */ package com.github.peterchenhdu.future.auth.cas.services; import com.github.peterchenhdu.future.auth.cas.authentication.principal.Service; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import java.util.regex.Pattern; /** * Mutable registered service that uses Java regular expressions for service matching. * * @author Marvin S. Addison * @version $Revision: $ */ @Entity @DiscriminatorValue("regex") public class RegexRegisteredService extends AbstractRegisteredService { /** * Serialization version marker */ private static final long serialVersionUID = -8258660210826975771L; private transient Pattern servicePattern; public void setServiceId(final String id) { servicePattern = createPattern(id); serviceId = id; } public boolean matches(final Service service) { if (servicePattern == null) { servicePattern = createPattern(serviceId); } return service != null && servicePattern.matcher(service.getId()).matches(); } protected AbstractRegisteredService newInstance() { return new RegexRegisteredService(); } private Pattern createPattern(final String pattern) { if (pattern == null) { throw new IllegalArgumentException("Pattern cannot be null."); } return Pattern.compile(pattern); } }
27.980392
86
0.699369
8eb8132dfb4b7993e24d39965c3a6392e42c5a21
1,170
package algorithms; public class BubbleSort { public static void sort(int[] array) { int n = array.length; boolean swapped = false; for (int i = 0; i < n - 1; i++) { swapped = false; System.out.println("Iteration " + (i + 1) + ":"); for (int j = 0; j < n - 1 - i; j++) { displayArray(array); if (array[j] > array[j+1]) { swap(array, j, j+1); swapped = true; } } if (!swapped) { break; } } } private static void swap(int[] array, int index1, int index2) { int temp = array[index1]; array[index1] = array[index2]; array[index2] = temp; } private static void displayArray(int[] array) { for (int i : array) { System.out.print(i + " "); } System.out.println(); } public static void main(String[] args) { var array = new int[] {7, 12, 0, 10, 6, 3, 5, 2, 5}; sort(array); System.out.println("\nSorted array:"); displayArray(array); } }
24.893617
67
0.447863
ca93ee8a6df9a25b214727c5b619d8e46689798f
2,979
package com.infinityraider.agricraft.handler; import com.agricraft.agricore.core.AgriCore; import com.agricraft.agricore.log.AgriLogger; import com.agricraft.agricore.plant.AgriMutation; import com.agricraft.agricore.plant.AgriPlant; import com.agricraft.agricore.plant.AgriSoil; import com.infinityraider.agricraft.network.json.MessageSyncMutationJson; import com.infinityraider.agricraft.network.json.MessageSyncPlantJson; import com.infinityraider.agricraft.network.json.MessageSyncSoilJson; import java.util.Iterator; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.PlayerEvent; public class PlayerConnectToServerHandler { private static final AgriLogger LOG = AgriCore.getLogger("agricraft-net"); @SubscribeEvent @SuppressWarnings("unused") public void onConnect(PlayerEvent.PlayerLoggedInEvent event) { EntityPlayerMP player = (EntityPlayerMP) event.player; syncSoils(player); syncPlants(player); syncMutations(player); } private void syncSoils(EntityPlayerMP player) { LOG.debug("Sending soils to player: " + player.getDisplayNameString()); final int count = AgriCore.getSoils().getAll().size(); Iterator<AgriSoil> it = AgriCore.getSoils().getAll().iterator(); for (int i = 0; it.hasNext(); i++) { AgriSoil soil = it.next(); LOG.debug("Sending Soil: {0} ({1} of {2})", soil, i + 1, count); new MessageSyncSoilJson(soil, i, count).sendTo(player); } LOG.debug("Finished sending soils to player: " + player.getDisplayNameString()); } private void syncPlants(EntityPlayerMP player) { LOG.debug("Sending plants to player: " + player.getDisplayNameString()); final int count = AgriCore.getPlants().getAll().size(); Iterator<AgriPlant> it = AgriCore.getPlants().getAll().iterator(); for (int i = 0; it.hasNext(); i++) { AgriPlant plant = it.next(); LOG.debug("Sending plant: {0} ({1} of {2})", plant.getPlantName(), i + 1, count); new MessageSyncPlantJson(plant, i, count).sendTo(player); } LOG.debug("Finished sending plants to player: " + player.getDisplayNameString()); } private void syncMutations(EntityPlayerMP player) { LOG.debug("Sending mutations to player: " + player.getDisplayNameString()); final int count = AgriCore.getMutations().getAll().size(); final Iterator<AgriMutation> it = AgriCore.getMutations().getAll().iterator(); for (int i = 0; it.hasNext(); i++) { AgriMutation mutation = it.next(); LOG.debug("Sending mutation: ({0} of {1})", i + 1, count); new MessageSyncMutationJson(mutation, i, count).sendTo(player); } LOG.debug("Finished sending mutations to player: " + player.getDisplayNameString()); } }
45.136364
93
0.682108
af4cb2e1f2c8b58c3bd3b86b2bb1aaeff5dee62b
2,589
package xworker.app.rest; import java.io.IOException; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.util.EntityUtils; import org.xmeta.ActionContext; import org.xmeta.ActionException; import org.xmeta.Thing; import xworker.httpclient.HttpClientManager; public class RestActions { /** * RestResource的getUrl方法的实现。 * * @param actionContext * @return */ public static Object get(ActionContext actionContext){ Thing self = (Thing) actionContext.get("self"); //获得Get Thing getThing = self.getThing("Get@0"); if(getThing == null){ throw new ActionException("Get not defiend, path=" + self.getMetadata().getPath()); } //获取URL String url = (String) self.doAction("getUrl", actionContext); HttpGet get = new HttpGet(url); return doRequest(self, getThing, get, actionContext); } public static Object doRequest(Thing self, Thing requestThing, HttpUriRequest request, ActionContext actionContext){ //httpClient HttpClient httpclient = HttpClientManager.getDefaultHttpClient(); HttpResponse response = null; HttpEntity entity = null; try{ response = httpclient.execute(request); entity = response.getEntity(); int status = response.getStatusLine().getStatusCode(); String content = EntityUtils.toString(entity); Thing responseThing = getResponseBodyThing(requestThing, status); return self.doAction("onSuccess", actionContext); }catch(Exception e){ throw new ActionException("Execute http request error, " + request + ", path=" + self.getMetadata().getPath(), e); }finally{ if(entity != null){ try { EntityUtils.consume(entity); } catch (IOException e) { e.printStackTrace(); } } } } public static Thing parseResponse(Thing responseThing, String content){ Thing bodyThing = responseThing.getThing("ResponseBody@0"); if(bodyThing == null){ return null; } String format = responseThing.getString("format"); if("json".equals(format)){ } return null; } public static Thing getResponseBodyThing(Thing requestThing, int httpStatus){ for(Thing thing : requestThing.getChilds("Response")){ if(thing.getInt("status") == httpStatus){ return thing; } } return null; } }
26.418367
121
0.668984
a091c5c7030314ecf987c68233b51f578809eb40
2,077
package Models; import java.util.ArrayList; import java.util.List; public class School { private long id; private String name; private List<Class> classes = new ArrayList<>(); private List<Student> student = new ArrayList<>(); private List<Staffs> staffs = new ArrayList<>(); private String address; private String description; private SchoolType schoolType; private static long counter = 0; public School(String name, String description, SchoolType schoolType) { this.id = ++counter; this.name = name; this.description = description; this.schoolType = schoolType; } public School() { this.id = ++counter; } 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 List<Class> getClasses() { return classes; } public void setClasses(List<Class> classes) { this.classes = classes; } public List<Student> getStudent() { return student; } public void setStudent(List<Student> student) { this.student = student; } public List<Staffs> getStaffs() { return staffs; } public void setStaffs(List<Staffs> staffs) { this.staffs = staffs; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public SchoolType getSchoolType() { return schoolType; } public void setSchoolType(SchoolType schoolType) { this.schoolType = schoolType; } public void addClass(Class _class){ classes.add(_class); } public void removeClass(Class _class){ classes.remove(_class); } }
20.564356
75
0.608089
91eb2c08858e3168bdf9bf4905346e6f944f973c
182
package com.elven.danmaku.core.input; public interface InputReceiver { public void pressed(int keyCode); public void released(int keyCode); public void clear(); }
16.545455
38
0.708791
11c556dea856408d2b8fe407c363b7a4251508d6
1,853
package net.minecraft.client.renderer.entity; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelSlime; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.layers.LayerSlimeGel; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntitySlime; import net.minecraft.util.ResourceLocation; public class RenderSlime extends RenderLiving<EntitySlime> { private static final ResourceLocation SLIME_TEXTURES = new ResourceLocation("textures/entity/slime/slime.png"); public RenderSlime(RenderManager p_i47193_1_) { super(p_i47193_1_, (ModelBase)new ModelSlime(16), 0.25F); addLayer(new LayerSlimeGel(this)); } public void doRender(EntitySlime entity, double x, double y, double z, float entityYaw, float partialTicks) { this.shadowSize = 0.25F * entity.getSlimeSize(); super.doRender(entity, x, y, z, entityYaw, partialTicks); } protected void preRenderCallback(EntitySlime entitylivingbaseIn, float partialTickTime) { float f = 0.999F; GlStateManager.scale(0.999F, 0.999F, 0.999F); float f1 = entitylivingbaseIn.getSlimeSize(); float f2 = (entitylivingbaseIn.prevSquishFactor + (entitylivingbaseIn.squishFactor - entitylivingbaseIn.prevSquishFactor) * partialTickTime) / (f1 * 0.5F + 1.0F); float f3 = 1.0F / (f2 + 1.0F); GlStateManager.scale(f3 * f1, 1.0F / f3 * f1, f3 * f1); } protected ResourceLocation getEntityTexture(EntitySlime entity) { return SLIME_TEXTURES; } } /* Location: C:\Users\BSV\AppData\Local\Temp\Rar$DRa6216.20396\Preview\Preview.jar!\net\minecraft\client\renderer\entity\RenderSlime.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
42.113636
166
0.754452
118674db259adb4946d11c7d7572e06f2424f843
2,048
package com.aharpour.adventofcode; import java.util.HashSet; import java.util.IntSummaryStatistics; import java.util.Set; import static java.lang.Math.max; /** * @author Ebrahim Aharpour * @since 12/20/2018 */ public class Day20Question1 { private int maxTerminalPath = 0; private char[] input; private int index = 1; public Day20Question1(String input) { this.input = input.toCharArray(); if (this.input.length <= 1) { throw new IllegalArgumentException(); } } public int calculate() { return calculate(0); } private int calculate(int cv) { Set<Integer> paths = new HashSet<>(); int c = 0; while (index < input.length) { char ch = input[index]; index++; switch (ch) { case '(': c = c + calculate(cv + c); break; case ')': paths.add(c); IntSummaryStatistics stat = paths.stream().mapToInt(i -> i) .summaryStatistics(); int min = stat.getMin(); if (min == 0) { maxTerminalPath = max(maxTerminalPath, cv + (stat.getMax() / 2)); } else { maxTerminalPath = max(maxTerminalPath, cv + stat.getMax()); } return min; case '|': paths.add(c); c = 0; break; case '$': paths.add(c); return max(cv + paths.stream().mapToInt(i -> i).max().getAsInt(), maxTerminalPath); case 'N': case 'E': case 'S': case 'W': c++; break; default: throw new IllegalArgumentException(); } } return 0; } }
27.675676
103
0.428223
d326d18c4c9218149e4fc066a64b23099a0cab34
5,737
// Generated from InputExpression.g4 by ANTLR 4.5.1 package ch03.parser.expression.input; import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.tree.ErrorNode; import org.antlr.v4.runtime.tree.TerminalNode; /** * This class provides an empty implementation of {@link InputExpressionListener}, * which can be extended to create a listener which only needs to handle a subset * of the available methods. */ public class InputExpressionBaseListener implements InputExpressionListener { /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterBooleanExpression(InputExpressionParser.BooleanExpressionContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitBooleanExpression(InputExpressionParser.BooleanExpressionContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterBracketBooleanExpression(InputExpressionParser.BracketBooleanExpressionContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitBracketBooleanExpression(InputExpressionParser.BracketBooleanExpressionContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterLt(InputExpressionParser.LtContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitLt(InputExpressionParser.LtContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterNot(InputExpressionParser.NotContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitNot(InputExpressionParser.NotContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterAnd(InputExpressionParser.AndContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitAnd(InputExpressionParser.AndContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterOr(InputExpressionParser.OrContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitOr(InputExpressionParser.OrContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterExpression(InputExpressionParser.ExpressionContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitExpression(InputExpressionParser.ExpressionContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterTerm(InputExpressionParser.TermContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitTerm(InputExpressionParser.TermContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterName(InputExpressionParser.NameContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitName(InputExpressionParser.NameContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterDereference(InputExpressionParser.DereferenceContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitDereference(InputExpressionParser.DereferenceContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterPlus(InputExpressionParser.PlusContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitPlus(InputExpressionParser.PlusContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterList(InputExpressionParser.ListContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitList(InputExpressionParser.ListContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterNumber(InputExpressionParser.NumberContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitNumber(InputExpressionParser.NumberContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterString(InputExpressionParser.StringContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitString(InputExpressionParser.StringContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void enterEveryRule(ParserRuleContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void exitEveryRule(ParserRuleContext ctx) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void visitTerminal(TerminalNode node) { } /** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */ @Override public void visitErrorNode(ErrorNode node) { } }
27.714976
115
0.698449
5a2b23ce88bbf5fd4488af81adcd5b48199b34de
1,635
/* * Copyright © 2021 <a href="mailto:zhang.h.n@foxmail.com">Zhang.H.N</a>. * * Licensed under the Apache License, Version 2.0 (thie "License"); * You may not use this file except in compliance with the license. * You may obtain a copy of the License at * * http://wwww.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 govering permissions and * limitations under the License. */ package org.gcszhn.server.http; import javax.servlet.http.HttpServletRequest; import org.gcszhn.system.log.HttpRequestLog; import org.gcszhn.system.service.user.UserService; import org.gcszhn.system.service.user.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; /** * 用户注册控制器 * @author Zhang.H.N * @version 1.0 */ @RestController public class UserRegisterController { /**用户服务 */ @Autowired UserService userService; @Autowired HttpServletRequest request; @GetMapping("/register") public User doRegister(@RequestParam String ac, @RequestParam String pwd, @RequestParam String address) { HttpRequestLog.log(request); User user = userService.createUser(ac, pwd, address); userService.registerAccount(user); return user; } }
34.0625
109
0.744343
c3fcaf1f68ec71e567cbffda460e648e66e4f084
1,631
/* * Copyright 2016 Roberto Attias * * 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 haruspex.common.event; import java.io.PrintWriter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import haruspex.common.ID; import haruspex.common.TagList; public class PrintWriterSink implements IEventSink { private final static Logger logger = LoggerFactory.getLogger(PrintWriterSink.class); private final PrintWriter pw; private final IEventCodec codec; public PrintWriterSink(PrintWriter pw) { this(pw, new JSONEventCodec()); } public PrintWriterSink(PrintWriter pw, IEventCodec codec) { this.pw = pw; this.codec = codec; } @Override public void flush() { pw.flush(); } public void close() { pw.close(); } public boolean isLossy() { return false; } @Override public void put(long seqNum, long timeStamp, ID[] context, TagList... tags) { try { pw.println(codec.encode(seqNum, timeStamp, context, tags)); pw.flush(); } catch (CodecException ex) { logger.error("Error while encoding event", ex); } } }
25.484375
86
0.70325
554212586ab8f2aa21985fbb29f31acfb1c103a8
1,993
package org.apache.maven.repository.legacy; /* * 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. */ import org.apache.maven.wagon.TransferFailedException; /** * WagonConfigurationException */ public class WagonConfigurationException extends TransferFailedException { static final long serialVersionUID = 1; private final String originalMessage; private final String repositoryId; public WagonConfigurationException( String repositoryId, String message, Throwable cause ) { super( "While configuring wagon for \'" + repositoryId + "\': " + message, cause ); this.repositoryId = repositoryId; this.originalMessage = message; } public WagonConfigurationException( String repositoryId, String message ) { super( "While configuring wagon for \'" + repositoryId + "\': " + message ); this.repositoryId = repositoryId; this.originalMessage = message; } public final String getRepositoryId() { return repositoryId; } public final String getOriginalMessage() { return originalMessage; } }
30.19697
91
0.671851
76c59048c1a7e66819f78f8b372fafa99443d619
2,885
/* * Licensed to Metamarkets Group Inc. (Metamarkets) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Metamarkets 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 io.druid.server.coordination; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableMap; import io.druid.jackson.DefaultObjectMapper; import io.druid.segment.IndexIO; import io.druid.timeline.DataSegment; import io.druid.timeline.partition.NoneShardSpec; import org.joda.time.Interval; import org.junit.Assert; import org.junit.Test; import java.util.Arrays; import java.util.Map; /** */ public class SegmentChangeRequestDropTest { @Test public void testV1Serialization() throws Exception { ObjectMapper mapper = new DefaultObjectMapper(); final Interval interval = new Interval("2011-10-01/2011-10-02"); final ImmutableMap<String, Object> loadSpec = ImmutableMap.<String, Object>of("something", "or_other"); DataSegment segment = new DataSegment( "something", interval, "1", loadSpec, Arrays.asList("dim1", "dim2"), Arrays.asList("met1", "met2"), NoneShardSpec.instance(), IndexIO.CURRENT_VERSION_ID, 1 ); final SegmentChangeRequestDrop segmentDrop = new SegmentChangeRequestDrop(segment); Map<String, Object> objectMap = mapper.readValue( mapper.writeValueAsString(segmentDrop), new TypeReference<Map<String, Object>>(){} ); Assert.assertEquals(11, objectMap.size()); Assert.assertEquals("drop", objectMap.get("action")); Assert.assertEquals("something", objectMap.get("dataSource")); Assert.assertEquals(interval.toString(), objectMap.get("interval")); Assert.assertEquals("1", objectMap.get("version")); Assert.assertEquals(loadSpec, objectMap.get("loadSpec")); Assert.assertEquals("dim1,dim2", objectMap.get("dimensions")); Assert.assertEquals("met1,met2", objectMap.get("metrics")); Assert.assertEquals(ImmutableMap.of("type", "none"), objectMap.get("shardSpec")); Assert.assertEquals(IndexIO.CURRENT_VERSION_ID, objectMap.get("binaryVersion")); Assert.assertEquals(1, objectMap.get("size")); } }
36.518987
107
0.732062
1c92eb46bddf85eb8ff16a6542b6cccd18102cda
12,139
/** * @(#)PaletteLookAndFeel.java * * Copyright (c) 2008 by the original authors of JHotDraw * and all its contributors. * All rights reserved. * * The copyright of this software is owned by the authors and * contributors of the JHotDraw project ("the copyright holders"). * You may not use, copy or modify this software, except in * accordance with the license agreement you entered into with * the copyright holders. For details see accompanying license terms. */ package org.jhotdraw.gui.plaf.palette; import java.awt.*; import javax.swing.*; import javax.swing.UIDefaults.*; import javax.swing.border.Border; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; /** * A LookAndFeel for components in the palette windows of a drawing editor. * * @author Werner Randelshofer * @version $Id: PaletteLookAndFeel.java 538 2009-06-17 14:46:51Z rawcoder $ */ public class PaletteLookAndFeel extends BasicLookAndFeel { /** * Shared instance. */ private static PaletteLookAndFeel instance; /** * Cached defaults. */ private UIDefaults cachedDefaults; public static PaletteLookAndFeel getInstance() { if (instance == null) { instance = new PaletteLookAndFeel(); } return instance; } @Override public String getName() { return "Palette Look and Feel"; } @Override public String getID() { return "Palette"; } @Override public String getDescription() { return "A look and feel for palette components"; } @Override public boolean isNativeLookAndFeel() { return false; } @Override public boolean isSupportedLookAndFeel() { return true; } public UIDefaults getCachedDefaults() { if (cachedDefaults == null) { cachedDefaults = getDefaults(); } return cachedDefaults; } /** * Looks up up the given key in our Hashtable and resolves LazyValues * or ActiveValues. */ public Object get(Object key) { UIDefaults defaults = getCachedDefaults(); /* Quickly handle the common case, without grabbing * a lock. */ Object value = defaults.get(key); if (!(value instanceof ActiveValue) && !(value instanceof LazyValue)) { return value; } /* At this point we know that the value of key was * a LazyValue or an ActiveValue. */ if (value instanceof LazyValue) { try { /* If an exception is thrown we'll just put the LazyValue * back in the table. */ value = ((LazyValue) value).createValue(defaults); } finally { if (value == null) { defaults.remove(key); } else { defaults.put(key, value); } } } else { value = ((ActiveValue) value).createValue(defaults); } return value; } public Font getFont(String key) { return (Font) get(key); } public Border getBorder(String key) { return (Border) get(key); } public Color getColor(String key) { return (Color) get(key); } public Insets getInsets(String key) { return (Insets) get(key); } public boolean getBoolean(String key) { return ((Boolean) get(key)).booleanValue(); } /** * Convenience method for initializing a components foreground * background and font properties with values from the current * defaults table. The properties are only set if the current * value is either null or a UIResource. * * @param c the target component for installing default color/font properties * @param defaultBgName the key for the default background * @param defaultFgName the key for the default foreground * @param defaultFontName the key for the default font * * @see #installColors * @see UIManager#getColor * @see UIManager#getFont */ public static void installColorsAndFont(JComponent c, String defaultBgName, String defaultFgName, String defaultFontName) { Font f = c.getFont(); if (f == null || f instanceof UIResource) { c.setFont(getInstance().getFont(defaultFontName)); } installColors(c, defaultBgName, defaultFgName); } /** * Convenience method for installing a component's default Border * object on the specified component if either the border is * currently null or already an instance of UIResource. * @param c the target component for installing default border * @param defaultBorderName the key specifying the default border */ public static void installBorder(JComponent c, String defaultBorderName) { Border b = c.getBorder(); //if (b == null || b instanceof UIResource) { c.setBorder(getInstance().getBorder(defaultBorderName)); //} } /** * Convenience method for initializing a component's foreground * and background color properties with values from the current * defaults table. The properties are only set if the current * value is either null or a UIResource. * * @param c the target component for installing default color/font properties * @param defaultBgName the key for the default background * @param defaultFgName the key for the default foreground * * @see #installColorsAndFont * @see UIManager#getColor */ public static void installColors(JComponent c, String defaultBgName, String defaultFgName) { Color bg = c.getBackground(); if (bg == null || bg instanceof UIResource) { c.setBackground(getInstance().getColor(defaultBgName)); } Color fg = c.getForeground(); if (fg == null || fg instanceof UIResource) { c.setForeground(getInstance().getColor(defaultFgName)); } } @Override protected void initComponentDefaults(UIDefaults table) { super.initComponentDefaults(table); table.addResourceBundle("org.jhotdraw.gui.Labels"); // *** Shared Fonts Integer eleven = new Integer(11); Integer twelve = new Integer(12); Integer fontPlain = new Integer(Font.PLAIN); Integer fontBold = new Integer(Font.BOLD); Object dialogPlain11 = new ProxyLazyValue( "javax.swing.plaf.FontUIResource", null, new Object[]{"Dialog Sans", fontPlain, eleven}); Object dialogPlain12 = new ProxyLazyValue( "javax.swing.plaf.FontUIResource", null, new Object[]{"Dialog Sans", fontPlain, twelve}); Object fieldPlain12 = new ProxyLazyValue( "javax.swing.plaf.FontUIResource", null, new Object[]{"Verdana", fontPlain, twelve}); Object serifPlain12 = new ProxyLazyValue( "javax.swing.plaf.FontUIResource", null, new Object[]{"Serif", fontPlain, twelve}); Object sansSerifPlain12 = new ProxyLazyValue( "javax.swing.plaf.FontUIResource", null, new Object[]{"SansSerif", fontPlain, twelve}); Object monospacedPlain12 = new ProxyLazyValue( "javax.swing.plaf.FontUIResource", null, new Object[]{"MonoSpaced", fontPlain, twelve}); Object dialogBold12 = new ProxyLazyValue( "javax.swing.plaf.FontUIResource", null, new Object[]{"Dialog", fontBold, twelve}); // *** Shared Colors ColorUIResource black = new ColorUIResource(Color.black); ColorUIResource control = new ColorUIResource(0xf0f0f0); ColorUIResource controlText = black; ColorUIResource selectionBackground = new ColorUIResource(0xb5d5ff); ColorUIResource selectionForeground = black; // *** Shared Insets InsetsUIResource zeroInsets = new InsetsUIResource(0, 0, 0, 0); InsetsUIResource twoInsets = new InsetsUIResource(2, 2, 2, 2); // *** Shared Borders /*Object buttonBorder = new ProxyLazyValue( "org.jhotdraw.gui.plaf.palette.BackdropBorder$UIResource", new Object[] {new PaletteButtonBorder()});*/ Object buttonBorder = new BackdropBorder.UIResource(new PaletteButtonBorder()); Object textBorder = new BackdropBorder.UIResource(new PaletteTextComponentBorder()); Object[] defaults = { // *** Fonts "SmallSystemFont", dialogPlain11, // *** Buttons "Button.font", dialogPlain12, "Button.background", control, "Button.foreground", controlText, "Button.border", buttonBorder, "Button.margin", zeroInsets, // *** FontChooser "Button.background", control, "Button.foreground", controlText, "Button.border", buttonBorder, "Button.margin", zeroInsets, // *** FormattedTextField "FormattedTextField.font", fieldPlain12, "FormattedTextField.background", control, "FormattedTextField.foreground", controlText, "FormattedTextField.border", textBorder, "FormattedTextField.margin", zeroInsets, "FormattedTextField.opaque", Boolean.TRUE, "FormattedTextField.errorIndicatorForeground", new ColorUIResource(0xfe4a41), "FormattedTextField.selectionBackground", selectionBackground, "FormattedTextField.selectionForeground", selectionForeground, // *** Labels "Label.font", dialogPlain12, // *** Ribbons "Ribbon.border", new UIDefaults.ProxyLazyValue("javax.swing.border.MatteBorder", new Object[] {new Insets(1,0,0,0), new Color(0x777777)}), // // *** ScrollPane "ScrollPane.border", new UIDefaults.ProxyLazyValue("javax.swing.border.MatteBorder", new Object[] {new Insets(1,1,1,1), new Color(0xa5a5a5)}), // // *** Slider "Slider.background", control, "Slider.foreground", controlText, "Slider.horizontalSize", new DimensionUIResource(100, 20), "Slider.verticalSize", new DimensionUIResource(20, 100), // *** TextArea "TextArea.selectionBackground", selectionBackground, "TextArea.selectionForeground", selectionForeground, // *** TextField "TextField.font", fieldPlain12, "TextField.background", control, "TextField.foreground", controlText, "TextField.border", textBorder, "TextField.margin", zeroInsets, "TextField.opaque", Boolean.TRUE, "TextField.selectionBackground", selectionBackground, "TextField.selectionForeground", selectionForeground, // *** ToolBar "ToolBar.font", dialogPlain12, "ToolBar.background", control, "ToolBar.foreground", controlText, "ToolBar.dockingBackground", control, // "ToolBar.dockingForeground", red, "ToolBar.floatingBackground", control, // "ToolBar.floatingForeground", darkGray, // "ToolBar.border", etchedBorder, "ToolBar.border", new UIDefaults.ProxyLazyValue("org.jhotdraw.gui.plaf.palette.PaletteToolBarBorder$UIResource"), // // "ToolBar.separatorSize", toolBarSeparatorSize, }; table.putDefaults(defaults); } /** * Returns the ui that is of type <code>klass</code>, or null if * one can not be found. */ static Object getUIOfType(ComponentUI ui, Class klass) { if (klass.isInstance(ui)) { return ui; } return null; } }
35.494152
157
0.60664
50564937d22256aa398cec9f40219a7748a3cd0c
3,413
package pl.asie.technotronics.utils; import io.netty.buffer.ByteBuf; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import cpw.mods.fml.common.network.FMLOutboundHandler; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.relauncher.Side; import pl.asie.technotronics.Technotronics; import pl.asie.technotronics.utils.network.Packet; public final class NetworkUtils { private NetworkUtils() { } public static void sendToAll(Packet message) { Technotronics.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL); Technotronics.channels.get(Side.SERVER).writeOutbound(message); } public static void sendTo(Packet message, EntityPlayerMP player) { Technotronics.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); Technotronics.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); Technotronics.channels.get(Side.SERVER).writeOutbound(message); } public static void sendToAllAround(Packet message, NetworkRegistry.TargetPoint point) { Technotronics.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); Technotronics.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); Technotronics.channels.get(Side.SERVER).writeOutbound(message); } public static void sendToDimension(Packet message, int dimensionId) { Technotronics.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.DIMENSION); Technotronics.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId); Technotronics.channels.get(Side.SERVER).writeOutbound(message); } public static void sendToServer(Packet message) { Technotronics.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); Technotronics.channels.get(Side.CLIENT).writeOutbound(message); } public static void sendToAllAround(Packet packet, TileEntity entity, double d) { sendToAllAround(packet, new NetworkRegistry.TargetPoint(entity.getWorldObj().provider.dimensionId, entity.xCoord, entity.yCoord, entity.zCoord, d)); } public static void sendToAllAround(Packet packet, Entity entity, double d) { sendToAllAround(packet, new NetworkRegistry.TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, d)); } public static ItemStack readStack(ByteBuf data) { int stackSize = data.readUnsignedByte(); if (stackSize > 0) { int itemId = data.readUnsignedShort(); boolean hasNBT = (itemId >= 32768); itemId &= 32767; int itemDamage = data.readInt(); ItemStack stack = new ItemStack(Item.getItemById(itemId), stackSize, itemDamage); return stack; } else { return null; } } public static void writeStack(ByteBuf data, ItemStack stack) { if (stack != null && stack.stackSize > 0) { data.writeByte(stack.stackSize); data.writeShort(Item.getIdFromItem(stack.getItem()) | (stack.hasTagCompound() ? 32768 : 0)); data.writeInt(stack.getItemDamage()); } else { data.writeByte(0); } } }
38.348315
150
0.786991
e732a3fd725b7e36c9149ea2c2bf00a108540590
1,740
package com.finance.financeapp.config; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletRegistration.Dynamic; import org.springframework.web.WebApplicationInitializer; import org.springframework.web.context.ContextLoaderListener; import org.springframework.web.context.request.RequestContextListener; import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; import org.springframework.web.servlet.DispatcherServlet; import com.sun.jersey.spi.spring.container.servlet.SpringServlet; public class ApplicationInitializer implements WebApplicationInitializer { @Override public void onStartup(final ServletContext servletContext) throws ServletException { final AnnotationConfigWebApplicationContext root = new AnnotationConfigWebApplicationContext(); root.setServletContext(servletContext); root.scan("com.finance.financeapp.config"); root.refresh(); servletContext.addListener(new ContextLoaderListener(root)); servletContext.addListener(new RequestContextListener()); final Dynamic servlet = servletContext.addServlet("spring", new DispatcherServlet(root)); servlet.setLoadOnStartup(1); servlet.addMapping("/"); final Dynamic jerseyServlet = servletContext.addServlet("jerseyServlet", new SpringServlet()); jerseyServlet.setLoadOnStartup(2); jerseyServlet.setInitParameter("com.sun.jersey.config.property.packages", "com.finance.financeapp"); jerseyServlet.setInitParameter("com.sun.jersey.api.json.POJOMappingFeature", "true"); jerseyServlet.addMapping("/rest/*"); servletContext.addFilter("passthroughFilter", new PassthroughFilter()); servletContext.addFilter("wsFilter", new WSFilter()); } }
37.826087
102
0.816667
b5f835ac2c7b0e1639946cef6bfe9f9e578291c6
109
for(int i = 2; i <= 8;i += 2){ System.out.print(i + ", "); } System.out.println("who do we appreciate?");
21.8
44
0.550459
bc01042a8119694ede4c08df286d3057ffcf901c
1,523
package jenkins.model.item_category; import hudson.model.TopLevelItem; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.export.Exported; import org.kohsuke.stapler.export.ExportedBean; import java.io.Serializable; import java.util.List; import java.util.Map; /** * Represents an {@link ItemCategory} and its {@link TopLevelItem}s. * * This class is not thread-safe. */ @ExportedBean @Restricted(NoExternalUse.class) public class Category implements Serializable { private String id; private String name; private String description; private int order; private int minToShow; private List<Map<String, Serializable>> items; public Category(String id, String name, String description, int order, int minToShow, List<Map<String, Serializable>> items) { this.id= id; this.name = name; this.description = description; this.order = order; this.minToShow = minToShow; this.items = items; } @Exported public String getId() { return id; } @Exported public String getName() { return name; } @Exported public String getDescription() { return description; } @Exported public int getOrder() { return order; } @Exported public int getMinToShow() { return minToShow; } @Exported public List<Map<String, Serializable>> getItems() { return items; } }
20.581081
130
0.665791
91831e97ee40a6369b4b5fd7cbc432d63fec98df
16,481
/*L * Copyright Georgetown University, Washington University. * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/cab2b/LICENSE.txt for details. */ package cab2b.server.caarray.resulttransformer; import java.util.Set; import cab2b.common.caarray.BioAssayDataRecord; import cab2b.common.caarray.IPartiallyInitializedBioAssayDataRecord; import edu.common.dynamicextensions.domaininterface.AttributeInterface; import edu.common.dynamicextensions.domaininterface.EntityInterface; import edu.wustl.cab2b.common.queryengine.result.RecordId; import gov.nih.nci.caarray.domain.data.QuantitationType; /** * Transformer that creates {@link IPartiallyInitializedBioAssayDataRecord} for * queries on {@link BioAssayData} and its subtypes. This transformer is needed * to "understand" the {@link BioDataCube} returned by the caArray service along * with a {@link BioAssayData}. * <p> * Currently, the biodatacube is always transformed to BQD. The names of the * three dimensions are fetched by firing additional CQLs. * * @author srinath_k * */ public class BioAssayDataResultTransformer extends AbstractCaArrayResultTransfomer<IPartiallyInitializedBioAssayDataRecord> { private static final String HEADER_ATTRIBUTE_NAME = "name"; /** * Creates a {@link BioAssayDataRecord} of type "fully initialized". * * @see cab2b.server.caarray.resulttransformer.AbstractCaArrayResultTransfomer#createCaArrayRecord(java.util.Set, * edu.wustl.cab2b.common.queryengine.result.RecordId) * @see BioAssayDataRecord#createFullyInitializedRecord(Set, RecordId) */ @Override protected IPartiallyInitializedBioAssayDataRecord createCaArrayRecord(Set<AttributeInterface> attributes, RecordId id) { return BioAssayDataRecord.createFullyInitializedRecord(attributes, id); } /** * Creates the {@link IPartiallyInitializedBioAssayDataRecord} for given * object.<br> * Following is the sequence of steps: * <ol> * <li>Call <code>super.createRecordForObject()</code>. This creates a * new record that contains the values of the attributes and associated ids.</li> * <li>Obtain the names of the dimensions i.e. names of {@link BioAssay}, * {@link QuantitationType} and {@link DesignElement} by firing appropriate * CQLs. These names are the names of the three dimensions of the * {@link BioDataCube}. Populate these names as the dim1Labels, dim2Labels * and dim3Labels respectively.</li> * <li>Transform the three dimensional array of {@link BioDataCube} to the * order BQD using {@link MatrixDimensionSwapper}.</li> * <li>Return the lazy form of this record obtained by * {@link BioAssayDataRecord#createLazyForm(BioAssayDataRecord)}.</li> * </ol> * * @throws IllegalArgumentException if the given object is not an * <code>instanceOf</code> {@link BioAssayData}. * @see cab2b.server.caarray.resulttransformer.AbstractCaArrayResultTransfomer#createRecordForObject(java.lang.String, * java.lang.Object, * edu.common.dynamicextensions.domaininterface.EntityInterface) */ @Override protected IPartiallyInitializedBioAssayDataRecord createRecordForObject(String url, Object objRec, EntityInterface outputEntity) { /* OLD CODE if (!(objRec instanceof BioAssayData)) { throw new IllegalArgumentException(); } BioAssayDataRecord rec = (BioAssayDataRecord) super.createRecordForObject(url, objRec, outputEntity); BioAssayData derivedBioAssayData = (BioAssayData) objRec; String[] bioAssayNames = getBioAssaysNames(derivedBioAssayData.getBioAssayDimension().getIdentifier(), url); String[] quantitationTypeNames = getQuantitationTypesNames( derivedBioAssayData.getQuantitationTypeDimension().getIdentifier(), url); String[] designElementNames = getDesignElementsNames( derivedBioAssayData.getDesignElementDimension().getIdentifier(), url); rec.setDim1Labels(bioAssayNames); rec.setDim2Labels(quantitationTypeNames); rec.setDim3Labels(designElementNames); BioDataCube bioDataCube = (BioDataCube) derivedBioAssayData.getBioDataValues(); rec.setCube(transformCubeToBQD(bioDataCube)); return BioAssayDataRecord.createLazyForm(rec); // return (IPartiallyInitializedBioAssayDataRecord) // LazyInitializer.getView( // BioAssayDataRecord.createLazyForm( // rec).handle(), // new LazyParams( // Collections.singletonList(new Range( // 0, // bioAssayNames.length, // 0, // quantitationTypeNames.length, // 0, // designElementNames.length)))); */ return null; } /* OLD CODE private Object[][][] transformCubeToBQD(BioDataCube bioDataCube) { String order = bioDataCube.getOrder(); int[] dimensionMap = new int[3]; char[] bqdOrder = { 'B', 'Q', 'D' }; for (int i = 0; i < 3; i++) { dimensionMap[i] = order.indexOf(bqdOrder[i]); } return (Object[][][]) MatrixDimensionSwapper.swapDimensions(bioDataCube.getCube(), dimensionMap); } // begin bioassay private String[] getBioAssaysNames(String bioAssayDimensionId, String url) { BioAssayDimension bioAssayDimension = getBioAssayDimensionById(bioAssayDimensionId, url); return queryForNames(url, getIds(bioAssayDimension.getBioAssays()), BioAssay.class.getName()); } private BioAssayDimension getBioAssayDimensionById(String identifier, String url) { return transformerUtil.getObjectById(BioAssayDimension.class, identifier, url); } // end bioassay // begin quantitationType private String[] getQuantitationTypesNames(String quantitationTypeDimensionId, String url) { QuantitationTypeDimension quantitationTypeDimension = getQuantitationTypeDimensionById( quantitationTypeDimensionId, url); return getNames(quantitationTypeDimension.getQuantitationTypes()); } private QuantitationTypeDimension getQuantitationTypeDimensionById(String identifier, String url) { return transformerUtil.getObjectById(QuantitationTypeDimension.class, identifier, url); } // end quantitationType // begin designElements private String[] getDesignElementsNames(String designElementDimensionId, String url) { CompositeSequenceDimension compositeSequenceDimension = getCompositeSequenceDimensionById( designElementDimensionId, url); return getNames(compositeSequenceDimension.getCompositeSequences()); } private CompositeSequenceDimension getCompositeSequenceDimensionById(String identifier, String url) { return transformerUtil.getObjectById(CompositeSequenceDimension.class, identifier, url); } // end designElements private String[] queryForNames(String url, String[] ids, String className) { Map<String, String> idToHeader = new HashMap<String, String>(ids.length); List<Map<String, String>> results = transformerUtil.getAttributeResult( className, new String[] { IDENTIFIER_ATTRIBUTE_NAME, HEADER_ATTRIBUTE_NAME }, IDENTIFIER_ATTRIBUTE_NAME, ids, url); for (Map<String, String> row : results) { idToHeader.put(row.get(IDENTIFIER_ATTRIBUTE_NAME), row.get(HEADER_ATTRIBUTE_NAME)); } String[] headers = new String[ids.length]; for (int i = 0; i < ids.length; i++) { headers[i] = idToHeader.get(ids[i]); } return headers; } private String[] getIds(Identifiable[] identifiables) { String[] ids = new String[identifiables.length]; for (int i = 0; i < ids.length; i++) { ids[i] = identifiables[i].getIdentifier(); } return ids; } private String[] getNames(Identifiable[] identifiables) { String[] names = new String[identifiables.length]; for (int i = 0; i < names.length; i++) { names[i] = identifiables[i].getName(); } return names; } // ////////////////// HACKS FOLLOW, BEWARE!! //////////////////////// // @Override // public IQueryResult<IPartiallyInitializedBioAssayDataRecord> // getResults(DCQLQuery query, // EntityInterface targetEntity) { // // return getQueryResult(targetEntity); // } private IQueryResult<IPartiallyInitializedBioAssayDataRecord> getQueryResult(EntityInterface targetEntity) { System.out.println("hack"); IQueryResult<IPartiallyInitializedBioAssayDataRecord> queryResults = QueryResultFactory.createResult(targetEntity); try { BioAssayDataRecord rec = (BioAssayDataRecord) LazyInitializer.getFullyInitialializedRecord(0); System.out.println("Found cube in cache; returning it..."); queryResults.addRecord("http://caarraydb-stage.nci.nih.gov/wsrf/services/caGrid/CaArraySvc", BioAssayDataRecord.createLazyForm(rec)); return queryResults; } catch (IllegalArgumentException e) { System.out.println("Reading cube from file first time..."); } BioAssayDataRecord record = BioAssayDataRecord.createFullyInitializedRecord(new HashSet( targetEntity.getAttributeCollection()), new RecordId( "gov.nih.nci.ncicb.caarray:DerivedBioAssayData:1015897589771984:1", "asdf")); try { int cnt = 0; int rowNo = 0; String dim1Labels[] = null; String dim2Labels[] = null; String dim3Labels[] = null; System.out.println("Creating a 3D array from file"); BufferedReader fileReader = new BufferedReader(new FileReader(new File("d:\\input.txt"))); String str = fileReader.readLine(); StringTokenizer tokenizer = new StringTokenizer(str, "\t"); cnt = tokenizer.countTokens(); rowNo = 54676; dim1Labels = new String[] { "" }; dim2Labels = new String[cnt]; dim3Labels = new String[rowNo]; // get column names tokenizer.nextToken(); for (int i = 0; i < cnt - 1; i++) { dim2Labels[i] = tokenizer.nextToken(); } tokenizer = null; Object bioDataCube[][][] = new Object[1][cnt][rowNo]; for (int i = 0; i < cnt; i++) { bioDataCube[0][i] = new Object[rowNo]; } str = fileReader.readLine(); int k = 0; while (str != null) { String[] tokens = str.split("\t"); dim3Labels[k] = tokens[0]; for (int i = 0; i < cnt - 1; i++) { try { bioDataCube[0][i][k] = Float.valueOf(tokens[i + 1]).floatValue(); } catch (NumberFormatException e) { bioDataCube[0][i][k] = tokens[i + 1]; } } k++; str = null; tokens = null; str = fileReader.readLine(); if (k % 300 == 0) System.out.println("parsed line " + k); } fileReader.close(); fileReader = null; record.setDim1Labels(dim1Labels); record.setDim2Labels(dim2Labels); record.setDim3Labels(dim3Labels); record.setCube(bioDataCube); for (AttributeInterface attribute : targetEntity.getAttributeCollection()) { record.putValueForAttribute(attribute, "1"); } } catch (Exception e) { e.printStackTrace(); } // queryResults.addRecord( // "http://caarraydb-stage.nci.nih.gov/wsrf/services/caGrid/CaArraySvc", // (IPartiallyInitializedBioAssayDataRecord) LazyInitializer.getView( // BioAssayDataRecord.createLazyForm( // record).handle(), // new LazyParams( // Collections.singletonList(new Range( // 0, // record.getDim1Labels().length, // 0, // record.getDim2Labels().length, // 0, // record.getDim3Labels().length))))); queryResults.addRecord("http://caarraydb-stage.nci.nih.gov/wsrf/services/caGrid/CaArraySvc", BioAssayDataRecord.createLazyForm(record)); return queryResults; } // private IQueryResult<IPartiallyInitializedBioAssayDataRecord> // getQueryResult(EntityInterface targetEntity) { // IQueryResult<IPartiallyInitializedBioAssayDataRecord> queryResults = // QueryResultFactory.createResult(targetEntity); // // BioAssayDataRecord record = // BioAssayDataRecord.createFullyInitializedRecord(new HashSet( // // targetEntity.getAttributeCollection()), new RecordId( // // "gov.nih.nci.ncicb.caarray:DerivedBioAssayData:1015897589771984:1", // "asdf")); // // String dim1Labels[] = { "1" }; // // String dim2Labels[] = { "Pairs", "Pairs Used", "Signal", "Detection", // "Detection P-value" }; // // String dim3Labels[] = { "92555_at", "92558_at", "92559_at", "92568_at", // "92574_at", "92555_at", "92558_at", "92559_at", "92568_at", "92574_at", // "92555_at", "92558_at", "92559_at", "92568_at", "92574_at", "92555_at", // "92558_at", "92559_at", "92568_at", "92574_at", "92555_at", "92558_at", // "92559_at", "92568_at", "92574_at", "92555_at", "92558_at", "92559_at", // "92568_at", "92574_at" }; // // Object bioDataCube[][][] = new Object[][][] { { { "20.0", "16.0", "20.0", // "16.0", "20.0", "20.0", "16.0", "20.0", "16.0", "20.0", "20.0", "16.0", // "20.0", "16.0", "20.0", "20.0", "16.0", "20.0", "16.0", "20.0", "20.0", // "16.0", "20.0", "16.0", "20.0", "20.0", "16.0", "20.0", "16.0", "20.0" }, // { "Absent", "Present", "Present", "Marginal", "Absent", "Absent", // "Present", "Present", "Marginal", "Absent", "Absent", "Present", // "Present", "Marginal", "Absent", "Absent", "Present", "Present", // "Marginal", "Absent", "Absent", "Present", "Present", "Marginal", // "Absent", "Absent", "Present", "Present", "Marginal", "Absent" }, { // "0.13876513", "0.3276513", "0.5645876513", "0.464376513", "0.235876513", // "0.13876513", "0.3276513", "0.5645876513", "0.464376513", "0.235876513", // "0.13876513", "0.3276513", "0.5645876513", "0.464376513", "0.235876513", // "0.13876513", "0.3276513", "0.5645876513", "0.464376513", "0.235876513", // "0.13876513", "0.3276513", "0.5645876513", "0.464376513", "0.235876513", // "0.13876513", "0.3276513", "0.5645876513", "0.464376513", "0.235876513" // }, { "2.188886E-4", "3.188886E-4", "4.188886E-4", "5.188886E-4", // "6.188886E-4", "2.188886E-4", "3.188886E-4", "4.188886E-4", // "5.188886E-4", "6.188886E-4", "2.188886E-4", "3.188886E-4", // "4.188886E-4", "5.188886E-4", "6.188886E-4", "2.188886E-4", // "3.188886E-4", "4.188886E-4", "5.188886E-4", "6.188886E-4", // "2.188886E-4", "3.188886E-4", "4.188886E-4", "5.188886E-4", // "6.188886E-4", "2.188886E-4", "3.188886E-4", "4.188886E-4", // "5.188886E-4", "6.188886E-4" }, { "0.0030666848", "0.0030666848", // "0.0030666848", "0.0030666848", "0.0030666848", "0.0030666848", // "0.0030666848", "0.0030666848", "0.0030666848", "0.0030666848", // "0.0030666848", "0.0030666848", "0.0030666848", "0.0030666848", // "0.0030666848", "0.0030666848", "0.0030666848", "0.0030666848", // "0.0030666848", "0.0030666848", "0.0030666848", "0.0030666848", // "0.0030666848", "0.0030666848", "0.0030666848", "0.0030666848", // "0.0030666848", "0.0030666848", "0.0030666848", "0.0030666848" } } }; // // for (AttributeInterface attribute : // targetEntity.getAttributeCollection()) { // // record.putValueForAttribute(attribute, "1"); // // } // // record.setDim1Labels(dim1Labels); // // record.setDim2Labels(dim2Labels); // // record.setDim3Labels(dim3Labels); // // record.setCube(bioDataCube); // // queryResults.addRecord("someUrl", // BioAssayDataRecord.createLazyForm(record)); // // return queryResults; // // } */ }
37.800459
123
0.632304
f1480b1e994388d6a29d4c942f780e234cf2c2f2
375
package net.mine_diver.fabrifine.render; import net.minecraft.class_84; public interface OFClippingHelper { static OFClippingHelper of(class_84 clippingHelper) { return (OFClippingHelper) clippingHelper; } boolean isBoxInFrustumFully(final double minX, final double minY, final double minZ, final double maxX, final double maxY, final double maxZ); }
28.846154
146
0.773333
b77c4c40ded976f38771570bf531ee9e61a2f549
118
class NoConstructor { NoConstructor() { System.out.println("a"); System.out.println("b"); } }
16.857143
32
0.550847
cbcdbacf8b156c8b638d448b7f4bb0a99f84cea5
8,153
/* * Copyright (c) 2007 Tom Parker <thpr@users.sourceforge.net> * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ package pcgen.cdom.reference; import java.util.Collection; import pcgen.cdom.base.Loadable; import pcgen.cdom.enumeration.GroupingState; /** * A CDOMTransparentAllRef is a CDOMReference which is intended to contain a * CDOMGroupRef, to which the CDOMTransparentAllRef will delegate behavior. * * A CDOMTransparentAllRef, unlike many CDOMReference objects, can be cleared, * and the underlying CDOMGroupRef can be changed. * * @see TransparentReference for a description of cases in which * TransparentReferences like CDOMTransparentAllRef are typically used * * @param <T> * The Class of the underlying object contained by this * CDOMTransparentAllRef */ public class CDOMTransparentAllRef<T extends Loadable> extends CDOMGroupRef<T> implements TransparentReference<T> { /** * Holds the reference to which this CDOMTransparentAllRef will delegate * behavior. */ private CDOMGroupRef<T> subReference = null; /** * Constructs a new CDOMTransparentAllRef for the given Class. * * @param objClass * The Class of the underlying objects contained by this * CDOMTransparentTypeRef. */ public CDOMTransparentAllRef(Class<T> objClass) { super(objClass, "ALL"); } /** * Returns true if the given Object is the Object to which this * CDOMTransparentAllRef refers. * * Note that the behavior of this class is undefined if the underlying * CDOMGroupRef has not yet been resolved. * * @param item * The object to be tested to see if it is referred to by this * CDOMTransparentAllRef. * @return true if the given Object is the Object to which this * CDOMTransparentAllRef refers; false otherwise. * @throws IllegalStateException * if no underlying CDOMGroupRef has been defined. */ @Override public boolean contains(T item) { if (subReference == null) { throw new IllegalStateException("Cannot ask for contains: " + getReferenceClass().getName() + " Reference " + getName() + " has not been resolved"); } return subReference.contains(item); } /** * Returns a representation of this CDOMTransparentAllRef, suitable for * storing in an LST file. * * Note that this will return the identifier of the underlying reference (of * the types given at construction), often the "key" in LST terminology. * * @return A representation of this CDOMTransparentAllRef, suitable for * storing in an LST file. * @see pcgen.cdom.base.CDOMReference#getLSTformat(boolean) */ @Override public String getLSTformat(boolean useAny) { return subReference.getLSTformat(useAny); } /** * Returns true if this CDOMTransparentAllRef is equal to the given Object. * Equality is defined as being another CDOMTransparentAllRef object with * equal Class represented by the reference. This is NOT a deep .equals, in * that neither the actual contents of this CDOMTransparentAllRef nor the * underlying CDOMGroupRef are tested. * * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (obj instanceof CDOMTransparentAllRef) { CDOMTransparentAllRef<?> ref = (CDOMTransparentAllRef<?>) obj; return getReferenceClass().equals(ref.getReferenceClass()) && getName().equals(ref.getName()); } return false; } /** * Returns the consistent-with-equals hashCode for this * CDOMTransparentAllRef * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return getReferenceClass().hashCode() ^ getName().hashCode(); } /** * Throws an exception. This method may not be called because a * CDOMTransparentAllRef is resolved using an underlying CDOMGroupRef. * * @see CDOMTransparentAllRef#resolve(ReferenceManufacturer) * * @param item * ignored * @throws IllegalStateException * because a CDOMTransparentTypeRef is resolved using an * underlying CDOMGroupRef. */ @Override public void addResolution(T item) { throw new IllegalStateException( "Cannot resolve a Transparent Reference"); } /** * Resolves this CDOMTransparentAllRef using the given * ReferenceManufacturer. The underlying CDOMGroupRef for this * CDOMTransparentAllRef will be set to the "ALL" CDOMGroupRef constructed * by the given ReferenceManufacturer * * This method may be called more than once; each time it is called it will * overwrite the existing CDOMGroupRef to which this CDOMTransparentAllRef * delegates its behavior. * * @throws IllegalArgumentException * if the Reference Class of the given ReferenceManufacturer is * different than the Reference Class of this * CDOMTransparentAllRef * @throws NullPointerException * if the given ReferenceManufacturer is null */ @Override public void resolve(ReferenceManufacturer<T> rm) { if (rm.getReferenceClass().equals(getReferenceClass())) { subReference = rm.getAllReference(); } else { throw new IllegalArgumentException("Cannot resolve a " + getReferenceClass().getSimpleName() + " Reference to a " + rm.getReferenceClass().getSimpleName()); } } /** * Returns a Collection containing the single Object to which this * CDOMTransparentAllRef refers. * * The semantics of this method are defined solely by the semantics of the * underlying CDOMGroupRef. Ownership of the Collection returned by this * method may or may not be transferred to the calling object (check the * documentation of the underlying CDOMGroupRef). * * Note that if you know this CDOMTransparentAllRef is a CDOMGroupRef, you * are better off using resolvesTo() as the result will be much faster than * having to extract the object out of the Collection returned by this * method. * * @return A Collection containing the single Object to which this * CDOMTransparentAllRef refers. */ @Override public Collection<T> getContainedObjects() { return subReference.getContainedObjects(); } /** * Returns the count of the number of objects included in the Collection of * Objects to which this CDOMTransparentAllRef refers. * * Note that the behavior of this class is undefined if the * CDOMTransparentAllRef has not yet been resolved. * * @return The count of the number of objects included in the Collection of * Objects to which this CDOMTransparentAllRef refers. */ @Override public int getObjectCount() { return subReference == null ? 0 : subReference.getObjectCount(); } /** * Returns the GroupingState for this CDOMTransparentAllRef. The * GroupingState indicates how this CDOMTransparentAllRef can be combined * with other PrimitiveChoiceFilters. * * @return The GroupingState for this CDOMTransparentAllRef. */ @Override public GroupingState getGroupingState() { return GroupingState.ALLOWS_NONE; } @Override public String getChoice() { return subReference == null ? null : subReference.getChoice(); } }
33.008097
90
0.699374
18c581f123d5bf2013997e1516a831fcc30f05bd
2,230
package io.breezil.orquestra.musico.commands; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import ca.uqac.lif.bullwinkle.ParseNode; public class CommandBuilder { private Command building; public CommandBuilder build(String commandName) { building = buildConcreteClass(commandName); return this; } public Command fillParameters(ParseNode node) { recursiveFillProperties(this.building, node); return this.building; } private String recursiveFillProperties(Command building, ParseNode node) { if (node == null) return null; if (node.getValue() == null) { return node.getToken(); } if (node.getToken().equals("<exp>")) { node = node.getChildren().get(0); Command cmd = new CommandBuilder().build(node.getToken().substring(1, node.getToken().length() -1)).fillParameters(node); ((FilterCommand) building).setActualCommand(cmd); return null; } for (ParseNode child : node.getChildren()) { String value = recursiveFillProperties(building, child); String propertyName = node.getToken().substring(1, node.getToken().length() - 1); definePropertieValue(building, propertyName, value); } return null; } private void definePropertieValue(Command cmd, String name, String value) { try { // cmd.getClass().getField(name).set(cmd, value); Method m = cmd.getClass().getMethod("set" + name.toUpperCase().charAt(0) + name.substring(1), String.class); m.invoke(cmd, value); } catch (IllegalArgumentException | NoSuchMethodException | SecurityException | IllegalAccessException | InvocationTargetException e) { // e.printStackTrace(); } } private Command buildConcreteClass(String commandName) { Command cmd = null; try { Class<?> clazz = Class.forName(CommandBuilder.class.getPackage().getName() + "." + commandName); Constructor<?> ctor = clazz.getConstructor(); cmd = (Command) ctor.newInstance(new Object[] { }); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException | ClassNotFoundException e) { e.printStackTrace(); } return cmd; } }
31.857143
124
0.726457
83b3dc9796615d144080f59d75310bbba4045a7a
2,041
/* * Copyright 2011 - 2013 NTB University of Applied Sciences in Technology * Buchs, Switzerland, http://www.ntb.ch/inf * * 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 org.deepjava.ssa.instruction; import org.deepjava.ssa.SSAValue; public class Branch extends SSAInstruction { public Branch(int opCode, SSAValue operand1, SSAValue operand2, int bca) { this.bca = bca; ssaOpcode = opCode; operands = new SSAValue[]{operand1,operand2}; } public Branch(int opCode, SSAValue operand1, int bca) { this.bca = bca; ssaOpcode = opCode; operands = new SSAValue[]{operand1}; } public Branch(int opCode, int bca) { this.bca = bca; ssaOpcode = opCode; } @Override public SSAValue[] getOperands() { return operands; } @Override public void setOperands(SSAValue[] operands) { if (operands.length > 0) { this.operands = operands; } else { throw new IndexOutOfBoundsException(); } } @Override public String toString(){ StringBuilder sb = new StringBuilder(); sb.append(result.n + ": "); if (operands == null) sb.append("Branch["+ scMnemonics[ssaOpcode]+"] "); else { if (operands.length == 2) sb.append("Branch["+ scMnemonics[ssaOpcode]+"] {"+ operands[0].n + ", " + operands[1].n + "}"); else sb.append("Branch["+ scMnemonics[ssaOpcode]+"] {"+ operands[0].n + "}"); } sb.append(" (" + result.typeName() + ")"); sb.append(", bca=" + bca); return sb.toString(); } }
27.581081
100
0.653111
ff9f03e8aa086c3f6fd4edb09ad980ab68de5030
1,347
package net.pechorina.model; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import java.util.Date; import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) public class PRecord { private Boolean hasPrevious; @JsonFormat(pattern = "yyyy-MM-dd'T'hh:mm:ss") private Date previous; @JsonFormat(pattern = "yyyy-MM-dd'T'hh:mm:ss") private Date next; private List<DateInfo> dates; public Boolean getHasPrevious() { return hasPrevious; } public void setHasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; } public Date getPrevious() { return previous; } public void setPrevious(Date previous) { this.previous = previous; } public Date getNext() { return next; } public void setNext(Date next) { this.next = next; } public List<DateInfo> getDates() { return dates; } public void setDates(List<DateInfo> dates) { this.dates = dates; } @Override public String toString() { return "Record{" + "hasPrevious=" + hasPrevious + ", previous=" + previous + ", next=" + next + ", dates=" + dates + '}'; } }
21.380952
61
0.599852
35ecdb2faecf5cc0fb8ddc47f339083d133363c8
3,749
/* * Copyright 2018 Information and Computational Sciences, * The James Hutton Institute. * * 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 jhi.germinate.util.importer.compound; import java.util.*; import jhi.germinate.server.database.*; import jhi.germinate.shared.*; import jhi.germinate.shared.datastructure.database.*; import jhi.germinate.shared.exception.*; import jhi.germinate.util.importer.reader.*; /** * {@link CompoundImporter} uses an {@link IDataReader} to read and parse {@link Compound}s and then writes it to a Germinate database. * * @author Sebastian Raubach */ public class CompoundImporter extends DataImporter<Compound> { private Set<Long> createdCompoundIds = new HashSet<>(); private Set<Long> createdUnitIds = new HashSet<>(); public static void main(String[] args) { try { new CompoundImporter() .run(args); } catch (Exception e) { e.printStackTrace(); } } @Override protected IDataReader getReader() { return new ExcelCompoundReader(); } @Override protected void deleteInsertedItems() { deleteItems(createdCompoundIds, "compounds"); deleteItems(createdUnitIds, "units"); } @Override protected void write(Compound entry) throws DatabaseException { if (!StringUtils.isEmpty(entry.getName())) { // Write the phenotype itself createCompound(entry); } } /** * Imports the {@link Compound} into the database if it doesn't already exist * * @param entry The {@link Compound} to import * @throws DatabaseException Thrown if the interaction with the database fails. */ private void createCompound(Compound entry) throws DatabaseException { String name = entry.getName(); if (StringUtils.isEmpty(name)) return; createOrGetUnit(entry); DatabaseStatement stmt = databaseConnection.prepareStatement("SELECT id FROM compounds WHERE name = ?"); stmt.setString(1, name); DatabaseResult rs = stmt.query(); if (!rs.next()) { Compound.Writer.Inst.get().write(databaseConnection, entry, false); createdCompoundIds.add(entry.getId()); } } /** * Imports the {@link Unit} object into the database if it doesn't already exist, otherwise returns the existing object from the database. * * @param entry The {@link Compound} object containing the {@link Unit} to import. * @throws DatabaseException Thrown if the interaction with the database fails. */ private void createOrGetUnit(Compound entry) throws DatabaseException { Unit unit = entry.getUnit(); if (unit == null || StringUtils.isEmpty(unit.getName())) return; if(StringUtils.isEmpty(unit.getAbbreviation())) unit.setAbbreviation(unit.getName().substring(0, Math.min(unit.getName().length(), 10))); DatabaseStatement stmt = databaseConnection.prepareStatement("SELECT id FROM units WHERE unit_name = ? AND unit_abbreviation = ?"); stmt.setString(1, entry.getUnit().getName()); stmt.setString(2, entry.getUnit().getAbbreviation()); DatabaseResult rs = stmt.query(); if (rs.next()) { entry.setUnit(Unit.Parser.Inst.get().parse(rs, null, true)); } else { Unit.Writer.Inst.get().write(databaseConnection, entry.getUnit(), false); createdUnitIds.add(entry.getUnit().getId()); } } }
28.18797
139
0.719392
85264057586835b8a235abe681814108ec933396
3,600
/* * * Copyright (C) 2020 iQIYI (www.iqiyi.com) * * 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.qiyi.lens.ui.devicepanel.blockInfos; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.Switch; import android.widget.TextView; import com.qiyi.lens.ui.FloatingPanel; import com.qiyi.lens.ui.traceview.LaunchTimeDetailPanel; import com.qiyi.lens.utils.DataPool; import com.qiyi.lens.utils.TimeStampUtil; import com.qiyi.lens.utils.event.DataCallBack; import com.qiyi.lens.utils.event.EventBus; import com.qiyi.lenssdk.R; import java.util.UUID; public class LaunchTimeInfo extends AbsBlockInfo implements DataCallBack { private TextView mLaunchTimeTv; private Button mMoreBtn; private TimeStampUtil stampUtil; public LaunchTimeInfo(FloatingPanel panel) { super(panel); } @Override public void bind(View view) { stampUtil = (TimeStampUtil) DataPool.obtain().getDataAsset(DataPool.DATA_TYPE_LAUNCH_TIME, TimeStampUtil.class); //[fix bug : 热启动时候,stamp util 存在值 但是数据却需要刷新的情况] EventBus.registerEvent(this, DataPool.DATA_TYPE_LAUNCH_TIME); setData(); } @Override public void unBind() { mLaunchTimeTv = null; EventBus.unRegisterEvent(this, DataPool.DATA_TYPE_LAUNCH_TIME); } @Override public void onDataArrived(Object data, int type) { if (data instanceof TimeStampUtil) { stampUtil = (TimeStampUtil) data; setData(); } } private void setData() { if (mLaunchTimeTv != null && stampUtil != null) { String launchTime = String.format(mLaunchTimeTv.getContext().getString(R.string.lens_block_launch_info), String.valueOf(stampUtil.getTotalTime())); mLaunchTimeTv.setText(launchTime); } } @Override public void onBlockClicked() { FloatingPanel basePanel = getPanel(); if (basePanel != null) { LaunchTimeDetailPanel panel = new LaunchTimeDetailPanel(basePanel); panel.show(); } } @Override public View createView(ViewGroup parent) { View root = inflateView(parent, R.layout.lens_block_launch_info); mLaunchTimeTv = root.findViewById(R.id.tv_block_launch_info); bindBlockClickEvent(mLaunchTimeTv); final Switch switchBtn = root.findViewById(R.id.lens_start_analysis); switchBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (!switchBtn.isSelected()) { switchBtn.setText("分析中"); TimeStampUtil.setDefaultStampKey(UUID.randomUUID().toString()); TimeStampUtil.obtain(); } else { switchBtn.setText("开始分析"); TimeStampUtil.obtain().stopAndPost(); } switchBtn.setSelected(!switchBtn.isSelected()); } }); return root; } }
32.727273
116
0.658611
32f18ccdfa293d198d45275f339947aed432acf6
1,982
/* * This file is part of ModpackInfo, licensed under the MIT License (MIT). * * Copyright (c) OreCruncher * * 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 org.blockartistry.mod.ModpackInfo.proxy; import net.minecraftforge.common.config.Configuration; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.event.FMLServerStoppingEvent; public class Proxy { public void preInit(final FMLPreInitializationEvent event, final Configuration config) { } public void init(final FMLInitializationEvent event) { } public void postInit(final FMLPostInitializationEvent event) { } public void serverStarting(final FMLServerStartingEvent event) { } public void serverStopping(final FMLServerStoppingEvent event) { } }
36.703704
89
0.781534
365947ae6ed8bd7932c1140296541206817bc8e1
505
package com.dianrong.common.uniauth.client; import com.dianrong.common.uniauth.client.custom.UserExtInfo; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Component; @Component public class UniClientCommonService { /** * 获取当前的登陆用户信息. */ public UserExtInfo getLoginUserInfo() { UserExtInfo userExtInfo = (UserExtInfo) SecurityContextHolder.getContext().getAuthentication() .getPrincipal(); return userExtInfo; } }
26.578947
98
0.778218
8303d43e24956853faf6339198211a23528c3add
692
package ru.job4j.studentgroup; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; /** * Группировка учеников */ public class StudentGroup { /** * Возвращает спискок студендов с баллом больше bound * * @param students список студентов * @param bound проходной бал * @return список студентов */ List<Student> levelOf(List<Student> students, int bound) { return students .stream() .sorted(new Student()) .flatMap(Stream::ofNullable) .takeWhile(student -> student.getScope() > bound) .collect(Collectors.toList()); } }
25.62963
65
0.606936
ac1a9c55fca687b3ff0cad8bdad68303a189a022
3,395
package com.tnovoselec.lifesumfoodsearch.presenter; import android.util.Pair; import com.tnovoselec.lifesumfoodsearch.Router; import com.tnovoselec.lifesumfoodsearch.api.FlickrClient; import com.tnovoselec.lifesumfoodsearch.api.LifesumClient; import com.tnovoselec.lifesumfoodsearch.api.model.ApiFoodItem; import com.tnovoselec.lifesumfoodsearch.business.ApiToDbConverter; import com.tnovoselec.lifesumfoodsearch.business.DbToViewModelConverter; import com.tnovoselec.lifesumfoodsearch.db.dao.FoodDao; import com.tnovoselec.lifesumfoodsearch.db.model.DbFoodItem; import com.tnovoselec.lifesumfoodsearch.model.FoodItemViewModel; import com.tnovoselec.lifesumfoodsearch.view.FoodSearchView; import java.util.Collections; import java.util.List; import javax.inject.Inject; import rx.Observable; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; public class FoodSearchPresenterImpl extends BasePresenter implements FoodSearchPresenter { private LifesumClient lifesumClient; private FlickrClient flickrClient; private FoodDao foodDao; private Router router; private FoodSearchView foodSearchView; private Subscription currentSearch; @Inject public FoodSearchPresenterImpl(LifesumClient lifesumClient, FlickrClient flickrClient, FoodDao foodDao, Router router) { this.lifesumClient = lifesumClient; this.flickrClient = flickrClient; this.foodDao = foodDao; this.router = router; } @Override public void searchForFood(String query) { foodSearchView.showProgress(); if (currentSearch != null && !currentSearch.isUnsubscribed()){ currentSearch.unsubscribe(); } currentSearch = Observable.defer(() -> lifesumClient.getFoods(query, "en", "us")) .flatMap(apiFoodResponse -> Observable.from(apiFoodResponse.apiFoodItems)) .flatMap(apiFoodItem -> flickrClient.pullImage(apiFoodItem.title) .map(imageUrl -> Pair.create(apiFoodItem, imageUrl))) .toList() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe( this::onApiFoodItemsSearched, this::onDbFoodItemsSearchFailed); addSubscription(currentSearch); } @Override public void takeView(FoodSearchView foodSearchView) { this.foodSearchView = foodSearchView; } @Override public void releaseView() { this.foodSearchView = null; } @Override public void onFoodItemClicked(FoodItemViewModel foodItemViewModel) { router.startFoodDetailsActivity(foodItemViewModel.getId()); } private void persistSearchResults(List<DbFoodItem> foodItems) { foodDao.storeFoodItems(foodItems); } private void onApiFoodItemsSearched(List<Pair<ApiFoodItem, String>> apiFoodItems) { foodSearchView.hideProgress(); if (apiFoodItems == null || apiFoodItems.size() == 0) { foodSearchView.renderItems(Collections.emptyList()); return; } List<DbFoodItem> dbFoodItems = ApiToDbConverter.convertFromApiWithImages(apiFoodItems); persistSearchResults(dbFoodItems); List<FoodItemViewModel> foodItemViewModels = DbToViewModelConverter.fromDb(dbFoodItems); if (foodSearchView != null) { foodSearchView.renderItems(foodItemViewModels); } } private void onDbFoodItemsSearchFailed(Throwable throwable) { throwable.printStackTrace(); } }
31.728972
122
0.765538
a4083c28a77bcbacc52c025f97127d8c5a0b9ca4
2,535
/* * MSX SDK * MSX SDK client. * * The version of the OpenAPI document: 1.0.8 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package com.cisco.msx.platform.model; import com.cisco.msx.platform.model.LegacySite; 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.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; /** * Model tests for LegacySubscriptionDetail */ public class LegacySubscriptionDetailTest { private final LegacySubscriptionDetail model = new LegacySubscriptionDetail(); /** * Model tests for LegacySubscriptionDetail */ @Test public void testLegacySubscriptionDetail() { // TODO: test LegacySubscriptionDetail } /** * Test the property 'siteCount' */ @Test public void siteCountTest() { // TODO: test siteCount } /** * Test the property 'sites' */ @Test public void sitesTest() { // TODO: test sites } /** * Test the property 'offerSelection' */ @Test public void offerSelectionTest() { // TODO: test offerSelection } /** * Test the property 'serviceInstanceDetail' */ @Test public void serviceInstanceDetailTest() { // TODO: test serviceInstanceDetail } /** * Test the property 'priceDetail' */ @Test public void priceDetailTest() { // TODO: test priceDetail } /** * Test the property 'dealerCode' */ @Test public void dealerCodeTest() { // TODO: test dealerCode } /** * Test the property 'pricePlanId' */ @Test public void pricePlanIdTest() { // TODO: test pricePlanId } /** * Test the property 'termsAndConditionId' */ @Test public void termsAndConditionIdTest() { // TODO: test termsAndConditionId } /** * Test the property '_configuration' */ @Test public void _configurationTest() { // TODO: test _configuration } }
20.950413
92
0.642998
7f8b99baaa8ecd3ec851221ff42349426dde3553
639
package org.odk.collect.android.http; import java.util.List; import java.util.Set; import java.util.TreeSet; import javax.annotation.Nullable; public class CaseInsensitiveEmptyHeaders implements CaseInsensitiveHeaders { @Nullable @Override public Set<String> getHeaders() { return new TreeSet<String>(); } @Override public boolean containsHeader(String header) { return false; } @Nullable @Override public String getAnyValue(String header) { return null; } @Nullable @Override public List<String> getValues(String header) { return null; } }
19.363636
76
0.674491
9a8cd6efa3ce1390fe5364c154971138e1a4c7e6
164
package uk.gov.phe.erdst.sc.awag.webapi.request; public class AssessmentUpdateRequest { public AssessmentClientData assessment; public boolean isSubmit; }
20.5
48
0.792683
0a3c4ccd4a73596d8278bbb35cfb0dacba43af41
512
package org.oobench.messages; import java.util.*; public class StaticPerformance extends MessagesBenchmark { public static void myStaticMethod() { int foo = 10; foo = foo; } public void invoke(int count) { reset(); for (int i = 0; i < count; i++) { myStaticMethod(); } reset(); } public static void main(String[] args) { showLocation(); testMessages(StaticPerformance.class, 500000000, "static", args); } }
20.48
73
0.572266
f81abddaa76f02ee797720f9abaa5fc69b5da2a7
227
package com.yoga.logging.mapper; import com.yoga.logging.model.Logging; import com.yoga.core.mybatis.MyMapper; import org.apache.ibatis.annotations.Mapper; @Mapper public interface LoggingMapper extends MyMapper<Logging> { }
22.7
58
0.814978
b2c6d582423a5a6d656c1138e10846a414934a0e
494
import java.util.Stack; public class S1598CrawlerLogFolder { public int minOperations(String[] logs) { Stack<String> path = new Stack<>(); for (String log : logs) { if (log.equals("../")) { if (!path.isEmpty()) { path.pop(); } } else if (log.equals("./")) { continue; } else { path.push(log); } } return path.size(); } }
24.7
45
0.41498
394f6225fe6d6140786145f3883472549ea0039c
2,653
/* Copyright (C) GridGain Systems. All Rights Reserved. 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 org.gridgain.grid.spi.deployment.uri; import org.gridgain.grid.spi.deployment.*; import org.gridgain.testframework.config.*; import org.gridgain.testframework.junits.spi.*; /** * */ public abstract class GridUriDeploymentAbstractSelfTest extends GridSpiAbstractTest<GridUriDeploymentSpi> { /** {@inheritDoc} */ @Override protected void afterTestsStopped() throws Exception { getSpi().setListener(null); } /** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { getSpi().setListener(new GridDeploymentListener() { @Override public void onUnregistered(ClassLoader ldr) { // No-op. } }); } /** * @return Temporary directory to be used in test. */ @GridSpiTestConfig public String getTemporaryDirectoryPath() { String path = GridTestProperties.getProperty("deploy.uri.tmpdir"); assert path != null; return path; } /** * @param taskName Name of available task. * @throws Exception if failed. */ protected void checkTask(String taskName) throws Exception { assert taskName != null; GridDeploymentResource task = getSpi().findResource(taskName); assert task != null; info("Deployed task [task=" + task + ']'); } /** * @param taskName name of unavailable task. * @throws Exception if failed. */ protected void checkNoTask(String taskName) throws Exception { assert taskName != null; GridDeploymentResource task = getSpi().findResource(taskName); assert task == null; info("Not deployed task [task=" + task + ']'); } }
30.147727
107
0.63513
faa1504b838839b79a438dd377917ef347a770dc
153
package edu.htu.ap.week5.session1.interfaces; public interface C { public void sayHello(); public void sayGoodBye(); public void sayHi(); }
17
46
0.699346
8b6f22eec9c4814ebfeba9d0eb80ab1a3a9180b2
855
package linkedLists; import java.util.*; public class MainLinkedList { public static void main(String[] args) { List<Integer> ll = new LinkedList<>(); List<Integer> al = new ArrayList<>(); getTimeDiff(al); getTimeDiff(ll); // ll.add(12); // // ll.add(2); // ll.add(32); // //ll.toArray(); // ll.set(1, 4); // System.out.println(ll.get(1)); // System.out.println(ll.size()); // System.out.println(ll); } static void getTimeDiff(List<Integer> list) { long start = System.currentTimeMillis(); for(int i = 0; i<100000; i++) { list.add(0, i); } long end = System.currentTimeMillis(); System.out.println(list.getClass().getName() + //getClass() get the class functionality and getName() gets "-->"+ (end - start)); //the name of that class } }
20.357143
110
0.575439
e2c7395a978d20c86fa3c9c5dc9e45446b8b389b
5,506
package cn.featherfly.hammer.tpl.mapper; import java.io.FileOutputStream; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; import org.objectweb.asm.signature.SignatureVisitor; import org.objectweb.asm.signature.SignatureWriter; import cn.featherfly.common.asm.Asm; import cn.featherfly.common.lang.ClassUtils; public class Helloworld2 extends ClassLoader implements Opcodes { public static void main(final String args[]) throws Exception { String name = "cn.featherfly.Example2"; //定义一个叫做Example2的类 String superClass = Type.getInternalName(Superclass.class); String superClassGenericType = Type.getInternalName(User.class); ClassWriter cw = new ClassWriter(0); SignatureWriter signature = new SignatureWriter(); SignatureVisitor superVisitor = signature.visitSuperclass(); superVisitor.visitClassType(superClass); SignatureVisitor typeVisitor = superVisitor.visitTypeArgument(SignatureVisitor.INSTANCEOF); // typeVisitor.visitTypeVariable(Type.getInternalName(User.class)); typeVisitor.visitClassType(superClassGenericType); typeVisitor.visitEnd(); // superVisitor.visitTypeArgument(); // superVisitor.visitClassBound().visitFormalTypeParameter(superClassGenericType); // superVisitor.visitTypeArgument(SignatureVisitor.INSTANCEOF); // superVisitor.visitTypeVariable(ByteCodeUtils.getName(User.class)); // superVisitor.visitFormalTypeParameter(ByteCodeUtils.getName(User.class)); // superVisitor.visitFormalTypeParameter(superClassGenericType); // superVisitor.visitTypeVariable(Type.getInternalName(User.class)); // superVisitor.visitTypeVariable(String.class.getName()); // SignatureVisitor classBound = superVisitor.visitClassBound(); // classBound.visitClassType(superClass); // classBound.visitFormalTypeParameter(superClassGenericType); // classBound.visitEnd(); // visitor.visitClassBound().visitTypeVariable(String.class.getName()); // visitor.visitTypeVariable(Type.getInternalName(String.class)); // signature Lcn/featherfly/hammer/tpl/mapper/Superclass<Lcn/featherfly/hammer/tpl/mapper/User;>; superVisitor.visitEnd(); // cw.visit(V1_8, ACC_PUBLIC, ByteCodeUtils.getName(name), null, superClass, null); System.out.println(signature.toString()); cw.visit(V1_8, ACC_PUBLIC, Asm.getName(name), "Lcn/featherfly/hammer/tpl/mapper/Superclass<Lcn/featherfly/hammer/tpl/mapper/User;>;", superClass, null); // visitor.visitClassType(Type.getInternalName(BasedTplGenericHammer.class)); //生成默认的构造方法 MethodVisitor mw = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null); //生成构造方法的字节码指令 mw.visitVarInsn(ALOAD, 0); mw.visitMethodInsn(INVOKESPECIAL, superClass, "<init>", "()V", false); // mw.visitMethodInsn(INVOKESPECIAL, superClass, "<init>", "(Ljava/lang/String;)V", false); mw.visitInsn(RETURN); mw.visitMaxs(1, 1); mw.visitEnd(); MethodVisitor mw2 = cw.visitMethod(ACC_PUBLIC, "<init>", "(Ljava/lang/String;)V", null, null); mw2.visitVarInsn(ALOAD, 0); mw2.visitVarInsn(ALOAD, 1); mw2.visitMethodInsn(INVOKESPECIAL, superClass, "<init>", "(Ljava/lang/String;)V", false); mw2.visitInsn(RETURN); mw2.visitMaxs(2, 2); mw2.visitEnd(); String getDesc = "(Ljava/io/Serializable;)" + Type.getDescriptor(User.class); MethodVisitor get = cw.visitMethod(ACC_PUBLIC, "get", getDesc, null, null); get.visitVarInsn(ALOAD, 0); get.visitVarInsn(ALOAD, 1); get.visitMethodInsn(INVOKESPECIAL, superClass, "get", getDesc, false); // get.visitMethodInsn(INVOKESPECIAL, superClass, "<init>", "(Ljava/lang/String;)V", false); get.visitInsn(ARETURN); get.visitMaxs(2, 2); get.visitEnd(); //生成main方法 mw = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "main", "([Ljava/lang/String;)V", null, null); //生成main方法中的字节码指令 mw.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); mw.visitLdcInsn("Hello world!"); mw.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false); mw.visitInsn(RETURN); mw.visitMaxs(2, 2); //字节码生成完成 mw.visitEnd(); // 获取生成的class文件对应的二进制流 byte[] code = cw.toByteArray(); //将二进制流写到本地磁盘上 FileOutputStream fos = new FileOutputStream("Example2.class"); fos.write(code); fos.close(); //直接将二进制流加载到内存中 Helloworld2 loader = new Helloworld2(); Class<?> exampleClass = loader.defineClass(name, code, 0, code.length); //通过反射调用main方法 exampleClass.getMethods()[0].invoke(null, new Object[] { null }); Object target = ClassUtils.newInstance(exampleClass); // ClassUtils.invokeMethod(target, "get", 1); System.out.println(ClassUtils.getSuperClassGenricType(exampleClass)); } }
45.131148
116
0.644025
9434865ce3fbe48681049a5022fa6bb4b8d0e0c8
15,542
/* * The MIT License (MIT) * * Copyright (c) 2010 Technische Universitaet Berlin * * 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.mumie.coursecreator.gui; import java.util.Vector; import java.awt.Cursor; import java.awt.Dimension; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.HeadlessException; import java.awt.event.ComponentEvent; import java.awt.event.ComponentListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import net.mumie.coursecreator.CourseCreator; import net.mumie.coursecreator.CCController; import net.mumie.japs.client.ApplicationJapsClient; import net.mumie.japs.client.JapsClient; import net.mumie.japs.client.JapsClientException; /** * This Class is changing the actual Server-Path in order to use several Japs-Servers with one * CC instance. The whole CC gets the JapsClient for communicating with the Japs only from this class. * * @author <a href="mailto:binder@math.tu-berlin.de">Jens Binder</a> * * @author <a href="mailto:vrichter@math.tu-berlin.de">Verena Richter</a> * @version $Id: CCLoginDialog.java,v 1.26 2009/03/31 12:11:41 vrichter Exp $ */ public class CCLoginDialog extends JDialog implements ComponentListener{ static final long serialVersionUID=0; /** Indicates that the dialog has been successfully completed. */ public static final int OK = 0; /** Indicates that the dialog has been aborted. */ public static final int CANCELED = 1; /** Indicates that the user works offline */ public static final int OFFLINE = 2; /** Indicates an undefined status. */ public static final int UNDEFINED = -1; /** Command name indicating that the user wants to submit the data. */ public static final String CMD_OK = "login_ok"; /** Command name indicating that the user wants to abort the dialog without submitting the * data. */ public static final String CMD_CANCEL = "login_cancel"; public static final String CMD_DELETE = "delete_server"; /** Command name indicating that the user doesn't want to use a server */ public static final String CMD_NO_SERVER = "no_server"; /** The current status. */ private int status = UNDEFINED; private static CourseCreator cc; private static CCController parent; private JComboBox serverTextField; private JapsClient japsclient; private boolean connected; private JPanel textFieldPanel; /** * The window listener. */ private WindowListener windowListener = new WindowAdapter () { public void windowClosing (WindowEvent event) { CCLoginDialog dialog = CCLoginDialog.this; dialog.stop(CCLoginDialog.CANCELED); } }; /** * Constructor for a blank LoginDialog * The User has to type in the Server including logindata in order to log into the * JAPS-Server * @param owner - the owner of this dialog gets activated after the OK-Button is pressed (when not already activated) * @throws HeadlessException */ public CCLoginDialog(CCController owner) throws HeadlessException { super(CCController.frame,"Mumie-Japs Server"); cc = CCController.frame; parent = owner; this.buildLayout(parent.getConfig().getServerList()); this.addComponentListener(this); } /** build the Layout */ private void buildLayout(Vector<String> serverURL){ // Dimensions of the Dialog int width = 450; int height = 160; int buttonWidth = 80; int buttonHeight = 30; // sets the Layout this.getContentPane().setLayout(new GridBagLayout()); // the Button and Label Text String okButtonText = "Ok"; String cancelButtonText = "Cancel"; String noserverButtonText = "no Server"; String headlineLabelText = "Mumie Login - Server"; String serverLabelText = "Japs-Server:"; // the Fonts Font font = new Font("SansSerif", Font.PLAIN, 14); Font headlineLabelFont = new Font("SansSerif", Font.PLAIN, 16); Font textFieldFont = new Font("Monospaced", Font.PLAIN, 14); // GridBagContraints for rootPanel (s.b.): GridBagConstraints rootPanelStyle = new GridBagConstraints(); rootPanelStyle.anchor = GridBagConstraints.CENTER; rootPanelStyle.insets.top = 4; rootPanelStyle.insets.right = 4; rootPanelStyle.insets.bottom = 4; rootPanelStyle.insets.left = 4; rootPanelStyle.gridx = 0; rootPanelStyle.gridy = 0; // GridBagContraints for headlineLabel: GridBagConstraints headlineLabelStyle = new GridBagConstraints(); headlineLabelStyle.anchor = GridBagConstraints.CENTER; headlineLabelStyle.insets.top = 6; headlineLabelStyle.insets.right = 6; headlineLabelStyle.insets.bottom = 6; headlineLabelStyle.insets.left = 6; headlineLabelStyle.gridx = 0; headlineLabelStyle.gridy = 0; // GridBagConstraints for textFieldPanel (s.b.): GridBagConstraints textFieldPanelStyle = new GridBagConstraints(); textFieldPanelStyle.anchor = GridBagConstraints.CENTER; textFieldPanelStyle.insets.top = 4; textFieldPanelStyle.insets.right = 4; textFieldPanelStyle.insets.bottom = 4; textFieldPanelStyle.insets.left = 4; textFieldPanelStyle.gridx = 0; textFieldPanelStyle.gridy = 1; // GridBagConstraints for buttonPanel (s.b.): GridBagConstraints buttonPanelStyle = new GridBagConstraints(); buttonPanelStyle.anchor = GridBagConstraints.CENTER; buttonPanelStyle.insets.top = 4; buttonPanelStyle.insets.right = 4; buttonPanelStyle.insets.bottom = 4; buttonPanelStyle.insets.left = 4; buttonPanelStyle.gridx = 0; buttonPanelStyle.gridy = 2; // GridBagConstraints for serverLabel: GridBagConstraints serverLabelStyle = new GridBagConstraints(); serverLabelStyle.anchor = GridBagConstraints.WEST; serverLabelStyle.insets.top = 6; serverLabelStyle.insets.right = 6; serverLabelStyle.insets.bottom = 6; serverLabelStyle.insets.left = 6; serverLabelStyle.gridx = 0; serverLabelStyle.gridy = 0; // GridBagConstraints for serverTextField: GridBagConstraints serverTextFieldStyle = new GridBagConstraints(); serverTextFieldStyle.anchor = GridBagConstraints.WEST; serverTextFieldStyle.insets.top = 6; serverTextFieldStyle.insets.right = 6; serverTextFieldStyle.insets.bottom = 6; serverTextFieldStyle.insets.left = 6; serverTextFieldStyle.gridx = 1; serverTextFieldStyle.gridy = 0; // GridBagContraints for okButton (s.b.): GridBagConstraints okButtonStyle = new GridBagConstraints(); okButtonStyle.anchor = GridBagConstraints.CENTER; okButtonStyle.insets.top = 6; okButtonStyle.insets.right = 6; okButtonStyle.insets.bottom = 6; okButtonStyle.insets.left = 6; okButtonStyle.gridx = 0; okButtonStyle.gridy = 0; // GridBagContraints for cancelButton (s.b.): GridBagConstraints cancelButtonStyle = new GridBagConstraints(); cancelButtonStyle.anchor = GridBagConstraints.CENTER; cancelButtonStyle.insets.top = 6; cancelButtonStyle.insets.right = 6; cancelButtonStyle.insets.bottom = 6; cancelButtonStyle.insets.left = 6; cancelButtonStyle.gridx = 2; cancelButtonStyle.gridy = 0; // GridBagContraints for noServerButton (s.b.): GridBagConstraints noServerButtonStyle = new GridBagConstraints(); noServerButtonStyle.anchor = GridBagConstraints.CENTER; noServerButtonStyle.insets.top = 6; noServerButtonStyle.insets.right = 6; noServerButtonStyle.insets.bottom = 6; noServerButtonStyle.insets.left = 6; noServerButtonStyle.gridx = 1; noServerButtonStyle.gridy = 0; // GridBagContraints for cancelButton (s.b.): GridBagConstraints deleteButtonStyle = new GridBagConstraints(); deleteButtonStyle.anchor = GridBagConstraints.CENTER; deleteButtonStyle.insets.top = 6; deleteButtonStyle.insets.right = 6; deleteButtonStyle.insets.bottom = 6; deleteButtonStyle.insets.left = 6; deleteButtonStyle.gridx = 4; deleteButtonStyle.gridy = 0; // Creating rootPanel (contains all components) JPanel rootPanel = new JPanel(new GridBagLayout()); rootPanel.setFont(font); // Creating headlineLabel: JLabel headlineLabel = new JLabel(headlineLabelText); headlineLabel.setFont(headlineLabelFont); // Creating textFieldPanel: textFieldPanel = new JPanel(new GridBagLayout()); textFieldPanel.setFont(font); // Creating serverLabel: JLabel serverLabel = new JLabel(serverLabelText); // Creating serverTextField: serverTextField = new JComboBox(serverURL); serverTextField.setEditable(true); serverTextField.setFont(textFieldFont); // Creating buttonPanel: JPanel buttonPanel = new JPanel(new GridBagLayout()); buttonPanel.setFont(font); // okButton: JButton okButton = new JButton(okButtonText); okButton.setPreferredSize(new Dimension(buttonWidth, buttonHeight)); okButton.setActionCommand(CMD_OK); okButton.addActionListener(parent); // cancelButton: JButton cancelButton = new JButton(cancelButtonText); cancelButton.setPreferredSize(new Dimension(buttonWidth, buttonHeight)); cancelButton.setActionCommand(CMD_CANCEL); cancelButton.addActionListener(parent); // no_server Button JButton noServerButton = new JButton(noserverButtonText); noServerButton.setPreferredSize(new Dimension(buttonWidth, buttonHeight)); noServerButton.setActionCommand(CMD_NO_SERVER); noServerButton.addActionListener(parent); JButton deleteButton = new JButton("delete Entry"); deleteButton.setPreferredSize(new Dimension(buttonWidth, buttonHeight)); deleteButton.setActionCommand(CMD_DELETE); deleteButton.addActionListener(parent); // Composing the GUI: this.getContentPane().setLayout(new GridBagLayout()); this.getContentPane().add(rootPanel, rootPanelStyle); rootPanel.add(headlineLabel, headlineLabelStyle); rootPanel.add(textFieldPanel, textFieldPanelStyle); textFieldPanel.add(serverLabel, serverLabelStyle); textFieldPanel.add(serverTextField, serverTextFieldStyle); rootPanel.add(buttonPanel, buttonPanelStyle); buttonPanel.add(okButton, okButtonStyle); buttonPanel.add(noServerButton, noServerButtonStyle); buttonPanel.add(cancelButton, cancelButtonStyle); buttonPanel.add(deleteButton, deleteButtonStyle); this.addWindowListener(this.windowListener); int serverMax =0 ; for (int i=0;i<serverURL.size();i++){ serverMax = Math.max(((String)serverURL.get(i)).length(),serverMax); } width= Math.max(width,serverMax*12);//FIXME schoener waere getFontWidth... this.setSize(width, height); this.setLocation(parent.getConfig().getPOSITION_LOGIN()); } public void stop(int status) { this.status = status; if ((status==OK)||(status==OFFLINE)) this.setVisible(false); if (status==OK) { CCController.frame.setCursor(new Cursor(Cursor.WAIT_CURSOR)); this.updateJapsClient(); if (this.getConnected()){ cc.setTitle("CourseCreator - "+this.getURLPrefix()); CourseCreator.printStatus("changed Japs-Server",null); JOptionPane.showMessageDialog(CCController.frame, "<html>Eingeloggt auf dem Server:<br>"+ this.getURLPrefix()+"</html>","Server", JOptionPane.INFORMATION_MESSAGE); CCController.frame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); }CCController.frame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } if (status==OFFLINE) { cc.setTitle("CourseCreator - OFFLINE"); CourseCreator.printStatus("offline - Mode",null); JOptionPane.showMessageDialog(CCController.frame, "OFFLINE-Mode","OFFLINE-Mode", JOptionPane.INFORMATION_MESSAGE); } if (status==CANCELED){cc.getController().exitDialog();} if ((status==OK)||(status==OFFLINE)) if (!cc.isVisible()) cc.setVisible(true); } public int getStatus() { return this.status; } public String getURLPrefix() { return ((String)this.serverTextField.getSelectedItem()); } public boolean getConnected() { return connected; } public void setConnected(boolean connected) { this.connected = connected; } private void updateJapsClient(){ String urlPrefix = this.getURLPrefix(); babble("create new JapsClient with "+urlPrefix); this.japsclient = new ApplicationJapsClient(urlPrefix,cc); this.japsclient.setMaxLoginTries(3); // just a try to login befor reading anything ... try { int ret = this.japsclient.login(); if(ret==JapsClient.LOGIN_CANCELED){ this.setConnected(false); } if(ret==JapsClient.LOGIN_FAILED){ CCController.dialogErrorOccured( "CCLoginDialog: LoginFailed", "CCLoginDialog: LoginFailed, Programm wird beendet", JOptionPane.ERROR_MESSAGE); if (parent.dialogCloseCauseNotLogin()) System.exit(0); else{ this.setConnected(false); } } if (ret==JapsClient.LOGIN_SUCCESSFUL){ parent.getConfig().addServer(urlPrefix,true,true); this.setConnected(true); } } catch(JapsClientException jce){ CCController.dialogErrorOccured( "CCLoginDialog: LoginFailed", "CCLoginDialog JapsClientException while login: " + jce, JOptionPane.ERROR_MESSAGE); this.setConnected(false); parent.loginFailed(jce.getMessage()); } } public JapsClient getJapsClient() { return this.japsclient; } public void componentHidden(ComponentEvent e) {} public void componentMoved(ComponentEvent e) { parent.getConfig().setPOSITION_LOGIN(e.getComponent().getLocation()); } public void componentResized(ComponentEvent e) {} public void componentShown(ComponentEvent e) {} void babble(String bab){ if (parent.getConfig().getDEBUG()) System.out.println("CCLogindialog:"+bab); } /** loescht ersten eintrag aus Combobox */ public void updateCombobox(){ this.serverTextField.remove(0); if (this.serverTextField.getItemCount()!=0) this.serverTextField.setSelectedIndex(0); else this.serverTextField.setSelectedIndex(-1); this.serverTextField.setVisible(true); this.serverTextField.repaint(); this.serverTextField.validate(); } }
34.847534
118
0.726419
e8c6ddda6e4ada40408ff526f18f46d3d6d7d212
729
package com.br.uaicoins.models.db; import java.math.BigDecimal; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import lombok.Getter; import lombok.Setter; @Getter @Setter @Entity(name = "debito") public class Debito { @Id @GeneratedValue(strategy= GenerationType.IDENTITY) private Integer id; @ManyToOne @JoinColumn(name = "id_usuario") private Usuario usuario; @Column(name = "valor_debito") private BigDecimal valorDebito; @Column(name = "data_debito") private Date dataDebito; }
20.25
51
0.78738
2f51a8d2b2c38fc9894615857d539329549d3032
974
import edu.princeton.cs.algs4.Digraph; import edu.princeton.cs.algs4.In; import org.junit.Assert; import org.junit.Test; public class SAPTest { @Test public void ancestorTest(){ SAP sap = new SAP(new Digraph(new In("test/resources/wordnet/digraph1.txt"))); Assert.assertTrue("", sap.ancestor(7,4) == 1); Assert.assertTrue("", sap.ancestor(11,12) == 10); Assert.assertTrue("", sap.ancestor(7,12) == 1); Assert.assertTrue("", sap.ancestor(1,6) == -1); Assert.assertEquals(10, sap.ancestor(12,10)); } @Test public void lengthTest(){ SAP sap = new SAP(new Digraph(new In("test/resources/wordnet/digraph1.txt"))); Assert.assertTrue("", sap.length(3,11) == 4); Assert.assertTrue("", sap.length(9,12) == 3); Assert.assertTrue("", sap.length(7,2) == 4); Assert.assertTrue("", sap.length(1,6) == -1); Assert.assertEquals(1, sap.length(12,10)); } }
24.35
86
0.601643
10ca8590df59169b40e5a5f44e978e308f1ce877
2,340
/** * Copyright (c) 2011-2017, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.builders.gui; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import buildcraft.builders.TileBuilder; import buildcraft.core.lib.gui.BuildCraftContainer; import buildcraft.core.lib.gui.widgets.ScrollbarWidget; public class ContainerBuilder extends BuildCraftContainer { protected ScrollbarWidget scrollbarWidget; protected IInventory playerIInventory; protected TileBuilder builder; public ContainerBuilder(IInventory playerInventory, TileBuilder builder) { super(builder.getSizeInventory()); this.playerIInventory = playerInventory; this.builder = builder; this.scrollbarWidget = new ScrollbarWidget(172, 17, 18, 0, 108); this.scrollbarWidget.hidden = true; this.addWidget(scrollbarWidget); addSlotToContainer(new Slot(builder, 0, 80, 27)); for (int k = 0; k < 3; k++) { for (int j1 = 0; j1 < 9; j1++) { addSlotToContainer(new Slot(builder, 1 + j1 + k * 9, 8 + j1 * 18, 72 + k * 18)); } } for (int y = 0; y < 3; y++) { for (int x = 0; x < 9; x++) { addSlotToContainer(new Slot(playerInventory, x + y * 9 + 9, 8 + x * 18, 140 + y * 18)); } } for (int x = 0; x < 9; x++) { addSlotToContainer(new Slot(playerInventory, x, 8 + x * 18, 198)); } if (!builder.getWorldObj().isRemote && playerInventory instanceof InventoryPlayer) { // Refresh the requirements list for the player opening the GUI, // in case he does not have it. builder.updateRequirementsOnGuiOpen(((InventoryPlayer) playerInventory).player); builder.addGuiWatcher(((InventoryPlayer) playerInventory).player); } } public TileBuilder getBuilder() { return builder; } @Override public void onContainerClosed(EntityPlayer player) { super.onContainerClosed(player); builder.removeGuiWatcher(player); } @Override public boolean canInteractWith(EntityPlayer entityplayer) { return builder.isUseableByPlayer(entityplayer); } }
30.789474
91
0.725641
79371abbc90d8d962df697b33f4b04abff6b6137
13,107
package com.keykat.keykat.brawlkat.common.util.network; import android.content.Context; import com.keykat.keykat.brawlkat.common.util.kat_LoadingDialog; import com.keykat.keykat.brawlkat.common.util.KatData; import com.keykat.keykat.brawlkat.common.util.parser.kat_official_BrawlerRankingParser; import com.keykat.keykat.brawlkat.common.util.parser.kat_official_ClubRankingParser; import com.keykat.keykat.brawlkat.common.util.parser.kat_official_PlayerRankingParser; import com.keykat.keykat.brawlkat.common.util.parser.kat_official_PowerPlaySeasonParser; import com.keykat.keykat.brawlkat.common.util.parser.kat_official_PowerPlaySeasonRankingParser; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.InetSocketAddress; import java.net.Socket; import java.net.SocketAddress; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashMap; public class Client { // data 배열 리스트 ............................................................................... public static ArrayList<String> resData; public ArrayList<String> resOffiData; public ArrayList<String> resRankingData; // ............................................................................................. public BaseApiDataThread getThread; public getAllTypeApiThread officialApiThread; private final String boundaryCode = "this_is_a_kat_data_boundary!"; //private String GCPIPADDRESS = "35.237.9.225"; private final String ORACLEIPADDRESS = "193.122.98.86"; private final Context context; public Client(Context context) { this.context = context; } // 플레이어 및 클럽을 검색할 때 작동하는 스레드. 앱을 실행할 때 저장한 유저 정보가 있다면 불러오고 그렇지 않으면 굳이 불러올 필요가 없음. // 이후 필요할 때마다 발동시키면 됨. public class getAllTypeApiThread extends Thread { private final String tag; private final String type; private final String apiType; Context context; public getAllTypeApiThread(String tag, String type, String apiType, Context context) { this.tag = tag; this.type = type; this.apiType = apiType; this.context = context; } public void run() { try { while (true) { if (tag == null) continue; SocketAddress socketAddress = new InetSocketAddress(ORACLEIPADDRESS, 9000); Socket socket = new Socket(); socket.connect(socketAddress); byte[] bytes; String result = null; // 데이터 보내기 // playerTag를 먼저 보냄. if (apiType.equals("official")) result = "%23" + tag; else if (apiType.equals("nofficial")) result = tag; result = type + "/" + result + "/" + apiType; OutputStream os = socket.getOutputStream(); bytes = result.getBytes(StandardCharsets.UTF_8); os.write(bytes); os.flush(); // os 를 flush한 후 데이터 종료 완료를 알리기 위해 개행문자를 보내 데이터 수신을 완료한다. String end = "\n"; os.write(end.getBytes()); os.flush(); InputStream data = socket.getInputStream(); InputStreamReader input = new InputStreamReader(data); BufferedReader reader = new BufferedReader(input); result = reader.readLine(); int startidx = 0; int split; // API 데이터 파싱 String splited; resOffiData = new ArrayList<>(); while (true) { split = result.indexOf(boundaryCode, startidx); if (split == -1) break; splited = result.substring(startidx, split); resOffiData.add(splited); startidx = split + boundaryCode.length(); } input.close(); data.close(); reader.close(); socket.close(); break; } } catch (Exception e) { KatData.serverProblemDialog(); e.printStackTrace(); } } } // brawlify에서 가져오는 랭킹 데이터로 매번 업데이트할 필요가 없음. 어차피 랭킹이 그렇게 자주 바뀌는 시스템이 아니기 때문. // 앱을 실행할 때 맨 처음에 한번만 불러오거나 필요할 때만 불러오게 하면 됨. public class getRankingApiThread extends Thread { String countryCode; String Id; String status; kat_LoadingDialog dialog; public getRankingApiThread(String countryCode, String Id, String status, kat_LoadingDialog dialog) { this.countryCode = countryCode; this.Id = Id; this.status = status; this.dialog = dialog; } public getRankingApiThread(String countryCode, String Id, String status) { this.countryCode = countryCode; this.Id = Id; this.status = status; } public void run() { try { while (true) { SocketAddress socketAddress = new InetSocketAddress(ORACLEIPADDRESS, 9000); Socket socket = new Socket(); socket.connect(socketAddress); byte[] bytes; String result; // 데이터 보내기 if (status.equals("PowerPlay")) result = "rankings" + "/" + countryCode + "PowerPlay" + Id + "/" + "official"; else if (status.equals("Brawler")) result = "rankings" + "/" + countryCode + Id + "/" + "official"; else result = "rankings" + "/" + countryCode + "/" + "official"; OutputStream os = socket.getOutputStream(); bytes = result.getBytes(StandardCharsets.UTF_8); os.write(bytes); os.flush(); // os 를 flush한 후 데이터 종료 완료를 알리기 위해 개행문자를 보내 데이터 수신을 완료한다. String end = "\n"; os.write(end.getBytes()); os.flush(); InputStream data = socket.getInputStream(); InputStreamReader input = new InputStreamReader(data); BufferedReader reader = new BufferedReader(input); result = reader.readLine(); int startidx = 0; int split = 0; // API 데이터 파싱 String splited; resRankingData = new ArrayList<>(); while (split != -1) { split = result.indexOf(boundaryCode, startidx); if (split == -1) break; splited = result.substring(startidx, split); resRankingData.add(splited); startidx = split + boundaryCode.length(); } // 파싱 할 부분 ................................................................... if (status.equals("PowerPlay")) { kat_official_PowerPlaySeasonRankingParser powerPlaySeasonRankingParser; powerPlaySeasonRankingParser = new kat_official_PowerPlaySeasonRankingParser(resRankingData.get(0)); if (countryCode.equals("global")) { if (!KatData.PowerPlaySeasonRankingArrayList.containsKey(Id)) KatData.PowerPlaySeasonRankingArrayList.put(Id, powerPlaySeasonRankingParser.DataParser()); } else { if (KatData.MyPowerPlaySeasonRankingArrayList.containsKey(countryCode)) { if (!KatData.MyPowerPlaySeasonRankingArrayList.get(countryCode).containsKey(Id)) { KatData.MyPowerPlaySeasonRankingArrayList .get(countryCode) .put(Id, powerPlaySeasonRankingParser.DataParser()); } } else { KatData.MyPowerPlaySeasonRankingArrayList.put(countryCode, new HashMap<>()); KatData.MyPowerPlaySeasonRankingArrayList .get(countryCode) .put(Id, powerPlaySeasonRankingParser.DataParser()); } } } else if (status.equals("Brawler")) { kat_official_BrawlerRankingParser brawlerRankingParser; brawlerRankingParser = new kat_official_BrawlerRankingParser(resRankingData.get(0)); if (countryCode.equals("global")) { if (!KatData.BrawlerRankingArrayList.containsKey(Id)) KatData.BrawlerRankingArrayList.put(Id, brawlerRankingParser.DataParser()); } else { if (KatData.MyBrawlerRankingArrayList.containsKey(countryCode)) { if (!KatData.MyBrawlerRankingArrayList.get(countryCode).containsKey(Id)) { KatData.MyBrawlerRankingArrayList .get(countryCode) .put(Id, brawlerRankingParser.DataParser()); } } else { KatData.MyBrawlerRankingArrayList.put(countryCode, new HashMap<String, ArrayList<kat_official_BrawlerRankingParser.brawlerRankingData>>()); KatData.MyBrawlerRankingArrayList .get(countryCode) .put(Id, brawlerRankingParser.DataParser()); } } } else { kat_official_ClubRankingParser clubRankingParser; kat_official_PlayerRankingParser playerRankingParser; kat_official_PowerPlaySeasonParser powerPlaySeasonParser; clubRankingParser = new kat_official_ClubRankingParser(resRankingData.get(0)); playerRankingParser = new kat_official_PlayerRankingParser(resRankingData.get(1)); powerPlaySeasonParser = new kat_official_PowerPlaySeasonParser(resRankingData.get(2)); if (countryCode.equals("global")) { KatData.PlayerRankingArrayList = playerRankingParser.DataParser(); KatData.ClubRankingArrayList = clubRankingParser.DataParser(); KatData.PowerPlaySeasonArrayList = powerPlaySeasonParser.DataParser(); } else { KatData.MyPlayerRankingArrayList = playerRankingParser.DataParser(); KatData.MyClubRankingArrayList = clubRankingParser.DataParser(); KatData.MyPowerPlaySeasonArrayList = powerPlaySeasonParser.DataParser(); } } input.close(); data.close(); reader.close(); socket.close(); if (dialog != null) dialog.dismiss(); break; } } catch (Exception e) { KatData.serverProblemDialog(); e.printStackTrace(); } } } public void init() { if(getThread == null) getThread = new BaseApiDataThread(context); getThread.start(); } public void AllTypeInit(String tag, String type, String apiType, Context context) { resOffiData = new ArrayList<>(); officialApiThread = new getAllTypeApiThread(tag, type, apiType, context); if (officialApiThread.getState() == Thread.State.NEW) officialApiThread.start(); } public void RankingInit(String countryCode, String Id, String status) { getRankingApiThread getRankingApiThread = new getRankingApiThread(countryCode, Id, status); getRankingApiThread.start(); } public ArrayList<String> getData() { return resData; } public ArrayList<String> getAllTypeData() { return resOffiData; } public getAllTypeApiThread apiThread() { return officialApiThread; } }
40.453704
128
0.512322
b45957ba262134a4d03bf6e9808a8d7ac096f56c
1,773
/* * Copyright 2015-2021 the original author or authors. * * 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 org.lastaflute.di.core.meta.impl; import org.lastaflute.di.core.aop.Aspect; import org.lastaflute.di.core.aop.Pointcut; import org.lastaflute.di.core.aop.frame.MethodInterceptor; import org.lastaflute.di.core.aop.impl.AspectImpl; import org.lastaflute.di.core.meta.AspectDef; /** * @author modified by jflute (originated in Seasar) */ public class AspectDefImpl extends ArgDefImpl implements AspectDef { private Pointcut pointcut; public AspectDefImpl() { } public AspectDefImpl(Pointcut pointcut) { setPointcut(pointcut); } public AspectDefImpl(MethodInterceptor interceptor) { setValue(interceptor); } public AspectDefImpl(MethodInterceptor interceptor, Pointcut pointcut) { setValue(interceptor); setPointcut(pointcut); } public Pointcut getPointcut() { return pointcut; } public void setPointcut(Pointcut pointcut) { this.pointcut = pointcut; } public Aspect getAspect() { final MethodInterceptor interceptor = (MethodInterceptor) getValue(Object.class); return new AspectImpl(interceptor, pointcut); } }
29.55
89
0.72194
87b95933b825baf1706f088e2c62772da0ab6653
4,132
/* * 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.flink.runtime.throughput; import org.apache.flink.configuration.ReadableConfig; import org.apache.flink.configuration.TaskManagerOptions; import java.time.Duration; import static org.apache.flink.configuration.TaskManagerOptions.BUFFER_DEBLOAT_SAMPLES; import static org.apache.flink.configuration.TaskManagerOptions.BUFFER_DEBLOAT_TARGET; import static org.apache.flink.configuration.TaskManagerOptions.BUFFER_DEBLOAT_THRESHOLD_PERCENTAGES; import static org.apache.flink.util.Preconditions.checkArgument; import static org.apache.flink.util.Preconditions.checkNotNull; /** Configuration for {@link BufferDebloater}. */ public final class BufferDebloatConfiguration { private final Duration targetTotalBufferSize; private final int maxBufferSize; private final int minBufferSize; private final int bufferDebloatThresholdPercentages; private final int numberOfSamples; private final boolean enabled; private BufferDebloatConfiguration( boolean enabled, Duration targetTotalBufferSize, int maxBufferSize, int minBufferSize, int bufferDebloatThresholdPercentages, int numberOfSamples) { this.targetTotalBufferSize = checkNotNull(targetTotalBufferSize); this.maxBufferSize = maxBufferSize; this.minBufferSize = minBufferSize; this.bufferDebloatThresholdPercentages = bufferDebloatThresholdPercentages; this.numberOfSamples = numberOfSamples; this.enabled = enabled; } public boolean isEnabled() { return enabled; } public Duration getTargetTotalBufferSize() { return targetTotalBufferSize; } public int getMaxBufferSize() { return maxBufferSize; } public int getMinBufferSize() { return minBufferSize; } public int getBufferDebloatThresholdPercentages() { return bufferDebloatThresholdPercentages; } public int getNumberOfSamples() { return numberOfSamples; } public static BufferDebloatConfiguration fromConfiguration(ReadableConfig config) { Duration targetTotalBufferSize = config.get(BUFFER_DEBLOAT_TARGET); int maxBufferSize = Math.toIntExact(config.get(TaskManagerOptions.MEMORY_SEGMENT_SIZE).getBytes()); int minBufferSize = Math.toIntExact(config.get(TaskManagerOptions.MIN_MEMORY_SEGMENT_SIZE).getBytes()); int bufferDebloatThresholdPercentages = config.get(BUFFER_DEBLOAT_THRESHOLD_PERCENTAGES); final int numberOfSamples = config.get(BUFFER_DEBLOAT_SAMPLES); // Right now the buffer size can not be grater than integer max value according to // MemorySegment and buffer implementation. checkArgument(maxBufferSize > 0); checkArgument(minBufferSize > 0); checkArgument(numberOfSamples > 0); checkArgument(maxBufferSize >= minBufferSize); checkArgument(targetTotalBufferSize.toMillis() > 0.0); return new BufferDebloatConfiguration( config.get(TaskManagerOptions.BUFFER_DEBLOAT_ENABLED), targetTotalBufferSize, maxBufferSize, minBufferSize, bufferDebloatThresholdPercentages, numberOfSamples); } }
38.981132
101
0.729187
219db491912bca616cae9c488691ba7e92ba6be5
1,898
package com.kaciras.blog.infra; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.core.RedisOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.serializer.RedisSerializer; import static org.assertj.core.api.Assertions.assertThat; @SpringBootTest(classes = RedisExtensionsTest.TestConfig.class) final class RedisExtensionsTest { @Import(RedisAutoConfiguration.class) @Configuration(proxyBeanMethods = false) static class TestConfig { @Bean RedisOperations<String, Object> hash(RedisConnectionFactory factory) { var template = new RedisTemplate<String, Object>(); template.setConnectionFactory(factory); template.setDefaultSerializer(RedisSerializer.string()); return template; } } private static final String KEY = "test:hashUpdate"; @Autowired private RedisOperations<String, Object> operations; @BeforeEach void cleanUp() { operations.unlink(KEY); } @Test void hashUpdate() { operations.opsForHash().put(KEY, "hk", "foo"); var success = RedisExtensions.hsetx(operations, KEY, "hk", "bar"); assertThat(success).isTrue(); assertThat(operations.opsForHash().get(KEY, "hk")).isEqualTo("bar"); } @Test void updateNonExists() { var success = RedisExtensions.hsetx(operations, KEY, "hk", "bar"); assertThat(success).isFalse(); assertThat(operations.hasKey(KEY)).isFalse(); } }
31.114754
80
0.788198
0b8bd5023a275b27c855e609b4ea2f769e828eae
909
package org.spring.springboot.service; import org.spring.springboot.pojo.User; import org.springframework.context.annotation.ComponentScan; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; public interface UserService { /** * 查看所有用户信息 * @return */ List<User> getUserList(); /** * 查看满足条件的用户信息 * * @param id * @return */ List<User> getUserByid(int id); /** * 插入新的数据 * * @param id , name , version * @return */ int insertUser(int id , String name , long version); /** * 更新满足条件的数据 * * @param id , name , version * @return */ int updateUser(int id , String name , long version); /** * 删除满足条件的数据 * * @param id,version * @return */ int deleteUser(int id , long version); List<User> list(); }
16.527273
60
0.572057
a2b1f51cf9a3e3e9d81acd909e9f26961c9ee441
10,678
package com.robinkanatzar.findamovie; import android.content.Context; import android.graphics.Typeface; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import android.widget.ProgressBar; import android.widget.Toast; import com.robinkanatzar.findamovie.api.RestClient; import com.robinkanatzar.findamovie.api.SearchResponse; import com.robinkanatzar.findamovie.recyclerview.Movie; import com.robinkanatzar.findamovie.recyclerview.MovieAdapter; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import rx.Subscriber; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; import rx.subscriptions.Subscriptions; import timber.log.Timber; import static android.view.View.GONE; public class MainActivity extends AppCompatActivity { @BindView(R.id.et_query) EditText mQuery; @BindView(R.id.rv_results) RecyclerView mResults; @BindView(R.id.progress_spinner) ProgressBar mProgressSpinner; private String mQueryString; private List<Movie> movieList = new ArrayList<>(); private MovieAdapter movieAdapter; private Subscription subscription = Subscriptions.empty(); private Integer mPageNumber = 1; private Integer mItemsPerPage = 20; private LinearLayoutManager layoutManager; private Boolean isLoading = false; private RecyclerView.OnScrollListener recyclerViewOnScrollListener = new RecyclerView.OnScrollListener() { @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { super.onScrollStateChanged(recyclerView, newState); } @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); int visibleItemCount = layoutManager.getChildCount(); int firstVisibleItemPosition = layoutManager.findFirstVisibleItemPosition(); if (firstVisibleItemPosition == ((mPageNumber * 20) - 5) && !isLoading) { isLoading = true; loadMoreItems(); } } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); movieAdapter = new MovieAdapter(movieList); layoutManager = new LinearLayoutManager(this); mResults.setLayoutManager(layoutManager); mResults.setAdapter(movieAdapter); mResults.addOnScrollListener(recyclerViewOnScrollListener); Typeface typeface=Typeface.createFromAsset(getAssets(), "fonts/SpecialElite.ttf"); mQuery.setTypeface(typeface); } @OnClick(R.id.btn_search) void search() { movieList.clear(); dismissKeyboard(); if (!subscription.isUnsubscribed()) { subscription.unsubscribe(); } mQueryString = mQuery.getText().toString(); if (mQueryString == "" || mQueryString.isEmpty() || mQueryString == null) { Toast.makeText(this, getString(R.string.error_enter_query), Toast.LENGTH_LONG).show(); } else { mProgressSpinner.setVisibility(View.VISIBLE); rx.Observable<SearchResponse> observable = new RestClient().getService().searchForMovie(getString(R.string.API_KEY), mPageNumber, mQueryString); subscription = observable.subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Subscriber<SearchResponse>() { String title; String description; String iconUrl; int totalResults; int currentPage; int totalPages; int totalResultsOnPage; int max; @Override public void onCompleted() { movieAdapter.notifyDataSetChanged(); mProgressSpinner.setVisibility(GONE); isLoading = false; } @Override public void onError(Throwable e) { Timber.e(e); } @Override public void onNext(SearchResponse searchResponse) { if(searchResponse.getTotalResults() != 0) { totalResults = searchResponse.getTotalResults(); currentPage = searchResponse.getPage(); totalPages = searchResponse.getTotalPages(); totalResultsOnPage = totalResults - (currentPage - 1) * mItemsPerPage; if (totalResultsOnPage < mItemsPerPage) { max = totalResultsOnPage; } else { max = 20; } for (int i = 0; i < max; i++) { if (searchResponse.getResults().get(i).getOriginalTitle() != null) { title = searchResponse.getResults().get(i).getOriginalTitle().toString(); } else { title = ""; } if (searchResponse.getResults().get(i).getOverview() != null) { description = searchResponse.getResults().get(i).getOverview().toString(); } else { description = ""; } if (searchResponse.getResults().get(i).getPosterPath() != null) { iconUrl = "http://image.tmdb.org/t/p/w500" + searchResponse.getResults().get(i).getPosterPath().toString(); } else { iconUrl = getString(R.string.default_movie_image); } addMovieToList(title, description, iconUrl); } } else { Toast.makeText(MainActivity.this, getString(R.string.no_results), Toast.LENGTH_SHORT).show(); } } }); } } private void dismissKeyboard() { View view = this.getCurrentFocus(); InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } private void addMovieToList(String title, String description, String iconUrl) { Movie movie = new Movie(title, description, iconUrl); movieList.add(movie); } private void loadMoreItems() { mPageNumber += 1; rx.Observable<SearchResponse> observable = new RestClient().getService().searchForMovie(getString(R.string.API_KEY), mPageNumber, mQueryString); subscription = observable.subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Subscriber<SearchResponse>() { String title; String description; String iconUrl; int totalResults; int currentPage; int totalPages; int totalResultsOnPage; int max; @Override public void onCompleted() { movieAdapter.notifyDataSetChanged(); mProgressSpinner.setVisibility(GONE); isLoading = false; } @Override public void onError(Throwable e) { Timber.e(e); } @Override public void onNext(SearchResponse searchResponse) { totalResults = searchResponse.getTotalResults(); currentPage = searchResponse.getPage(); totalPages = searchResponse.getTotalPages(); totalResultsOnPage = totalResults - (currentPage - 1) * mItemsPerPage; if (totalResultsOnPage < 20) { max = totalResultsOnPage; } else { max = 20; } for (int i = 0; i < max; i++) { if (searchResponse.getResults().get(i).getOriginalTitle() != null) { title = searchResponse.getResults().get(i).getOriginalTitle().toString(); } else { title = ""; } if(searchResponse.getResults().get(i).getOverview() != null) { description = searchResponse.getResults().get(i).getOverview().toString(); } else { description = ""; } if (searchResponse.getResults().get(i).getPosterPath() != null) { iconUrl = getString(R.string.icon_url_base_string) + searchResponse.getResults().get(i).getPosterPath().toString(); } else { iconUrl = getString(R.string.default_movie_image); } addMovieToList(title, description, iconUrl); } } }); } @Override protected void onDestroy() { super.onDestroy(); removeListeners(); mPageNumber = 1; subscription.unsubscribe(); } private void removeListeners(){ mResults.removeOnScrollListener(recyclerViewOnScrollListener); } }
39.695167
156
0.530062
395d110a5a3bafe337c502ba85c409f6241dc20f
8,520
package tracker; import java.util.ArrayList; import java.util.List; import static java.lang.System.exit; public class MenuTracker { private Input input; private Tracker tracker; private List<UserAction> actions = new ArrayList<>(); MenuTracker(Input input, Tracker tracker) { this.input = input; this.tracker = tracker; } /** * Метод, который заполняет массив */ public void fillActions() { this.actions.add(new AddItem("0", "Add item")); this.actions.add(new ShowItems("1", "Show all items")); this.actions.add(new MenuTracker.EditItem("2", "Edit item")); this.actions.add(new MenuTracker.DeleteItem("3", "Delete item")); this.actions.add(new FindItemById("4", "Find item by id")); this.actions.add(new FindItemsByName("5", "Find items by name")); this.actions.add(new ExitProgram("6", "Exit program")); } public int getLength() { return actions.size(); } /** * создаем внутренние классы на каждое действие с заявкой */ static class AddItem implements UserAction { String key; String info; private final Input input = new ConsoleInput(); private final Tracker tracker = new Tracker(); public AddItem(String key, String info) { this.key = key; this.info = info; } @Override public String key() { return this.key; } @Override public void execute(Input input, Tracker tracker) { System.out.println("-------Добавление новой заявки-------"); String name = input.ask("Введите имя заявки:"); String description = input.ask("Введите описание заявки:"); Item item = new Item(name, tracker.generateId(), description); tracker.add(item); System.out.println("---------Новая заявка с id: " + item.getiD() + "--------"); System.out.println(item.getiD() + " " + item.getName() + " " + item.getDescription()); } @Override public String info() { return String.format("%s %s", this.key, this.info); } } static class ShowItems implements UserAction { String key; String info; private final Input input = new ConsoleInput(); private final Tracker tracker = new Tracker(); public ShowItems(String key, String info) { this.key = key; this.info = info; } @Override public String key() { return this.key; } @Override public void execute(Input input, Tracker tracker) { for (int i = 0; i < tracker.getPosition(); i++) { System.out.println(tracker.getItems()[i].getiD()); System.out.println(tracker.getItems()[i].getName()); System.out.println(tracker.getItems()[i].getDescription()); } } @Override public String info() { return this.info; } } class EditItem implements UserAction { String key; String info; private final Input input = new ConsoleInput(); private final Tracker tracker = new Tracker(); public EditItem(String key, String info) { this.key = key; this.info = info; } @Override public String key() { return this.key; } @Override public void execute(Input input, Tracker tracker) { String id = input.ask("Введите ID заявки"); String name = input.ask("Введите новое имя"); String description = input.ask("Введите новое описание"); Item item = new Item(name, id, description); for (int j = 0; j < tracker.getPosition(); j++) { if (tracker.getItems()[j].getiD().equals(id)) { tracker.getItems()[j] = item; } } } @Override public String info() { return this.info; } } class DeleteItem implements UserAction { String key; String info; private final Input input = new ConsoleInput(); private final Tracker tracker = new Tracker(); public DeleteItem(String key, String info) { this.key = key; this.info = info; } @Override public String key() { return this.key; } @Override public void execute(Input input, Tracker tracker) { String id = input.ask("Введите id заявки, которую хотите удалить"); int position = tracker.getPosition(); for (int j = 0; j < position; j++) { if (tracker.getItems()[j].getiD().equals(id)) { for (int i = j; i < position - 1; i++) { tracker.getItems()[i] = tracker.getItems()[i + 1]; } tracker.getItems()[position - 1] = null; break; } } position--; } @Override public String info() { return this.info; } } static class FindItemById implements UserAction { String key; String info; private final Input input = new ConsoleInput(); private final Tracker tracker = new Tracker(); public FindItemById(String key, String info) { this.key = key; this.info = info; } @Override public String key() { return this.key; } @Override public void execute(Input input, Tracker tracker) { String id = input.ask("Введите ID искомой заявки"); for (int j = 0; j < tracker.getPosition(); j++) { if (tracker.getItems()[j] != null) { if (tracker.getItems()[j].getiD().equals(id)) { System.out.println(tracker.getItems()[j].getiD() + " " + tracker.getItems()[j].getName() + " " + tracker.getItems()[j].getDescription()); } } } } @Override public String info() { return this.info; } } static class FindItemsByName implements UserAction { String key; String info; private final Input input = new ConsoleInput(); private final Tracker tracker = new Tracker(); public FindItemsByName(String key, String info) { this.key = key; this.info = info; } @Override public String key() { return this.key; } @Override public void execute(Input input, Tracker tracker) { String name = input.ask("Введите название искомой заявки"); for (int j = 0; j < tracker.getPosition(); j++) { if (tracker.getItems()[j].getName().equals(name)) { System.out.println(tracker.getItems()[j].getiD() + " " + tracker.getItems()[j].getName() + " " + tracker.getItems()[j].getDescription()); ; } } } @Override public String info() { return this.info; } } static class ExitProgram implements UserAction { String key; String info; private final Input input = new ConsoleInput(); private final Tracker tracker = new Tracker(); public ExitProgram(String key, String info) { this.key = key; this.info = info; } @Override public String key() { return this.key; } @Override public void execute(Input input, Tracker tracker) { exit(0); } @Override public String info() { return this.info; } } /** * Метод в зависимости от ключа выбирает действие * * @param key ключ операции */ public void select(String key) { int value = Integer.parseInt(key); this.actions.get(value).execute(this.input, this.tracker); } public void show() { for (UserAction action : this.actions ) { if (action != null) System.out.println(action.info()); } } public void addAction(UserAction userAction) { this.actions.add(userAction); } }
28.686869
161
0.523357
7278d67af352af3faa27bfdbbc4d64738564b27f
3,244
package Vista; import Modelo.MainObjects.Game; import Vista.Eventos.*; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.control.Label; import javafx.scene.layout.*; import javafx.scene.paint.Paint; import javafx.stage.Stage; public class PrincipalContainer extends BorderPane { private final Stage stage; private final Game game; ApplicationMenuBar menuBar; private ButtonBar buttonBar; private MainContainer mainContainer; private VBox timeVbox; private Label textTime; private Label textSpace; public PrincipalContainer (Stage stage, Game game) { this.game = game; this.stage = stage; textTime = new Label(game.time()); textSpace = new Label(game.getCityName()); textTime.getStyleClass().add("time-label"); textSpace.getStyleClass().add("city-label"); this.setMenu(); this.setCentro(); } private void setMenu() { this.menuBar = new ApplicationMenuBar(stage); this.setTop(menuBar); } private void setCentro() { mainContainer = new MainContainer(this.game, this.stage); buttonBar = new ButtonBar(20); buttonBar.getStyleClass().add("button-box"); mainContainer.setCenter(); mainContainer.setNameTime( getTimeName() ); mainContainer.setCitiesBox(); mainContainer.setFullScreen(); mainContainer.setLeftScreen( getLeftScreen() ); mainContainer.setRightScreen( getScreen()) ; mainContainer.setButtonBar(buttonBar); this.setButtonBarActions(); mainContainer.buildContainer(); this.setCenter(mainContainer); } private VBox getScreen() { VBox screen = new VBox(0); Label cityDescription = new Label(game.getCityDescription()); cityDescription.getStyleClass().add("description-label"); screen.getStyleClass().add("right-screen"); screen.getChildren().add(cityDescription); return screen; } private VBox getTimeName() { timeVbox = new VBox(); timeVbox.getStyleClass().add("time-box"); timeVbox.getChildren().addAll(textSpace, textTime); return timeVbox; } private VBox getLeftScreen() { VBox cityImageBox = new VBox(5); cityImageBox.getStyleClass().add("city-image-box"); String string = ("-fx-background-image: url('/images/cities/" + game.getCityName().replaceAll(" ", "") + ".jpg'" + ");"); cityImageBox.setStyle(string + "-fx-background-repeat: stretch;" + "-fx-background-size: 450 400;" + "-fx-background-position: center center;" ); return cityImageBox; } private void setButtonBarActions() { InvestigateButtonEventHandler investigateButtonEventHandler = new InvestigateButtonEventHandler(game, stage); buttonBar.setInvestigateAction(investigateButtonEventHandler); TravelButtonEventHandler travelButtonEventHandler = new TravelButtonEventHandler(game, stage); buttonBar.setTravelAction(travelButtonEventHandler); EmitWarrantEventHandler emitWarrantEventHandler = new EmitWarrantEventHandler(game, stage); buttonBar.setWarrantAction(emitWarrantEventHandler); } }
35.648352
153
0.681566
b45bc148262aaf23fe503f7734b7902337c4c581
2,980
package dk.dataforsyningen.gsearch; import com.fasterxml.jackson.databind.ObjectMapper; import org.jdbi.v3.core.Jdbi; import org.jdbi.v3.core.mapper.RowMapper; import org.jdbi.v3.core.spi.JdbiPlugin; import org.n52.jackson.datatype.jts.JtsModule; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.jdbc.datasource.DriverManagerDataSource; import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy; import javax.sql.DataSource; import java.sql.SQLException; import java.util.List; @Configuration public class JdbiConfiguration { static Logger logger = LoggerFactory.getLogger(JdbiConfiguration.class); private ResourceTypes resourceTypes = new ResourceTypes(); /** * The SQL data source that Jdbi will connect to. In this example we use an H2 database, but it can be any JDBC-compatible database. * https://jdbi.org/#_spring5 * * @return */ @Bean @ConfigurationProperties(prefix = "spring.datasource") public DataSource driverManagerDataSource() { return new DriverManagerDataSource(); } @Bean public Jdbi jdbi(DataSource ds, List<JdbiPlugin> jdbiPlugins, List<RowMapper<?>> rowMappers) throws SQLException { TransactionAwareDataSourceProxy proxy = new TransactionAwareDataSourceProxy(ds); Jdbi jdbi = Jdbi.create(proxy); determineTypes(jdbi); jdbiPlugins.forEach(plugin -> jdbi.installPlugin(plugin)); // TODO: Maybe this can be used to only register Row mapper once and not every time the getData gets called rowMappers.forEach(mapper -> jdbi.registerRowMapper(mapper)); new Listener(ds, jdbi, this).start(); return jdbi; } @Bean @Primary public ObjectMapper objectMapper() { final ObjectMapper mapper = new ObjectMapper(); mapper.registerModule(new JtsModule()); return mapper; } @Bean public ResourceTypes resourceTypes() { return resourceTypes; } public void determineTypes(Jdbi jdbi) { List<String> types = jdbi.withHandle(handle -> { String sql = "select typname from pg_catalog.pg_type t join pg_catalog.pg_namespace pn on (pn.oid = t.typnamespace) join pg_catalog.pg_class pc on (pc.reltype = t.oid) where pn.nspname = 'api' and pc.relkind = 'c'"; List<String> typnames = handle .createQuery(sql) .mapTo(String.class) .list(); return typnames; }); logger.info("Retrieved api types from database: {}", String.join(",", types)); // TODO: mutate with diff resourceTypes.getTypes().clear(); resourceTypes.getTypes().addAll(types); } }
37.25
227
0.703691