repo_name
stringlengths
6
101
path
stringlengths
4
300
text
stringlengths
7
1.31M
BrightspaceHypermediaComponents/foundation-components
components/activity/list/custom/quiz/lang/de.js
<gh_stars>1-10 /* eslint quotes: 0 */ export default { "points": "{count, plural, one {1 Punkt} other {{count} Punkte}}", "question_selection": "Auswählen von {numQuestions} {numQuestions, plural, =0 {Frage} =1 {Frage} andere {Fragen} von {numChoices} im Wert von jeweils {questionPoints} {questionPoints, plural, =0 {point} =1 {Punkt} other {Punkten}}", "also_in": "Auch in" };
AllBestBets/async-http-client
client/src/main/java/org/asynchttpclient/netty/channel/ConnectionSemaphore.java
/* * Copyright (c) 2017 AsyncHttpClient Project. All rights reserved. * * This program is licensed to you under the Apache License Version 2.0, * and you may not use this file except in compliance with the Apache License Version 2.0. * You may obtain a copy of the Apache License Version 2.0 at * http://www.apache.org/licenses/LICENSE-2.0. * * Unless required by applicable law or agreed to in writing, * software distributed under the Apache License Version 2.0 is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Apache License Version 2.0 for the specific language governing permissions and limitations there under. */ package org.asynchttpclient.netty.channel; import static org.asynchttpclient.util.ThrowableUtil.unknownStackTrace; import java.io.IOException; import java.util.concurrent.ConcurrentHashMap; import org.asynchttpclient.AsyncHttpClientConfig; import org.asynchttpclient.exception.TooManyConnectionsException; import org.asynchttpclient.exception.TooManyConnectionsPerHostException; /** * Max connections and max-per-host connections limiter. * * @author <NAME> */ public class ConnectionSemaphore { public static ConnectionSemaphore newConnectionSemaphore(AsyncHttpClientConfig config) { return config.getMaxConnections() > 0 || config.getMaxConnectionsPerHost() > 0 ? new ConnectionSemaphore(config) : null; } private final int maxTotalConnections; private final NonBlockingSemaphoreLike freeChannels; private final int maxConnectionsPerHost; private final ConcurrentHashMap<Object, NonBlockingSemaphore> freeChannelsPerHost = new ConcurrentHashMap<>(); private final IOException tooManyConnections; private final IOException tooManyConnectionsPerHost; private ConnectionSemaphore(AsyncHttpClientConfig config) { tooManyConnections = unknownStackTrace(new TooManyConnectionsException(config.getMaxConnections()), ConnectionSemaphore.class, "acquireChannelLock"); tooManyConnectionsPerHost = unknownStackTrace(new TooManyConnectionsPerHostException(config.getMaxConnectionsPerHost()), ConnectionSemaphore.class, "acquireChannelLock"); maxTotalConnections = config.getMaxConnections(); maxConnectionsPerHost = config.getMaxConnectionsPerHost(); freeChannels = maxTotalConnections > 0 ? new NonBlockingSemaphore(config.getMaxConnections()) : NonBlockingSemaphoreInfinite.INSTANCE; } private boolean tryAcquireGlobal() { return freeChannels.tryAcquire(); } private NonBlockingSemaphoreLike getFreeConnectionsForHost(Object partitionKey) { return maxConnectionsPerHost > 0 ? freeChannelsPerHost.computeIfAbsent(partitionKey, pk -> new NonBlockingSemaphore(maxConnectionsPerHost)) : NonBlockingSemaphoreInfinite.INSTANCE; } private boolean tryAcquirePerHost(Object partitionKey) { return getFreeConnectionsForHost(partitionKey).tryAcquire(); } public void acquireChannelLock(Object partitionKey) throws IOException { if (!tryAcquireGlobal()) throw tooManyConnections; if (!tryAcquirePerHost(partitionKey)) { freeChannels.release(); throw tooManyConnectionsPerHost; } } public void releaseChannelLock(Object partitionKey) { freeChannels.release(); getFreeConnectionsForHost(partitionKey).release(); } }
terrameijar/bluebottle
bluebottle/time_based/migrations/0043_auto_20201217_0743.py
<reponame>terrameijar/bluebottle<filename>bluebottle/time_based/migrations/0043_auto_20201217_0743.py<gh_stars>1-10 # -*- coding: utf-8 -*- # Generated by Django 1.11.17 on 2020-12-17 06:43 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('time_based', '0042_merge_20201201_1259'), ] operations = [ migrations.AlterModelOptions( name='timecontribution', options={'verbose_name': 'Time contribution', 'verbose_name_plural': 'Contributions'}, ), migrations.AddField( model_name='periodactivity', name='online_meeting_url', field=models.TextField(blank=True, default='', verbose_name='Online Meeting URL'), ), migrations.AlterField( model_name='periodactivity', name='deadline', field=models.DateField(blank=True, null=True, verbose_name='End date'), ), migrations.AlterField( model_name='periodactivity', name='duration', field=models.DurationField(blank=True, null=True, verbose_name='Time per period'), ), migrations.AlterField( model_name='periodactivity', name='duration_period', field=models.CharField(blank=True, choices=[('overall', 'in total'), ('days', 'per day'), ('weeks', 'per week'), ('months', 'per month')], max_length=20, null=True, verbose_name='period'), ), migrations.AlterField( model_name='periodactivity', name='start', field=models.DateField(blank=True, null=True, verbose_name='Start date'), ), migrations.AlterField( model_name='timebasedactivity', name='is_online', field=models.NullBooleanField(choices=[(None, 'Not set yet'), (True, 'Yes, participants can join from anywhere or online'), (False, 'No, enter a location')], default=None, verbose_name='is online'), ), migrations.AlterField( model_name='timebasedactivity', name='registration_deadline', field=models.DateField(blank=True, null=True, verbose_name='registration deadline'), ), ]
dreamsxin/ultimatepp
uppdev/LangInfo/main.cpp
<reponame>dreamsxin/ultimatepp<filename>uppdev/LangInfo/main.cpp #include <Core/Core.h> #include <winnls.h> using namespace Upp; /* Vector<int> lang; static BOOL CALLBACK sEnumLocale(char *locale_string) { LCID lcid = stou(locale_string, NULL, 16); char buffer1[10], buffer2[10]; ::GetLocaleInfo(lcid, LOCALE_SISO639LANGNAME, buffer1, 10); ::GetLocaleInfo(lcid, LOCALE_SISO3166CTRYNAME, buffer2, 10); int language = LNG_(buffer1[0], buffer1[1], buffer2[0], buffer2[1]); String english_name = GetLocaleInfoA(lcid, LOCALE_SENGLANGUAGE); String native_name = GetLocaleInfoW(lcid, LOCALE_SNATIVELANGNAME).ToString(); String s; lang.Add(LNG_(buffer1[0], buffer1[1], buffer2[0], buffer2[1])); s << english_name << '\t' << native_name << '\t'; s.Cat(HIBYTE(lcid)); s.Cat(LOBYTE(lcid)); LOG(AsCString(s, INT_MAX, NULL, ASCSTRING_OCTALHI) << ","); // DDUMP(FormatIntHex(lcid)); return TRUE; } extern int LanguageList[]; extern const char *LanguageInfoList[]; */ CONSOLE_APP_MAIN { // EnumSystemLocales(&sEnumLocale, LCID_SUPPORTED); /* for(int i = 0; i < lang.GetCount(); i++) { String s = LNGAsText(lang[i]); LOG(Format("LNG_('%c','%c','%c','%c'),", s[0], s[1], s[3], s[4])); } */ LanguageInfo lf = GetLanguageInfo(LNG_ENGLISH); lf.day[0] = "Bloody monday"; SetLanguageInfo(LNG_ENGLISH, lf); const int *lng = GetAllLanguages(); int q = 0; while(*lng) { const LanguageInfo& lf = GetLanguageInfo(*lng++); LOG(lf.native_name << ' ' << lf.day[0]); DUMP(lf.Compare("Hovno", "Chleba")); } }
fdgo/utils
configex/configex.go
<reponame>fdgo/utils<filename>configex/configex.go package configex import ( "fmt" "github.com/fsnotify/fsnotify" "github.com/spf13/viper" "log" "os" ) const ( _key = "<KEY>" _iv = "iqK4ey75+IV2Sg!L" ) // InitConfig 读取并解析配置到Config对象 // 没有检查配置是否完整 func InitConfig() { viper.SetConfigFile("config.yaml") viper.AddConfigPath(".") viper.SetConfigType("yaml") err := viper.ReadInConfig() if err != nil { log.Fatal(err) } // 启动时解析出错,程序退出 conf, err := parseConfig() if err != nil { os.Exit(1) } Config = *conf // 当配置文件被修改,自动重新读取 viper.WatchConfig() viper.OnConfigChange(func(event fsnotify.Event) { if event.Op == fsnotify.Write { // 解析出错,拒绝错误的配置 conf, err := parseConfig() if err != nil { return } Config = *conf } }) } // parseConfig 解析并解密配置 func parseConfig() (*config, error) { var conf config // 解析 err := viper.Unmarshal(&conf) if err != nil { log.Fatal(err) return nil, err } //decode := func(str *string) { // if err != nil { // return // } // if *str == "" { // return // } // // var tmpBytes []byte // tmpBytes, err = golibs.AesDecrypt(golibs.HexStringToBytes(*str), []byte(_key), []byte(_iv)) // if err != nil { // return // } // *str = string(tmpBytes) //} decode := func(str *string) { if err != nil { return } if *str == "" { return } var tmpBytes []byte tmpBytes, err = cryptex.Cryptex.Decode([]byte(*str)) if err != nil { return } *str = string(tmpBytes) } decode(&conf.Ding.AuthToken ) decode(&conf.Ding.LoginToken) decode(&conf.Redis.Host ) decode(&conf.DB.Dsn) return &conf, nil } func Decode(plain []byte ) string { crypted, err := cryptex.Cryptex.Decode(plain) if err != nil { fmt.Println(err) return "" } return string(crypted) }
Matt-Crow/GEARSJava
GearsSidescroller/src/main/java/gears/sidescroller/world/tiles/package-info.java
<reponame>Matt-Crow/GEARSJava /** * Tiles serves as part of the static environment of the game world. A TileMap * uses the Flyweight design pattern to render tiles and manage their collisions. * * Future versions will add support for rendering sprites for tiles. * * @see gears.sidescroller.world.tileMaps */ package gears.sidescroller.world.tiles;
makiam/importer-exporter
impexp-vis-plugin/src-gen/main/java/org/collada/_2005/_11/colladaschema/GlslSetparam.java
// // Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.1 generiert // Siehe <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // Änderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. // Generiert: 2018.11.18 um 03:45:53 PM CET // package org.collada._2005._11.colladaschema; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlList; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * <p>Java-Klasse für glsl_setparam complex type. * * <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist. * * <pre> * &lt;complexType name="glsl_setparam"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="annotate" type="{http://www.collada.org/2005/11/COLLADASchema}fx_annotate_common" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;choice&gt; * &lt;group ref="{http://www.collada.org/2005/11/COLLADASchema}glsl_param_type"/&gt; * &lt;element name="array" type="{http://www.collada.org/2005/11/COLLADASchema}glsl_setarray_type"/&gt; * &lt;/choice&gt; * &lt;/sequence&gt; * &lt;attribute name="ref" use="required" type="{http://www.collada.org/2005/11/COLLADASchema}glsl_identifier" /&gt; * &lt;attribute name="program" type="{http://www.w3.org/2001/XMLSchema}NCName" /&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "glsl_setparam", propOrder = { "annotate", "bool", "bool2", "bool3", "bool4", "_float", "float2", "float3", "float4", "float2X2", "float3X3", "float4X4", "_int", "int2", "int3", "int4", "surface", "sampler1D", "sampler2D", "sampler3D", "samplerCUBE", "samplerRECT", "samplerDEPTH", "_enum", "array" }) public class GlslSetparam { protected List<FxAnnotateCommon> annotate; protected Boolean bool; @XmlList @XmlElement(type = Boolean.class) protected List<Boolean> bool2; @XmlList @XmlElement(type = Boolean.class) protected List<Boolean> bool3; @XmlList @XmlElement(type = Boolean.class) protected List<Boolean> bool4; @XmlElement(name = "float") protected Float _float; @XmlList @XmlElement(type = Float.class) protected List<Float> float2; @XmlList @XmlElement(type = Float.class) protected List<Float> float3; @XmlList @XmlElement(type = Float.class) protected List<Float> float4; @XmlList @XmlElement(name = "float2x2", type = Float.class) protected List<Float> float2X2; @XmlList @XmlElement(name = "float3x3", type = Float.class) protected List<Float> float3X3; @XmlList @XmlElement(name = "float4x4", type = Float.class) protected List<Float> float4X4; @XmlElement(name = "int") protected Integer _int; @XmlList @XmlElement(type = Integer.class) protected List<Integer> int2; @XmlList @XmlElement(type = Integer.class) protected List<Integer> int3; @XmlList @XmlElement(type = Integer.class) protected List<Integer> int4; protected GlslSurfaceType surface; protected GlSampler1D sampler1D; protected GlSampler2D sampler2D; protected GlSampler3D sampler3D; protected GlSamplerCUBE samplerCUBE; protected GlSamplerRECT samplerRECT; protected GlSamplerDEPTH samplerDEPTH; @XmlElement(name = "enum") protected String _enum; protected GlslSetarrayType array; @XmlAttribute(name = "ref", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String ref; @XmlAttribute(name = "program") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NCName") protected String program; /** * Gets the value of the annotate property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the annotate property. * * <p> * For example, to add a new item, do as follows: * <pre> * getAnnotate().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link FxAnnotateCommon } * * */ public List<FxAnnotateCommon> getAnnotate() { if (annotate == null) { annotate = new ArrayList<FxAnnotateCommon>(); } return this.annotate; } public boolean isSetAnnotate() { return ((this.annotate!= null)&&(!this.annotate.isEmpty())); } public void unsetAnnotate() { this.annotate = null; } /** * Ruft den Wert der bool-Eigenschaft ab. * * @return * possible object is * {@link Boolean } * */ public Boolean isBool() { return bool; } /** * Legt den Wert der bool-Eigenschaft fest. * * @param value * allowed object is * {@link Boolean } * */ public void setBool(Boolean value) { this.bool = value; } public boolean isSetBool() { return (this.bool!= null); } /** * Gets the value of the bool2 property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the bool2 property. * * <p> * For example, to add a new item, do as follows: * <pre> * getBool2().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Boolean } * * */ public List<Boolean> getBool2() { if (bool2 == null) { bool2 = new ArrayList<Boolean>(); } return this.bool2; } public boolean isSetBool2() { return ((this.bool2 != null)&&(!this.bool2 .isEmpty())); } public void unsetBool2() { this.bool2 = null; } /** * Gets the value of the bool3 property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the bool3 property. * * <p> * For example, to add a new item, do as follows: * <pre> * getBool3().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Boolean } * * */ public List<Boolean> getBool3() { if (bool3 == null) { bool3 = new ArrayList<Boolean>(); } return this.bool3; } public boolean isSetBool3() { return ((this.bool3 != null)&&(!this.bool3 .isEmpty())); } public void unsetBool3() { this.bool3 = null; } /** * Gets the value of the bool4 property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the bool4 property. * * <p> * For example, to add a new item, do as follows: * <pre> * getBool4().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Boolean } * * */ public List<Boolean> getBool4() { if (bool4 == null) { bool4 = new ArrayList<Boolean>(); } return this.bool4; } public boolean isSetBool4() { return ((this.bool4 != null)&&(!this.bool4 .isEmpty())); } public void unsetBool4() { this.bool4 = null; } /** * Ruft den Wert der float-Eigenschaft ab. * * @return * possible object is * {@link Float } * */ public Float getFloat() { return _float; } /** * Legt den Wert der float-Eigenschaft fest. * * @param value * allowed object is * {@link Float } * */ public void setFloat(Float value) { this._float = value; } public boolean isSetFloat() { return (this._float!= null); } /** * Gets the value of the float2 property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the float2 property. * * <p> * For example, to add a new item, do as follows: * <pre> * getFloat2().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Float } * * */ public List<Float> getFloat2() { if (float2 == null) { float2 = new ArrayList<Float>(); } return this.float2; } public boolean isSetFloat2() { return ((this.float2 != null)&&(!this.float2 .isEmpty())); } public void unsetFloat2() { this.float2 = null; } /** * Gets the value of the float3 property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the float3 property. * * <p> * For example, to add a new item, do as follows: * <pre> * getFloat3().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Float } * * */ public List<Float> getFloat3() { if (float3 == null) { float3 = new ArrayList<Float>(); } return this.float3; } public boolean isSetFloat3() { return ((this.float3 != null)&&(!this.float3 .isEmpty())); } public void unsetFloat3() { this.float3 = null; } /** * Gets the value of the float4 property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the float4 property. * * <p> * For example, to add a new item, do as follows: * <pre> * getFloat4().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Float } * * */ public List<Float> getFloat4() { if (float4 == null) { float4 = new ArrayList<Float>(); } return this.float4; } public boolean isSetFloat4() { return ((this.float4 != null)&&(!this.float4 .isEmpty())); } public void unsetFloat4() { this.float4 = null; } /** * Gets the value of the float2X2 property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the float2X2 property. * * <p> * For example, to add a new item, do as follows: * <pre> * getFloat2X2().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Float } * * */ public List<Float> getFloat2X2() { if (float2X2 == null) { float2X2 = new ArrayList<Float>(); } return this.float2X2; } public boolean isSetFloat2X2() { return ((this.float2X2 != null)&&(!this.float2X2 .isEmpty())); } public void unsetFloat2X2() { this.float2X2 = null; } /** * Gets the value of the float3X3 property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the float3X3 property. * * <p> * For example, to add a new item, do as follows: * <pre> * getFloat3X3().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Float } * * */ public List<Float> getFloat3X3() { if (float3X3 == null) { float3X3 = new ArrayList<Float>(); } return this.float3X3; } public boolean isSetFloat3X3() { return ((this.float3X3 != null)&&(!this.float3X3 .isEmpty())); } public void unsetFloat3X3() { this.float3X3 = null; } /** * Gets the value of the float4X4 property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the float4X4 property. * * <p> * For example, to add a new item, do as follows: * <pre> * getFloat4X4().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Float } * * */ public List<Float> getFloat4X4() { if (float4X4 == null) { float4X4 = new ArrayList<Float>(); } return this.float4X4; } public boolean isSetFloat4X4() { return ((this.float4X4 != null)&&(!this.float4X4 .isEmpty())); } public void unsetFloat4X4() { this.float4X4 = null; } /** * Ruft den Wert der int-Eigenschaft ab. * * @return * possible object is * {@link Integer } * */ public Integer getInt() { return _int; } /** * Legt den Wert der int-Eigenschaft fest. * * @param value * allowed object is * {@link Integer } * */ public void setInt(Integer value) { this._int = value; } public boolean isSetInt() { return (this._int!= null); } /** * Gets the value of the int2 property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the int2 property. * * <p> * For example, to add a new item, do as follows: * <pre> * getInt2().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Integer } * * */ public List<Integer> getInt2() { if (int2 == null) { int2 = new ArrayList<Integer>(); } return this.int2; } public boolean isSetInt2() { return ((this.int2 != null)&&(!this.int2 .isEmpty())); } public void unsetInt2() { this.int2 = null; } /** * Gets the value of the int3 property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the int3 property. * * <p> * For example, to add a new item, do as follows: * <pre> * getInt3().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Integer } * * */ public List<Integer> getInt3() { if (int3 == null) { int3 = new ArrayList<Integer>(); } return this.int3; } public boolean isSetInt3() { return ((this.int3 != null)&&(!this.int3 .isEmpty())); } public void unsetInt3() { this.int3 = null; } /** * Gets the value of the int4 property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the int4 property. * * <p> * For example, to add a new item, do as follows: * <pre> * getInt4().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Integer } * * */ public List<Integer> getInt4() { if (int4 == null) { int4 = new ArrayList<Integer>(); } return this.int4; } public boolean isSetInt4() { return ((this.int4 != null)&&(!this.int4 .isEmpty())); } public void unsetInt4() { this.int4 = null; } /** * Ruft den Wert der surface-Eigenschaft ab. * * @return * possible object is * {@link GlslSurfaceType } * */ public GlslSurfaceType getSurface() { return surface; } /** * Legt den Wert der surface-Eigenschaft fest. * * @param value * allowed object is * {@link GlslSurfaceType } * */ public void setSurface(GlslSurfaceType value) { this.surface = value; } public boolean isSetSurface() { return (this.surface!= null); } /** * Ruft den Wert der sampler1D-Eigenschaft ab. * * @return * possible object is * {@link GlSampler1D } * */ public GlSampler1D getSampler1D() { return sampler1D; } /** * Legt den Wert der sampler1D-Eigenschaft fest. * * @param value * allowed object is * {@link GlSampler1D } * */ public void setSampler1D(GlSampler1D value) { this.sampler1D = value; } public boolean isSetSampler1D() { return (this.sampler1D!= null); } /** * Ruft den Wert der sampler2D-Eigenschaft ab. * * @return * possible object is * {@link GlSampler2D } * */ public GlSampler2D getSampler2D() { return sampler2D; } /** * Legt den Wert der sampler2D-Eigenschaft fest. * * @param value * allowed object is * {@link GlSampler2D } * */ public void setSampler2D(GlSampler2D value) { this.sampler2D = value; } public boolean isSetSampler2D() { return (this.sampler2D!= null); } /** * Ruft den Wert der sampler3D-Eigenschaft ab. * * @return * possible object is * {@link GlSampler3D } * */ public GlSampler3D getSampler3D() { return sampler3D; } /** * Legt den Wert der sampler3D-Eigenschaft fest. * * @param value * allowed object is * {@link GlSampler3D } * */ public void setSampler3D(GlSampler3D value) { this.sampler3D = value; } public boolean isSetSampler3D() { return (this.sampler3D!= null); } /** * Ruft den Wert der samplerCUBE-Eigenschaft ab. * * @return * possible object is * {@link GlSamplerCUBE } * */ public GlSamplerCUBE getSamplerCUBE() { return samplerCUBE; } /** * Legt den Wert der samplerCUBE-Eigenschaft fest. * * @param value * allowed object is * {@link GlSamplerCUBE } * */ public void setSamplerCUBE(GlSamplerCUBE value) { this.samplerCUBE = value; } public boolean isSetSamplerCUBE() { return (this.samplerCUBE!= null); } /** * Ruft den Wert der samplerRECT-Eigenschaft ab. * * @return * possible object is * {@link GlSamplerRECT } * */ public GlSamplerRECT getSamplerRECT() { return samplerRECT; } /** * Legt den Wert der samplerRECT-Eigenschaft fest. * * @param value * allowed object is * {@link GlSamplerRECT } * */ public void setSamplerRECT(GlSamplerRECT value) { this.samplerRECT = value; } public boolean isSetSamplerRECT() { return (this.samplerRECT!= null); } /** * Ruft den Wert der samplerDEPTH-Eigenschaft ab. * * @return * possible object is * {@link GlSamplerDEPTH } * */ public GlSamplerDEPTH getSamplerDEPTH() { return samplerDEPTH; } /** * Legt den Wert der samplerDEPTH-Eigenschaft fest. * * @param value * allowed object is * {@link GlSamplerDEPTH } * */ public void setSamplerDEPTH(GlSamplerDEPTH value) { this.samplerDEPTH = value; } public boolean isSetSamplerDEPTH() { return (this.samplerDEPTH!= null); } /** * Ruft den Wert der enum-Eigenschaft ab. * * @return * possible object is * {@link String } * */ public String getEnum() { return _enum; } /** * Legt den Wert der enum-Eigenschaft fest. * * @param value * allowed object is * {@link String } * */ public void setEnum(String value) { this._enum = value; } public boolean isSetEnum() { return (this._enum!= null); } /** * Ruft den Wert der array-Eigenschaft ab. * * @return * possible object is * {@link GlslSetarrayType } * */ public GlslSetarrayType getArray() { return array; } /** * Legt den Wert der array-Eigenschaft fest. * * @param value * allowed object is * {@link GlslSetarrayType } * */ public void setArray(GlslSetarrayType value) { this.array = value; } public boolean isSetArray() { return (this.array!= null); } /** * Ruft den Wert der ref-Eigenschaft ab. * * @return * possible object is * {@link String } * */ public String getRef() { return ref; } /** * Legt den Wert der ref-Eigenschaft fest. * * @param value * allowed object is * {@link String } * */ public void setRef(String value) { this.ref = value; } public boolean isSetRef() { return (this.ref!= null); } /** * Ruft den Wert der program-Eigenschaft ab. * * @return * possible object is * {@link String } * */ public String getProgram() { return program; } /** * Legt den Wert der program-Eigenschaft fest. * * @param value * allowed object is * {@link String } * */ public void setProgram(String value) { this.program = value; } public boolean isSetProgram() { return (this.program!= null); } public void setAnnotate(List<FxAnnotateCommon> value) { this.annotate = value; } public void setBool2(List<Boolean> value) { this.bool2 = value; } public void setBool3(List<Boolean> value) { this.bool3 = value; } public void setBool4(List<Boolean> value) { this.bool4 = value; } public void setFloat2(List<Float> value) { this.float2 = value; } public void setFloat3(List<Float> value) { this.float3 = value; } public void setFloat4(List<Float> value) { this.float4 = value; } public void setFloat2X2(List<Float> value) { this.float2X2 = value; } public void setFloat3X3(List<Float> value) { this.float3X3 = value; } public void setFloat4X4(List<Float> value) { this.float4X4 = value; } public void setInt2(List<Integer> value) { this.int2 = value; } public void setInt3(List<Integer> value) { this.int3 = value; } public void setInt4(List<Integer> value) { this.int4 = value; } }
frc5024/BaseBot
docs/html/navtreeindex0.js
<gh_stars>0 var NAVTREEINDEX0 = { "DriveTrain_8cpp.html":[2,0,0,0,0,1,0], "DriveTrain_8cpp_source.html":[2,0,0,0,0,1,0], "DriveTrain_8h.html":[2,0,0,0,1,1,0], "DriveTrain_8h_source.html":[2,0,0,0,1,1,0], "DriveWithJoystick_8cpp.html":[2,0,0,0,0,0,0], "DriveWithJoystick_8cpp_source.html":[2,0,0,0,0,0,0], "DriveWithJoystick_8h.html":[2,0,0,0,1,0,0], "DriveWithJoystick_8h_source.html":[2,0,0,0,1,0,0], "OI_8cpp.html":[2,0,0,0,0,2], "OI_8cpp_source.html":[2,0,0,0,0,2], "OI_8h.html":[2,0,0,0,1,2], "OI_8h_source.html":[2,0,0,0,1,2], "RobotMap_8h.html":[2,0,0,0,1,4], "RobotMap_8h.html#a06ff4c1b825f2b61a5dcdc5e5bae9ea9":[2,0,0,0,1,4,12], "RobotMap_8h.html#a1c626b8a3c165a1100790b0b4b84a1b8":[2,0,0,0,1,4,14], "RobotMap_8h.html#a306ebd41c0cd1303b1372c6153f0caf8":[2,0,0,0,1,4,10], "RobotMap_8h.html#a536da5a9011e776134af73232c4b3ce2":[2,0,0,0,1,4,9], "RobotMap_8h.html#a68427b547613236bec20a86d04321cbc":[2,0,0,0,1,4,6], "RobotMap_8h.html#a743c19e1786a80e59de71c354cbecd91":[2,0,0,0,1,4,2], "RobotMap_8h.html#a93ee73d141525c1decc8dd63f205cbe4":[2,0,0,0,1,4,0], "RobotMap_8h.html#aa5e3aaf4231c5fef44403d724c5bb3d1":[2,0,0,0,1,4,7], "RobotMap_8h.html#aa60cd274aa644c7ba071e8caf906c06d":[2,0,0,0,1,4,3], "RobotMap_8h.html#ab53fe26a24673fbfd067b86d7c63fd5a":[2,0,0,0,1,4,1], "RobotMap_8h.html#abad1c5fc99c931209ad7447c73315b22":[2,0,0,0,1,4,4], "RobotMap_8h.html#acf7d7096f3e7e2ad84975e03d61be9b6":[2,0,0,0,1,4,8], "RobotMap_8h.html#add3ca9eefe3b5b754426f51d3043e579":[2,0,0,0,1,4,11], "RobotMap_8h.html#aef0db07128cdb05d2eeea784a1642ed5":[2,0,0,0,1,4,13], "RobotMap_8h.html#afd29e653ec7c8c9b7e49b75e7a2a1278":[2,0,0,0,1,4,5], "RobotMap_8h_source.html":[2,0,0,0,1,4], "Robot_8cpp.html":[2,0,0,0,0,3], "Robot_8cpp_source.html":[2,0,0,0,0,3], "Robot_8h.html":[2,0,0,0,1,3], "Robot_8h_source.html":[2,0,0,0,1,3], "annotated.html":[1,0], "classDriveTrain.html":[1,0,0], "classDriveTrain.html#a2298f9c2466c92b790c33bb5840664c9":[1,0,0,7], "classDriveTrain.html#a33a1f6f57affe0cea1184357bbccfd07":[1,0,0,5], "classDriveTrain.html#a6a4f2dceef2730b2cded41f143e90037":[1,0,0,3], "classDriveTrain.html#a90af56eee49c93d5b7d77065b42f660b":[1,0,0,0], "classDriveTrain.html#a999d090ed884fc00d23d294b33120938":[1,0,0,2], "classDriveTrain.html#abede5f4bb190b30133f496c6742c6eac":[1,0,0,8], "classDriveTrain.html#acb66db7164b520869682a90d73be9c78":[1,0,0,6], "classDriveTrain.html#aee63999ae98aa26e4c2866444eab2c4a":[1,0,0,1], "classDriveTrain.html#afb83a3f5cedd6d9d293edbc07f12b47a":[1,0,0,4], "classDriveWithJoystick.html":[1,0,1], "classDriveWithJoystick.html#a11d7c09c5a0bced3aa504c775cb9d7e3":[1,0,1,8], "classDriveWithJoystick.html#a245e42eb207a58cdb64749f01965fa7d":[1,0,1,10], "classDriveWithJoystick.html#a2e4024301ad7c5bd5c43f968fb24ae93":[1,0,1,12], "classDriveWithJoystick.html#a629524dff7b0a940175d5995c0511cdb":[1,0,1,5], "classDriveWithJoystick.html#a6671b39344988d14a6ff12939b09238e":[1,0,1,9], "classDriveWithJoystick.html#a87ceb621790dae15f245fa6b559202ee":[1,0,1,7], "classDriveWithJoystick.html#a8cf3328b991790b93c6615116f7c0434":[1,0,1,1], "classDriveWithJoystick.html#a935d764b236fea53dc9335ad82840442":[1,0,1,11], "classDriveWithJoystick.html#a9838eb31b2afee384b26e3a9c764b4ca":[1,0,1,4], "classDriveWithJoystick.html#ad71ea9e372b00ece4b89acaa93290b96":[1,0,1,3], "classDriveWithJoystick.html#ae47c234f069c5f4d5004dba287f47e7b":[1,0,1,2], "classDriveWithJoystick.html#aec663d65d48661b956e8db0011092140":[1,0,1,0], "classDriveWithJoystick.html#aeeb849dde20c9b7b8049eb318e7b5d90":[1,0,1,6], "classOI.html":[1,0,2], "classOI.html#a3063072af8d1fe9c59b674e8498ef0ae":[1,0,2,3], "classOI.html#a41cf0361ed435447b69562e79addf35c":[1,0,2,2], "classOI.html#a77c2c4630ca19e64a7885154f3dc202f":[1,0,2,0], "classOI.html#a9facc170b5ac69ea63eda4ceabe4d12e":[1,0,2,1], "classOI.html#ab79eb664ad1895f9c5ab5a1b17ae60eb":[1,0,2,4], "classRobot.html":[1,0,3], "classRobot.html#a0d613b6f1c4ab6d5f809f1642207b3d6":[1,0,3,12], "classRobot.html#a2136cfc015936285218c8a8db984d6bc":[1,0,3,0], "classRobot.html#a324322627c63b3870daf7c7ddc5bea63":[1,0,3,7], "classRobot.html#a5eca8a1e1f5dd2841641c25874141abd":[1,0,3,10], "classRobot.html#a66f23dae271748d525cf3ab046375f79":[1,0,3,4], "classRobot.html#a810e6143a208a6314491366e3c714357":[1,0,3,2], "classRobot.html#a8c7309f5f1cb242ea8c74f1abf03b540":[1,0,3,3], "classRobot.html#a8fad82c2250bcfb83b743b5c0dd6ed27":[1,0,3,5], "classRobot.html#aa3e246794bfbbb4406fc87f351762038":[1,0,3,6], "classRobot.html#aa73b63ec078b50244672b38e6ef2f506":[1,0,3,11], "classRobot.html#ac11143dd674e0e02fef5329e2df24830":[1,0,3,1], "classRobot.html#ae8ed06b4ce167235e06332a3463d5399":[1,0,3,9], "classRobot.html#af0ac44a962e609e9b042285e699d1db8":[1,0,3,8], "classes.html":[1,1], "dir_1c9150798a8a01c1856270addf08aa3f.html":[2,0,0,0,0,1], "dir_5eb159725f84c66aafd839904a4acdd0.html":[2,0,0,0], "dir_68267d1309a1af8e8297ef4c3efbcdba.html":[2,0,0], "dir_722972e7b214f0021fb9fa10ce7918e4.html":[2,0,0,0,1,1], "dir_cc1209c02c45230b6482516732d65751.html":[2,0,0,0,1,0], "dir_df3bee86fdbfb464c3a94507855b0bdc.html":[2,0,0,0,1], "dir_fdf2b31f12d3ebb2f617242d0514024b.html":[2,0,0,0,0], "dir_ff0fdd6c96bdbf1651934ed8e530538f.html":[2,0,0,0,0,0], "files.html":[2,0], "functions.html":[1,3,0], "functions_func.html":[1,3,1], "functions_vars.html":[1,3,2], "globals.html":[2,1,0], "globals_defs.html":[2,1,1], "hierarchy.html":[1,2], "index.html":[0], "index.html":[], "pages.html":[] };
RomaKoks/druid
processing/src/test/java/org/apache/druid/query/groupby/having/DimFilterHavingSpecTest.java
<gh_stars>1000+ /* * 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.druid.query.groupby.having; import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.granularity.Granularities; import org.apache.druid.query.dimension.DefaultDimensionSpec; import org.apache.druid.query.filter.SelectorDimFilter; import org.apache.druid.query.groupby.GroupByQuery; import org.apache.druid.query.groupby.ResultRow; import org.apache.druid.segment.column.ColumnType; import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.internal.matchers.ThrowableMessageMatcher; import org.junit.rules.ExpectedException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; public class DimFilterHavingSpecTest { @Rule public ExpectedException expectedException = ExpectedException.none(); @Test public void testSimple() { final DimFilterHavingSpec havingSpec = new DimFilterHavingSpec(new SelectorDimFilter("foo", "bar", null), null); havingSpec.setQuery( GroupByQuery.builder() .setDataSource("dummy") .setInterval("1000/3000") .setDimensions(DefaultDimensionSpec.of("foo")) .setGranularity(Granularities.ALL) .build() ); Assert.assertTrue(havingSpec.eval(ResultRow.of("bar"))); Assert.assertFalse(havingSpec.eval(ResultRow.of("baz"))); } @Test public void testRowSignature() { final DimFilterHavingSpec havingSpec = new DimFilterHavingSpec(new SelectorDimFilter("foo", "1", null), null); havingSpec.setQuery( GroupByQuery.builder() .setDataSource("dummy") .setInterval("1000/3000") .setGranularity(Granularities.ALL) .setDimensions(new DefaultDimensionSpec("foo", "foo", ColumnType.LONG)) .build() ); Assert.assertTrue(havingSpec.eval(ResultRow.of(1L))); Assert.assertFalse(havingSpec.eval(ResultRow.of(2L))); } @Test(timeout = 60_000L) @Ignore // Doesn't always pass. The check in "eval" is best effort and not guaranteed to detect concurrent usage. public void testConcurrentUsage() throws Exception { final ExecutorService exec = Executors.newFixedThreadPool(2); final DimFilterHavingSpec havingSpec = new DimFilterHavingSpec(new SelectorDimFilter("foo", "1", null), null); final List<Future<?>> futures = new ArrayList<>(); for (int i = 0; i < 2; i++) { final ResultRow row = ResultRow.of(String.valueOf(i)); futures.add( exec.submit( () -> { havingSpec.setQuery(GroupByQuery.builder().setDimensions(DefaultDimensionSpec.of("foo")).build()); while (!Thread.interrupted()) { havingSpec.eval(row); } } ) ); } expectedException.expect(ExecutionException.class); expectedException.expectCause(CoreMatchers.<IllegalStateException>instanceOf(IllegalStateException.class)); expectedException.expectCause( ThrowableMessageMatcher.hasMessage(CoreMatchers.containsString("concurrent 'eval' calls not permitted")) ); try { for (Future<?> future : futures) { future.get(); } } finally { exec.shutdownNow(); } // Not reached Assert.assertTrue(false); } @Test public void testSerde() throws Exception { final DimFilterHavingSpec havingSpec = new DimFilterHavingSpec(new SelectorDimFilter("foo", "1", null), false); final ObjectMapper objectMapper = new DefaultObjectMapper(); Assert.assertEquals( havingSpec, objectMapper.readValue(objectMapper.writeValueAsBytes(havingSpec), HavingSpec.class) ); } }
greck2908/libflame
src/base/flamec/supermatrix/gpu/main/FLASH_Queue_gpu.c
<reponame>greck2908/libflame /* Copyright (C) 2014, The University of Texas at Austin This file is part of libflame and is available under the 3-Clause BSD license, which can be found in the LICENSE file at the top-level directory, or at http://opensource.org/licenses/BSD-3-Clause */ #include "FLAME.h" #ifdef FLA_ENABLE_GPU #include "cublas.h" static FLA_Bool flash_queue_enabled_gpu = FALSE; static dim_t flash_queue_gpu_n_blocks = 128; void FLASH_Queue_init_gpu( void ) /*---------------------------------------------------------------------------- FLASH_Queue_init_gpu ----------------------------------------------------------------------------*/ { cublasInit(); return; } void FLASH_Queue_finalize_gpu( void ) /*---------------------------------------------------------------------------- FLASH_Queue_finalize_gpu ----------------------------------------------------------------------------*/ { cublasShutdown(); return; } FLA_Error FLASH_Queue_enable_gpu( void ) /*---------------------------------------------------------------------------- FLASH_Queue_enable_gpu ----------------------------------------------------------------------------*/ { if ( FLASH_Queue_stack_depth() == 0 && FLASH_Queue_get_enabled() ) { // Enable if not begin parallel region yet and SuperMatrix is enabled. flash_queue_enabled_gpu = TRUE; return FLA_SUCCESS; } else { // Cannot change status during parallel region. return FLA_FAILURE; } } FLA_Error FLASH_Queue_disable_gpu( void ) /*---------------------------------------------------------------------------- FLASH_Queue_disable_gpu ----------------------------------------------------------------------------*/ { if ( FLASH_Queue_stack_depth() == 0 ) { // Disable if not begin parallel region yet. flash_queue_enabled_gpu = FALSE; return FLA_SUCCESS; } else { // Cannot change status during parallel region. return FLA_FAILURE; } } FLA_Bool FLASH_Queue_get_enabled_gpu( void ) /*---------------------------------------------------------------------------- FLASH_Queue_get_enabled_gpu ----------------------------------------------------------------------------*/ { // Return if SuperMatrix is enabled, but always false if not. if ( FLASH_Queue_get_enabled() ) return flash_queue_enabled_gpu; else return FALSE; } void FLASH_Queue_set_gpu_num_blocks( dim_t n_blocks ) /*---------------------------------------------------------------------------- FLASH_Queue_set_gpu_num_blocks ----------------------------------------------------------------------------*/ { flash_queue_gpu_n_blocks = n_blocks; return; } dim_t FLASH_Queue_get_gpu_num_blocks( void ) /*---------------------------------------------------------------------------- FLASH_Queue_get_gpu_num_blocks ----------------------------------------------------------------------------*/ { return flash_queue_gpu_n_blocks; } // --- helper functions --- =================================================== FLA_Error FLASH_Queue_bind_gpu( integer thread ) /*---------------------------------------------------------------------------- FLASH_Queue_bind_gpu ----------------------------------------------------------------------------*/ { // Bind a GPU to this thread. cudaSetDevice( thread ); return FLA_SUCCESS; } FLA_Error FLASH_Queue_alloc_gpu( dim_t size, FLA_Datatype datatype, void** buffer_gpu ) /*---------------------------------------------------------------------------- FLASH_Queue_alloc_gpu ----------------------------------------------------------------------------*/ { cublasStatus status; // Allocate memory for a block on GPU. status = cublasAlloc( size, FLA_Obj_datatype_size( datatype ), buffer_gpu ); // Check to see if the allocation was successful. if ( status != CUBLAS_STATUS_SUCCESS ) FLA_Check_error_code( FLA_MALLOC_GPU_RETURNED_NULL_POINTER ); return FLA_SUCCESS; } FLA_Error FLASH_Queue_free_gpu( void* buffer_gpu ) /*---------------------------------------------------------------------------- FLASH_Queue_free_gpu ----------------------------------------------------------------------------*/ { // Free memory for a block on GPU. cublasFree( buffer_gpu ); return FLA_SUCCESS; } FLA_Error FLASH_Queue_write_gpu( FLA_Obj obj, void* buffer_gpu ) /*---------------------------------------------------------------------------- FLASH_Queue_write_gpu ----------------------------------------------------------------------------*/ { // Write the contents of a block in main memory to GPU. cublasSetMatrix( FLA_Obj_length( obj ), FLA_Obj_width( obj ), FLA_Obj_datatype_size( FLA_Obj_datatype( obj ) ), FLA_Obj_buffer_at_view( obj ), FLA_Obj_col_stride( obj ), buffer_gpu, FLA_Obj_length( obj ) ); return FLA_SUCCESS; } FLA_Error FLASH_Queue_read_gpu( FLA_Obj obj, void* buffer_gpu ) /*---------------------------------------------------------------------------- FLASH_Queue_read_gpu ----------------------------------------------------------------------------*/ { // Read the memory of a block on GPU to main memory. cublasGetMatrix( FLA_Obj_length( obj ), FLA_Obj_width( obj ), FLA_Obj_datatype_size( FLA_Obj_datatype( obj ) ), buffer_gpu, FLA_Obj_length( obj ), FLA_Obj_buffer_at_view( obj ), FLA_Obj_col_stride( obj ) ); return FLA_SUCCESS; } void FLASH_Queue_exec_task_gpu( FLASH_Task* t, void** input_arg, void** output_arg ) /*---------------------------------------------------------------------------- FLASH_Queue_exec_task_gpu ----------------------------------------------------------------------------*/ { // Define local function pointer types. // Level-3 BLAS typedef FLA_Error(*flash_gemm_gpu_p)(FLA_Trans transa, FLA_Trans transb, FLA_Obj alpha, FLA_Obj A, void* A_gpu, FLA_Obj B, void* B_gpu, FLA_Obj beta, FLA_Obj C, void* C_gpu); typedef FLA_Error(*flash_hemm_gpu_p)(FLA_Side side, FLA_Uplo uplo, FLA_Obj alpha, FLA_Obj A, void* A_gpu, FLA_Obj B, void* B_gpu, FLA_Obj beta, FLA_Obj C, void* C_gpu); typedef FLA_Error(*flash_herk_gpu_p)(FLA_Uplo uplo, FLA_Trans transa, FLA_Obj alpha, FLA_Obj A, void* A_gpu, FLA_Obj beta, FLA_Obj C, void* C_gpu); typedef FLA_Error(*flash_her2k_gpu_p)(FLA_Uplo uplo, FLA_Trans transa, FLA_Obj alpha, FLA_Obj A, void* A_gpu, FLA_Obj B, void* B_gpu, FLA_Obj beta, FLA_Obj C, void* C_gpu); typedef FLA_Error(*flash_symm_gpu_p)(FLA_Side side, FLA_Uplo uplo, FLA_Obj alpha, FLA_Obj A, void* A_gpu, FLA_Obj B, void* B_gpu, FLA_Obj beta, FLA_Obj C, void* C_gpu); typedef FLA_Error(*flash_syrk_gpu_p)(FLA_Uplo uplo, FLA_Trans transa, FLA_Obj alpha, FLA_Obj A, void* A_gpu, FLA_Obj beta, FLA_Obj C, void* C_gpu); typedef FLA_Error(*flash_syr2k_gpu_p)(FLA_Uplo uplo, FLA_Trans transa, FLA_Obj alpha, FLA_Obj A, void* A_gpu, FLA_Obj B, void* B_gpu, FLA_Obj beta, FLA_Obj C, void* C_gpu); typedef FLA_Error(*flash_trmm_gpu_p)(FLA_Side side, FLA_Uplo uplo, FLA_Trans trans, FLA_Diag diag, FLA_Obj alpha, FLA_Obj A, void* A_gpu, FLA_Obj C, void* C_gpu); typedef FLA_Error(*flash_trsm_gpu_p)(FLA_Side side, FLA_Uplo uplo, FLA_Trans trans, FLA_Diag diag, FLA_Obj alpha, FLA_Obj A, void* A_gpu, FLA_Obj C, void* C_gpu); // Level-2 BLAS typedef FLA_Error(*flash_gemv_gpu_p)(FLA_Trans transa, FLA_Obj alpha, FLA_Obj A, void* A_gpu, FLA_Obj x, void* x_gpu, FLA_Obj beta, FLA_Obj y, void* y_gpu); typedef FLA_Error(*flash_trsv_gpu_p)(FLA_Uplo uplo, FLA_Trans trans, FLA_Diag diag, FLA_Obj A, void* A_gpu, FLA_Obj x, void* x_gpu); // Level-1 BLAS typedef FLA_Error(*flash_axpy_gpu_p)(FLA_Obj alpha, FLA_Obj A, void* A_gpu, FLA_Obj B, void* B_gpu); typedef FLA_Error(*flash_copy_gpu_p)(FLA_Obj A, void* A_gpu, FLA_Obj B, void* B_gpu); typedef FLA_Error(*flash_scal_gpu_p)(FLA_Obj alpha, FLA_Obj A, void* A_gpu); typedef FLA_Error(*flash_scalr_gpu_p)(FLA_Uplo uplo, FLA_Obj alpha, FLA_Obj A, void* A_gpu); // Only execute task if it is not NULL. if ( t == NULL ) return; // Now "switch" between the various possible task functions. // FLA_Gemm if ( t->func == (void *) FLA_Gemm_task ) { flash_gemm_gpu_p func; func = (flash_gemm_gpu_p) FLA_Gemm_external_gpu; func( ( FLA_Trans ) t->int_arg[0], ( FLA_Trans ) t->int_arg[1], t->fla_arg[0], t->input_arg[0], input_arg[0], t->input_arg[1], input_arg[1], t->fla_arg[1], t->output_arg[0], output_arg[0] ); } // FLA_Hemm else if ( t->func == (void *) FLA_Hemm_task ) { flash_hemm_gpu_p func; func = (flash_hemm_gpu_p) FLA_Hemm_external_gpu; func( ( FLA_Side ) t->int_arg[0], ( FLA_Uplo ) t->int_arg[1], t->fla_arg[0], t->input_arg[0], input_arg[0], t->input_arg[1], input_arg[1], t->fla_arg[1], t->output_arg[0], output_arg[0] ); } // FLA_Herk else if ( t->func == (void *) FLA_Herk_task ) { flash_herk_gpu_p func; func = (flash_herk_gpu_p) FLA_Herk_external_gpu; func( ( FLA_Uplo ) t->int_arg[0], ( FLA_Trans ) t->int_arg[1], t->fla_arg[0], t->input_arg[0], input_arg[0], t->fla_arg[1], t->output_arg[0], output_arg[0] ); } // FLA_Her2k else if ( t->func == (void *) FLA_Her2k_task ) { flash_her2k_gpu_p func; func = (flash_her2k_gpu_p) FLA_Her2k_external_gpu; func( ( FLA_Uplo ) t->int_arg[0], ( FLA_Trans ) t->int_arg[1], t->fla_arg[0], t->input_arg[0], input_arg[0], t->input_arg[1], input_arg[1], t->fla_arg[1], t->output_arg[0], output_arg[0] ); } // FLA_Symm else if ( t->func == (void *) FLA_Symm_task ) { flash_symm_gpu_p func; func = (flash_symm_gpu_p) FLA_Symm_external_gpu; func( ( FLA_Side ) t->int_arg[0], ( FLA_Uplo ) t->int_arg[1], t->fla_arg[0], t->input_arg[0], input_arg[0], t->input_arg[1], input_arg[1], t->fla_arg[1], t->output_arg[0], output_arg[0] ); } // FLA_Syrk else if ( t->func == (void *) FLA_Syrk_task ) { flash_syrk_gpu_p func; func = (flash_syrk_gpu_p) FLA_Syrk_external_gpu; func( ( FLA_Uplo ) t->int_arg[0], ( FLA_Trans ) t->int_arg[1], t->fla_arg[0], t->input_arg[0], input_arg[0], t->fla_arg[1], t->output_arg[0], output_arg[0] ); } // FLA_Syr2k else if ( t->func == (void *) FLA_Syr2k_task ) { flash_syr2k_gpu_p func; func = (flash_syr2k_gpu_p) FLA_Syr2k_external_gpu; func( ( FLA_Uplo ) t->int_arg[0], ( FLA_Trans ) t->int_arg[1], t->fla_arg[0], t->input_arg[0], input_arg[0], t->input_arg[1], input_arg[1], t->fla_arg[1], t->output_arg[0], output_arg[0] ); } // FLA_Trmm else if ( t->func == (void *) FLA_Trmm_task ) { flash_trmm_gpu_p func; func = (flash_trmm_gpu_p) FLA_Trmm_external_gpu; func( ( FLA_Side ) t->int_arg[0], ( FLA_Uplo ) t->int_arg[1], ( FLA_Trans ) t->int_arg[2], ( FLA_Diag ) t->int_arg[3], t->fla_arg[0], t->input_arg[0], input_arg[0], t->output_arg[0], output_arg[0] ); } // FLA_Trsm else if ( t->func == (void *) FLA_Trsm_task ) { flash_trsm_gpu_p func; func = (flash_trsm_gpu_p) FLA_Trsm_external_gpu; func( ( FLA_Side ) t->int_arg[0], ( FLA_Uplo ) t->int_arg[1], ( FLA_Trans ) t->int_arg[2], ( FLA_Diag ) t->int_arg[3], t->fla_arg[0], t->input_arg[0], input_arg[0], t->output_arg[0], output_arg[0] ); } // FLA_Gemv else if ( t->func == (void *) FLA_Gemv_task ) { flash_gemv_gpu_p func; func = (flash_gemv_gpu_p) FLA_Gemv_external_gpu; func( ( FLA_Trans ) t->int_arg[0], t->fla_arg[0], t->input_arg[0], input_arg[0], t->input_arg[1], input_arg[1], t->fla_arg[1], t->output_arg[0], output_arg[0] ); } // FLA_Trsv else if ( t->func == (void *) FLA_Trsv_task ) { flash_trsv_gpu_p func; func = (flash_trsv_gpu_p) FLA_Trsv_external_gpu; func( ( FLA_Uplo ) t->int_arg[0], ( FLA_Trans ) t->int_arg[1], ( FLA_Diag ) t->int_arg[2], t->input_arg[0], input_arg[0], t->output_arg[0], output_arg[0] ); } // FLA_Axpy else if ( t->func == (void *) FLA_Axpy_task ) { flash_axpy_gpu_p func; func = (flash_axpy_gpu_p) FLA_Axpy_external_gpu; func( t->fla_arg[0], t->input_arg[0], input_arg[0], t->output_arg[0], output_arg[0] ); } // FLA_Copy else if ( t->func == (void *) FLA_Copy_task ) { flash_copy_gpu_p func; func = (flash_copy_gpu_p) FLA_Copy_external_gpu; func( t->input_arg[0], input_arg[0], t->output_arg[0], output_arg[0] ); } // FLA_Scal else if ( t->func == (void *) FLA_Scal_task ) { flash_scal_gpu_p func; func = (flash_scal_gpu_p) FLA_Scal_external_gpu; func( t->fla_arg[0], t->output_arg[0], output_arg[0] ); } // FLA_Scalr else if ( t->func == (void *) FLA_Scalr_task ) { flash_scalr_gpu_p func; func = (flash_scalr_gpu_p) FLA_Scalr_external_gpu; func( ( FLA_Uplo ) t->int_arg[0], t->fla_arg[0], t->output_arg[0], output_arg[0] ); } else { FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED ); } return; } #endif // FLA_ENABLE_GPU
kokizzu/bebop
gen_struct.go
<gh_stars>10-100 package bebop import ( "io" "strconv" "strings" ) func (st Struct) generateTypeDefinition(w io.Writer, settings GenerateSettings) { writeOpCode(w, st.Name, st.OpCode) writeRecordAssertion(w, st.Name) writeComment(w, 0, st.Comment, settings) writeGoStructDef(w, st.Name) for _, fd := range st.Fields { writeFieldDefinition(fd, w, st.ReadOnly, false, settings) } writeCloseBlock(w) } func (st Struct) generateMarshalBebopTo(w io.Writer, settings GenerateSettings) { exposedName := exposeName(st.Name) writeLine(w, "func (bbp %s) MarshalBebopTo(buf []byte) int {", exposedName) startAt := "0" if len(st.Fields) == 0 { writeLine(w, "\treturn "+startAt) writeCloseBlock(w) return } writeLine(w, "\tat := "+startAt) for _, fd := range st.Fields { name := exposeName(fd.Name) if st.ReadOnly { name = unexposeName(fd.Name) } writeFieldByter("bbp."+name, fd.FieldType, w, settings, 1) } writeLine(w, "\treturn at") writeCloseBlock(w) } func (st Struct) generateUnmarshalBebop(w io.Writer, settings GenerateSettings) { exposedName := exposeName(st.Name) writeLine(w, "func (bbp *%s) UnmarshalBebop(buf []byte) (err error) {", exposedName) if len(st.Fields) > 0 { writeLine(w, "\tat := 0") } for _, fd := range st.Fields { name := exposeName(fd.Name) if st.ReadOnly { name = unexposeName(fd.Name) } writeFieldReadByter("bbp."+name, fd.FieldType, w, settings, 1, true) } writeLine(w, "\treturn nil") writeCloseBlock(w) } func (st Struct) generateMustUnmarshalBebop(w io.Writer, settings GenerateSettings) { exposedName := exposeName(st.Name) writeLine(w, "func (bbp *%s) MustUnmarshalBebop(buf []byte) {", exposedName) if len(st.Fields) > 0 { writeLine(w, "\tat := 0") } for _, fd := range st.Fields { name := exposeName(fd.Name) if st.ReadOnly { name = unexposeName(fd.Name) } writeFieldReadByter("bbp."+name, fd.FieldType, w, settings, 1, false) } writeCloseBlock(w) } func (st Struct) generateEncodeBebop(w io.Writer, settings GenerateSettings) { exposedName := exposeName(st.Name) *settings.isFirstTopLength = true writeLine(w, "func (bbp %s) EncodeBebop(iow io.Writer) (err error) {", exposedName) if len(st.Fields) == 0 { writeLine(w, "\treturn nil") } else { writeLine(w, "\tw := iohelp.NewErrorWriter(iow)") for _, fd := range st.Fields { name := exposeName(fd.Name) if st.ReadOnly { name = unexposeName(fd.Name) } writeFieldMarshaller("bbp."+name, fd.FieldType, w, settings, 1) } writeLine(w, "\treturn w.Err") } writeCloseBlock(w) } func (st Struct) generateDecodeBebop(w io.Writer, settings GenerateSettings) { exposedName := exposeName(st.Name) *settings.isFirstTopLength = true writeLine(w, "func (bbp *%s) DecodeBebop(ior io.Reader) (err error) {", exposedName) if len(st.Fields) == 0 { writeLine(w, "\treturn nil") } else { writeLine(w, "\tr := iohelp.NewErrorReader(ior)") for _, fd := range st.Fields { name := exposeName(fd.Name) if st.ReadOnly { name = unexposeName(fd.Name) } writeStructFieldUnmarshaller("&bbp."+name, fd.FieldType, w, settings, 1) } writeLine(w, "\treturn r.Err") } writeCloseBlock(w) } func (st Struct) generateSize(w io.Writer, settings GenerateSettings) { exposedName := exposeName(st.Name) writeLine(w, "func (bbp %s) Size() int {", exposedName) if len(st.Fields) == 0 { writeLine(w, "\treturn 0") } else { writeLine(w, "\tbodyLen := 0") for _, fd := range st.Fields { name := exposeName(fd.Name) if st.ReadOnly { name = unexposeName(fd.Name) } name = "bbp." + name writeFieldBodyCount(name, fd.FieldType, w, settings, 1) } writeLine(w, "\treturn bodyLen") } writeCloseBlock(w) } func (st Struct) generateReadOnlyGetters(w io.Writer, settings GenerateSettings) { // TODO: slices are not read only, we need to return a copy. exposedName := exposeName(st.Name) for _, fd := range st.Fields { writeLine(w, "func (bbp %s) Get%s() %s {", exposedName, exposeName(fd.Name), fd.FieldType.goString(settings)) writeLine(w, "\treturn bbp.%s", unexposeName(fd.Name)) writeCloseBlock(w) } writeLine(w, "func New%s(", exposedName) for _, fd := range st.Fields { writeLine(w, "\t\t%s %s,", unexposeName(fd.Name), fd.FieldType.goString(settings)) } writeLine(w, "\t) %s {", exposedName) writeLine(w, "\treturn %s{", exposedName) for _, fd := range st.Fields { writeLine(w, "\t\t%s: %s,", unexposeName(fd.Name), unexposeName(fd.Name)) } writeLine(w, "\t}") writeCloseBlock(w) } // Generate writes a .go struct definition out to w. func (st Struct) Generate(w io.Writer, settings GenerateSettings) { st.generateTypeDefinition(w, settings) st.generateMarshalBebopTo(w, settings) st.generateUnmarshalBebop(w, settings) if settings.GenerateUnsafeMethods { st.generateMustUnmarshalBebop(w, settings) } st.generateEncodeBebop(w, settings) st.generateDecodeBebop(w, settings) st.generateSize(w, settings) isEmpty := len(st.Fields) == 0 writeWrappers(w, st.Name, isEmpty, settings) if st.ReadOnly { st.generateReadOnlyGetters(w, settings) } } func writeStructFieldUnmarshaller(name string, typ FieldType, w io.Writer, settings GenerateSettings, depth int) { iName := "i" + strconv.Itoa(depth) if typ.Array != nil { writeLineWithTabs(w, "%RECV = make([]%TYPE, iohelp.ReadUint32(r))", depth, name, typ.Array.goString(settings)) writeLineWithTabs(w, "for "+iName+" := range %RECV {", depth, name) name = "&(" + name[1:] + "[" + iName + "])" writeStructFieldUnmarshaller(name, *typ.Array, w, settings, depth+1) writeLineWithTabs(w, "}", depth) } else if typ.Map != nil { lnName := "ln" + strconv.Itoa(depth) if *settings.isFirstTopLength && depth == 1 { writeLineWithTabs(w, lnName+" := iohelp.ReadUint32(r)", depth) *settings.isFirstTopLength = false } else if depth == 1 { writeLineWithTabs(w, lnName+" = iohelp.ReadUint32(r)", depth) } else { writeLineWithTabs(w, lnName+" := iohelp.ReadUint32(r)", depth) } writeLineWithTabs(w, "%RECV = make(%TYPE, "+lnName+")", depth, name, typ.Map.goString(settings)) writeLineWithTabs(w, "for "+iName+" := uint32(0); "+iName+" < "+lnName+"; "+iName+"++ {", depth, name) ln := getLineWithTabs(settings.typeUnmarshallers[typ.Map.Key], depth+1, "&"+depthName("k", depth)) w.Write([]byte(strings.Replace(ln, "=", ":=", 1))) name = "&(" + name[1:] + "[" + depthName("k", depth) + "])" writeStructFieldUnmarshaller(name, typ.Map.Value, w, settings, depth+1) writeLineWithTabs(w, "}", depth) } else { simpleTyp := typ.Simple if alias, ok := settings.importTypeAliases[simpleTyp]; ok { simpleTyp = alias } writeLineWithTabs(w, settings.typeUnmarshallers[simpleTyp], depth, name, typ.goString(settings)) } }
dedsec-9/swarmkit
cmd/swarmctl/cluster/cmd.go
package cluster import "github.com/spf13/cobra" var ( // Cmd exposes the top-level cluster command. Cmd = &cobra.Command{ Use: "cluster", Short: "Cluster management", } ) func init() { Cmd.AddCommand( inspectCmd, listCmd, updateCmd, unlockKeyCmd, ) }
omertuc/DCGM
dcgmproftester/DcgmProfTester.cpp
/* * Copyright (c) 2021, NVIDIA CORPORATION. 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. */ #include "DcgmProfTester.h" #include "Arguments.h" #include "DcgmLogging.h" #include "DcgmSettings.h" #include "DistributedCudaContext.h" #include "Entity.h" #include "PhysicalGpu.h" #include "dcgm_fields.h" #include "dcgm_fields_internal.h" #include "timelib.h" #include "vector_types.h" #include <cublas_proxy.hpp> #include <cuda.h> #include <dcgm_agent.h> #if (CUDA_VERSION_USED >= 11) #include "DcgmDgemm.hpp" #endif #include <tclap/Arg.h> #include <tclap/CmdLine.h> #include <tclap/SwitchArg.h> #include <tclap/ValueArg.h> #include <tclap/ValuesConstraint.h> #include <chrono> #include <cmath> #include <csignal> #include <cstdint> #include <iterator> #include <map> #include <memory> #include <string> #include <sys/types.h> #include <system_error> #include <unistd.h> #include <vector> using namespace DcgmNs::ProfTester; /*****************************************************************************/ /* ctor/dtor */ DcgmProfTester::DcgmProfTester() : m_argumentSet("dcgmproftester", DCGMPROFTESTER_VERSION) { m_duration = 30.0; // Total for all equally long parts, in seconds. m_reportingInterval = 1.0; // Report this frequently, in seconds. m_targetMaxValue = false; m_dcgmIsInitialized = false; m_dcgmHandle = (dcgmHandle_t) nullptr; m_groupId = (dcgmGpuGrp_t) nullptr; m_fieldGroupId = (dcgmFieldGrp_t) nullptr; m_testFieldId = DCGM_FI_PROF_SM_ACTIVE; m_sinceTimestamp = 0; m_startDcgm = true; m_dvsOutput = false; FD_ZERO(&m_parentReadFds); } /*****************************************************************************/ DcgmProfTester::~DcgmProfTester() { if (m_dcgmIsInitialized) { dcgmShutdown(); } } /*****************************************************************************/ dcgmReturn_t DcgmProfTester::ParseCommandLine(int argc, char *argv[]) { // m_argumentSet.AddDefault(DCGM_FI_PROF_GR_ENGINE_ACTIVE, ValueRange_t(0.50, 1.0)); // m_argumentSet.AddDefault(DCGM_FI_PROF_SM_ACTIVE, ValueRange_t(0.50, 1.0)); // m_argumentSet.AddDefault(DCGM_FI_PROF_SM_OCCUPANCY, ValueRange_t(0.50, 1.0)); // m_argumentSet.AddDefault(DCGM_FI_PROF_PIPE_TENSOR_ACTIVE, ValueRange_t(0.50, 1.0)); // m_argumentSet.AddDefault(DCGM_FI_PROF_DRAM_ACTIVE, ValueRange_t(485.0, 500.0)); m_argumentSet.AddDefault(DCGM_FI_PROF_PIPE_FP64_ACTIVE, ValueRange_t(0.50, 1.0)); m_argumentSet.AddDefault(DCGM_FI_PROF_PIPE_FP32_ACTIVE, ValueRange_t(0.50, 1.0)); m_argumentSet.AddDefault(DCGM_FI_PROF_PIPE_FP16_ACTIVE, ValueRange_t(0.50, 1.0)); // m_argumentSet.AddDefault(DCGM_FI_PROF_PCIE_TX_BYTES, ValueRange_t(0.0, 150000000.0)); // m_argumentSet.AddDefault(DCGM_FI_PROF_PCIE_RX_BYTES, ValueRange_t(0.0, 150000000.0)); return m_argumentSet.Parse(argc, argv); } /*****************************************************************************/ dcgmReturn_t DcgmProfTester::CreateDcgmGroups(short unsigned int fieldId) { dcgmReturn_t dcgmReturn = DCGM_ST_OK; if (!m_startDcgm) { printf("Skipping CreateDcgmGroups() since DCGM validation is disabled\n"); return DCGM_ST_OK; } char groupName[32] = { 0 }; snprintf(groupName, sizeof(groupName), "dpt_%d", getpid()); dcgmReturn = dcgmGroupCreate(m_dcgmHandle, DCGM_GROUP_EMPTY, groupName, &m_groupId); if (dcgmReturn != DCGM_ST_OK) { fprintf(stderr, "dcgmGroupCreate() returned %d\n", dcgmReturn); return dcgmReturn; } for (auto &[gpuId, _] : m_gpus) { dcgmReturn = dcgmGroupAddEntity(m_dcgmHandle, m_groupId, DCGM_FE_GPU, gpuId); if (dcgmReturn != DCGM_ST_OK) { fprintf(stderr, "dcgmGroupAddEntity() returned %d\n", dcgmReturn); return dcgmReturn; } } /* Note: using groupName again on purpose since field groups and GPU groups are keyed separately */ dcgmReturn = dcgmFieldGroupCreate(m_dcgmHandle, 1, &fieldId, groupName, &m_fieldGroupId); if (dcgmReturn != DCGM_ST_OK) { fprintf(stderr, "dcgmFieldGroupCreate() returned %d\n", dcgmReturn); return dcgmReturn; } return dcgmReturn; } dcgmReturn_t DcgmProfTester::DestroyDcgmGroups(void) { dcgmReturn_t dcgmReturn = DCGM_ST_OK; if (!m_startDcgm) { return DCGM_ST_OK; } dcgmReturn = dcgmGroupDestroy(m_dcgmHandle, m_groupId); if (dcgmReturn != DCGM_ST_OK) { fprintf(stderr, "dcgmGroupDestroy() returned %d\n", dcgmReturn); return dcgmReturn; } dcgmReturn = dcgmFieldGroupDestroy(m_dcgmHandle, m_fieldGroupId); if (dcgmReturn != DCGM_ST_OK) { fprintf(stderr, "dcgmFieldGroupDestroy() returned %d\n", dcgmReturn); return dcgmReturn; } return dcgmReturn; } /*****************************************************************************/ dcgmReturn_t DcgmProfTester::WatchFields(long long updateIntervalUsec, double maxKeepAge, unsigned int testFieldId) { dcgmReturn_t dcgmReturn = DCGM_ST_OK; int maxKeepSamples = 0; /* Use maxKeepAge instead */ if (!m_startDcgm) { printf("Skipping WatchFields() since DCGM validation is disabled\n"); return DCGM_ST_OK; } dcgmReturn = dcgmWatchFields(m_dcgmHandle, m_groupId, m_fieldGroupId, updateIntervalUsec, maxKeepAge, maxKeepSamples); if (dcgmReturn == DCGM_ST_REQUIRES_ROOT) { fprintf(stderr, "Profiling requires running as root.\n"); } else if (dcgmReturn == DCGM_ST_PROFILING_NOT_SUPPORTED) { fprintf(stderr, "Profiling is not supported.\n"); } else if (dcgmReturn == DCGM_ST_INSUFFICIENT_DRIVER_VERSION) { fprintf(stderr, "Either your driver is older than 418.75 (TRD3) or you " "are not running dcgmproftester as root.\n"); } else if (dcgmReturn == DCGM_ST_IN_USE) { fprintf(stderr, "Another process is already using the profiling infrastucture. " "If nv-hostengine is running on your box, please kill it before running " "dcgmproftester or use the --no-dcgm-validation option to only generate a workload\n"); } else if (dcgmReturn == DCGM_ST_NOT_SUPPORTED) { fprintf(stderr, "Field ID %u is is not supported for your GPU.\n", testFieldId); } else if (dcgmReturn == DCGM_ST_GROUP_INCOMPATIBLE) { fprintf( stderr, "dcgmproftester can only test homogeneous GPUs. Please use -i to pass a list of GPUs that are the same SKU.\n"); } else if (dcgmReturn != DCGM_ST_OK) { fprintf(stderr, "dcgmWatchFields() returned %d\n", dcgmReturn); } return dcgmReturn; } /*****************************************************************************/ dcgmReturn_t DcgmProfTester::UnwatchFields(void) { dcgmReturn_t dcgmReturn; if (!m_startDcgm) { printf("Skipping UnwatchFields() since DCGM validation is disabled\n"); return DCGM_ST_OK; } dcgmReturn = dcgmUnwatchFields(m_dcgmHandle, m_groupId, m_fieldGroupId); if (dcgmReturn != DCGM_ST_OK) { fprintf(stderr, "dcgmUnwatchFields() returned %d\n", dcgmReturn); return dcgmReturn; } return dcgmReturn; } /*****************************************************************************/ dcgmReturn_t DcgmProfTester::DcgmInit(void) { dcgmReturn_t dcgmReturn = dcgmInit(); if (dcgmReturn != DCGM_ST_OK) { fprintf(stderr, "dcgmInit() returned %d\n", dcgmReturn); return dcgmReturn; } dcgmReturn = dcgmStartEmbedded(DCGM_OPERATION_MODE_AUTO, &m_dcgmHandle); if (dcgmReturn != DCGM_ST_OK) { fprintf(stderr, "dcgmStartEmbedded() returned %d\n", dcgmReturn); } m_dcgmIsInitialized = true; return dcgmReturn; } /*****************************************************************************/ /** * Here, we initialize the list of physical GPUs, and set up Watch Groups * as necessary. */ dcgmReturn_t DcgmProfTester::InitializeGpus(const Arguments_t &arguments) { /** * Here, we add nullptr placeholders for any new GPU IDs we want to test. */ for (auto gpuId : arguments.m_gpuIds) { m_gpus.insert({ gpuId, nullptr }); } /** * Here we get a list of all the GPUs in the system. We do this so we can * exclude GPUs from the argument that don't actually exist. */ int count = 0; unsigned int gpuIdList[DCGM_MAX_NUM_DEVICES]; dcgmReturn_t dcgmReturn = dcgmGetAllDevices(m_dcgmHandle, gpuIdList, &count); if (dcgmReturn != DCGM_ST_OK) { fprintf(stderr, "dcgmGetAllDevices() returned %d\n", dcgmReturn); return dcgmReturn; } if (count < 1) { fprintf(stderr, "DCGM found 0 GPUs. There's nothing to test on.\n"); return DCGM_ST_GENERIC_ERROR; } /** * If we have not listed ANY GPUs on the command line, we test on all * of them. */ bool allGpus = (arguments.m_gpuIds.size() == 0); for (int i = 0; i < count; i++) { unsigned int gpuId = gpuIdList[i]; /** * Add a GPU to our list if it isn't already on it. */ auto it = allGpus ? m_gpus.insert({ gpuId, nullptr }).first : m_gpus.find(gpuId); if (it != m_gpus.end()) { /** * If the GPU was newly added to our list, we need to create * a PhysicalGpu object to track it. */ if (it->second == nullptr) // Initialized for the first time. { it->second = std::make_shared<PhysicalGpu>(shared_from_this(), gpuIdList[i], arguments.m_parameters); dcgmReturn_t retVal = it->second->Init(m_dcgmHandle); if (retVal != DCGM_ST_OK) { std::cout << "GPU " << gpuId << " could not be initialized. Returns: " << retVal << std::endl; it->second = nullptr; // Don't try and test this one. } } else { /** * We already initialized this GPU and ran a test on it. * It should be ready for another test. * * TODO: need to decide when to remove GPUs. */ it->second->SetParameters(arguments.m_parameters); } } } // Delete m_gpu entries that were not found or are no longer specified. auto it = m_gpus.cbegin(); while (it != m_gpus.end()) { /** * Check if the GPU specified actually exists. If so, a PhysicalGpu * will be present. */ if (it->second == nullptr) { std::cout << "GPU " << it->first << " does not exist or can't be tested." << std::endl; it = m_gpus.erase(it); continue; } if (!allGpus) { /** * Check if the GPU specified was indicated on the command line. * If not, it will be removed. */ bool deletedGpu { true }; for (auto gpuId : arguments.m_gpuIds) { if (it->first == gpuId) { deletedGpu = false; break; } } if (deletedGpu) { it = m_gpus.erase(it); } } it++; } dcgmReturn = InitializeGpuInstances(); if (dcgmReturn != DCGM_ST_OK) return dcgmReturn; dcgmReturn = CreateDcgmGroups(arguments.m_parameters.m_fieldId); if (dcgmReturn != DCGM_ST_OK) return dcgmReturn; return DCGM_ST_OK; } /*****************************************************************************/ /** * Here, we shutdown the list of physical GPUs, and clear up Watch Groups * as necessary. */ dcgmReturn_t DcgmProfTester::ShutdownGpus(void) { dcgmReturn_t dcgmReturn; dcgmReturn = ShutdownGpuInstances(); if (dcgmReturn != DCGM_ST_OK) { return dcgmReturn; } dcgmReturn = DestroyDcgmGroups(); if (dcgmReturn != DCGM_ST_OK) { return dcgmReturn; } return DCGM_ST_OK; } /*****************************************************************************/ dcgmReturn_t DcgmProfTester::Init(int argc, char *argv[]) { dcgmReturn_t dcgmReturn = DCGM_ST_OK; dcgmReturn = ParseCommandLine(argc, argv); if (dcgmReturn != DCGM_ST_OK) return dcgmReturn; /* Start DCGM. We will initialize CUDA in each of the per-slice (only one if not MIG) worker processes. */ dcgmReturn = DcgmInit(); return dcgmReturn; } // Abort Physical GPU processes. Something went very wrong. void DcgmProfTester::AbortOtherChildren(unsigned int gpuId) { /** * We don't abort the one specified as it already aborted itself. And we * don't abort more after we find ourselves because we were called to abort * all the ones initialized before the one specified in a similar (ordered) * map iteration. */ for (auto &[id, gpu] : m_gpus) { if (id == gpuId) { break; } gpu->AbortChildren(); } m_dcgmCudaContexts.clear(); } /* Nuke child processes. This tries to be gentle before aborting it. It * should be used if the children have already started processing a request * as opposed to not. Generally Aborting the child will cause it to die * from SIGPIPE when it can't do I/O on its pipes, sending an "X" will let * it try to exit cleanly if it is done working and waiting for another * command. */ void DcgmProfTester::NukeChildren(bool force) { for (auto &[gpuId, gpu] : m_gpus) { gpu->NukeChildren(force); } m_dcgmCudaContexts.clear(); } /*****************************************************************************/ /** * One-of reporting management for use by Physical GPU classes to coordinate * their reporting. */ // Is this the first tick in the current part from any GPU? bool DcgmProfTester::IsFirstTick(void) const { return m_isFirstTick; } // Set (or clear) the first tick in the current part from any GPU. void DcgmProfTester::SetFirstTick(bool value) { m_isFirstTick = value; } // Get the next test part we expect. unsigned int DcgmProfTester::GetNextPart(void) const { return m_nextPart; } // Get the next test part we expect. void DcgmProfTester::SetNextPart(unsigned int value) { m_nextPart = value; } /*****************************************************************************/ void DcgmProfTester::ReportWorkerStarted(std::shared_ptr<DistributedCudaContext> worker) { int fd = worker->GetReadFD(); m_dcgmCudaContexts[fd] = worker; FD_SET(fd, &m_parentReadFds); if (fd > m_maxFd) { m_maxFd = fd; } } /*****************************************************************************/ void DcgmProfTester::ReportWorkerFailed(std::shared_ptr<DistributedCudaContext> worker) { int fd = worker->GetReadFD(); FD_CLR(fd, &m_parentReadFds); if (fd > m_maxFd) { m_maxFd = fd; } } /*****************************************************************************/ dcgmReturn_t DcgmProfTester::RunTests(double reportingInterval, double duration, unsigned int testFieldId) { dcgmReturn_t rtSt { DCGM_ST_OK }; SetFirstTick(false); SetNextPart(0); for (auto &gpuInstance : m_gpuInstances) { std::shared_ptr<DistributedCudaContext> worker { nullptr }; std::string cudaVisibleDevices { "" }; auto entities = std::make_shared<std::map<dcgm_field_entity_group_t, dcgm_field_eid_t>>(); unsigned short fieldId { DCGM_FI_DEV_CUDA_VISIBLE_DEVICES_STR }; dcgmGroupEntityPair_t entity; (*entities)[DCGM_FE_GPU] = gpuInstance.m_gpuId; if (gpuInstance.m_isMig) { if ((testFieldId != DCGM_FI_PROF_PCIE_TX_BYTES) && (testFieldId != DCGM_FI_PROF_PCIE_RX_BYTES)) { (*entities)[DCGM_FE_GPU_I] = gpuInstance.m_gi; (*entities)[DCGM_FE_GPU_CI] = gpuInstance.m_ci; } entity.entityGroupId = DCGM_FE_GPU_CI; entity.entityId = gpuInstance.m_ci; dcgmFieldValue_v2 value {}; dcgmReturn_t dcgmReturn = dcgmEntitiesGetLatestValues(m_dcgmHandle, &entity, 1, &fieldId, 1, DCGM_FV_FLAG_LIVE_DATA, &value); if (dcgmReturn != DCGM_ST_OK || value.status != DCGM_ST_OK) { AbortOtherChildren(gpuInstance.m_gpuId); DCGM_LOG_ERROR << "Could not map Entity ID [" << entity.entityGroupId << "," << entity.entityId << "] to CUDA_VISIBLE_DEVICES environment variable (" << (int)dcgmReturn << "), " << value.status << ")"; return DCGM_ST_GENERIC_ERROR; } cudaVisibleDevices = value.value.str; } else { entity.entityGroupId = DCGM_FE_GPU; entity.entityId = gpuInstance.m_gpuId; cudaVisibleDevices = ""; } worker = m_gpus[gpuInstance.m_gpuId]->AddSlice(entities, entity, cudaVisibleDevices); if (worker == nullptr) // Failure to add a worker slice. { return DCGM_ST_GENERIC_ERROR; } } static const unsigned int cUsecInSec = 1000000; for ([[maybe_unused]] auto &[gpuId, gpu] : m_gpus) { rtSt = gpu->StartTests(); // Will not start workers already running. if ((rtSt == DCGM_ST_OK) && gpu->AllStarted()) { /** * We are already started, so we just need to run tests. * This can happen when we reuse started GPU (or GPU MIG slice) * worker processes. Normally, we are not AllStarted until the GPU * (or GPU MIG slice) workers report that they started to the * Physical GPU object. When that happens, the Physical GPU * advances to the Running state and actually start the test either * on the entire GPU or the MIG slice worker processes. * * But, in this case, the GPU workers were already started, so there * are no starting indications from worker processes to drive the * transition from Starting to Running, so we request that * transition here. */ rtSt = gpu->RunTests(); } if (rtSt != DCGM_ST_OK) { AbortOtherChildren(gpuId); return rtSt; } } dcgmReturn_t dcgmReturn = WatchFields(cUsecInSec * reportingInterval, duration, testFieldId); if (dcgmReturn != DCGM_ST_OK) { NukeChildren(true); return dcgmReturn; } /* * We have now started up all worker processes. We should check if they are * ready to receive commands. They send back P\n if initialization passed, * and F\n if it failed. If they are crashed, they have closed their side * of the pipes between us. */ fd_set rfds; size_t physicalGPUsReported { 0 }; while (physicalGPUsReported < m_gpus.size()) { std::memcpy(&rfds, &m_parentReadFds, sizeof(fd_set)); timeval tv; // Wait up to twice the duration, per GPU instance, rounded up. double timeout = duration * m_gpuInstances.size() * 2.0 + 0.5; double timeoutInt; double timeoutFrac; timeoutFrac = modf(timeout, &timeoutInt); tv.tv_sec = (decltype(tv.tv_sec))(timeoutInt); tv.tv_usec = (decltype(tv.tv_usec))(timeoutFrac * 1000000.0); int readyWorkers = select(m_maxFd + 1, &rfds, nullptr, nullptr, &tv); if (readyWorkers < 0) // select error { NukeChildren(true); UnwatchFields(); return DCGM_ST_GENERIC_ERROR; } if (readyWorkers == 0) // timeout { NukeChildren(true); UnwatchFields(); return DCGM_ST_GENERIC_ERROR; } // Handle workers with data. for (unsigned int fd = 0; (fd <= m_maxFd) && (readyWorkers > 0); fd++) { if (!FD_ISSET(fd, &rfds)) { // This worker has no response yet. continue; } readyWorkers--; auto worker = m_dcgmCudaContexts[fd]; if (worker == nullptr) { fprintf(stderr, "*** NULLPTR worker on fd %d\n", fd); continue; } auto physicalGpu = worker->GetPhysicalGpu(); auto alreadyReported = physicalGpu->AllReported(); rtSt = physicalGpu->ProcessResponse(worker); if (physicalGpu->WorkerReported()) { FD_CLR(fd, &m_parentReadFds); m_dcgmCudaContexts[fd] = nullptr; // We only check this when it makes a difference. if (fd == m_maxFd) { while ((m_maxFd > 0) && !FD_ISSET(m_maxFd, &m_parentReadFds)) { --m_maxFd; } } } // Check if this physical GPU finished reporting results. if (!alreadyReported && physicalGpu->AllReported()) { physicalGPUsReported++; } } } UnwatchFields(); unsigned int i = 0; bool failed { false }; for (auto &[_, gpu] : m_gpus) { if (!gpu->IsValidated()) { std::cout << "GPU " << i << ", TestField " << testFieldId << " test FAILED" << std::endl; failed = true; } i++; } return failed ? DCGM_ST_GENERIC_ERROR : DCGM_ST_OK; } /** * Initializes CUDA contexts - one per physical CPU or one per MIG slice. * * @return Returns DCGM_ST_OK on success, other on error. */ dcgmReturn_t DcgmProfTester::InitializeGpuInstances(void) { dcgmMigHierarchy_v2 hierarchy {}; hierarchy.version = dcgmMigHierarchy_version2; dcgmReturn_t ret = dcgmGetGpuInstanceHierarchy(m_dcgmHandle, &hierarchy); if (ret != DCGM_ST_OK) { DCGM_LOG_ERROR << "Failed to enumerate GPU instances: " << errorString(ret); return ret; } try { std::unordered_map<dcgm_field_eid_t, dcgmMigHierarchyInfo_v2 *> gpuInstances; // Count GPU instances and per-GPU instance Compute instances. for (auto *p = hierarchy.entityList; p < hierarchy.entityList + hierarchy.count; p++) { if ((p->entity.entityGroupId == DCGM_FE_GPU_I) && (p->parent.entityGroupId == DCGM_FE_GPU) && (m_gpus.find(p->parent.entityId) != m_gpus.end())) { gpuInstances[p->entity.entityId] = p; } else if ((p->entity.entityGroupId == DCGM_FE_GPU_CI) && (p->parent.entityGroupId == DCGM_FE_GPU_I) && (gpuInstances.find(p->parent.entityId) != gpuInstances.end())) { m_gpuInstances.emplace_back(gpuInstances[p->parent.entityId]->parent.entityId, gpuInstances[p->parent.entityId]->entity.entityId, p->entity.entityId); } } // Pick up non-MIG GPUs. for (auto &[gpuId, gpu] : m_gpus) { if (!gpu->IsMIG()) { m_gpuInstances.emplace_back(gpuId); } } } catch (...) // Generally std::bad_alloc but we catch all. { DCGM_LOG_ERROR << "Cannot allocate CUDA worker processes"; return DCGM_ST_GENERIC_ERROR; } return DCGM_ST_OK; } /** * Shuts down CUDA contexts - one per physical CPU or one per MIG slice. * * @return Returns DCGM_ST_OK on success, other on error. */ dcgmReturn_t DcgmProfTester::ShutdownGpuInstances(void) { m_gpuInstances.clear(); return DCGM_ST_OK; } /*****************************************************************************/ dcgmReturn_t DcgmProfTester::Process(std::function<dcgmReturn_t(std::shared_ptr<Arguments_t> arguments)> processFn) { return m_argumentSet.Process([this, processFn](std::shared_ptr<Arguments_t> arguments) { m_startDcgm = !arguments->m_parameters.m_noDcgmValidation; return processFn(arguments); }); } /*****************************************************************************/ int main(int argc, char **argv) { try { std::shared_ptr<DcgmProfTester> dpt { std::make_shared<DcgmProfTester>() }; dcgmReturn_t dcgmReturn; int cudaLoaded = 0; auto cuResult = cuDriverGetVersion(&cudaLoaded); if (cuResult != CUDA_SUCCESS) { fprintf(stderr, "Unable to validate Cuda version. cuDriverGetVersion returned %d\n", cuResult); return -1; } // CUDA_VERSION_USED is defined in CMakeLists.txt file if ((cudaLoaded / 1000) != CUDA_VERSION_USED) { fprintf( stderr, "Wrong version of dcgmproftester is used. Expected Cuda version is %d; Installed Cuda version is %d.\n", CUDA_VERSION_USED, cudaLoaded / 1000); return -1; } // We do this to avoid zombies. We don't care about worker exit codes. struct sigaction sa; sa.sa_handler = SIG_IGN; // handle signal by ignoring sigemptyset(&sa.sa_mask); sa.sa_flags = 0; if (sigaction(SIGCHLD, &sa, 0) == -1) { fprintf(stderr, "Could not ignore SIGCHLD from worker threads.\n"); return -1; } DcgmLogging::init("dcgmproftester.log", DcgmLoggingSeverityWarning); dcgmReturn = dpt->Init(argc, argv); if (dcgmReturn) { fprintf(stderr, "Error %d from Init(). Exiting.\n", dcgmReturn); return -((int)dcgmReturn); } dcgmReturn = dpt->Process([dpt](std::shared_ptr<DcgmNs::ProfTester::Arguments_t> arguments) -> dcgmReturn_t { dcgmReturn_t dcgmReturn = dpt->InitializeGpus(*arguments); if (dcgmReturn) { fprintf(stderr, "Error %d from InitializeGpus(). Exiting.\n", dcgmReturn); return dcgmReturn; } dcgmReturn_t st = dpt->RunTests(arguments->m_parameters.m_reportInterval, arguments->m_parameters.m_duration, arguments->m_parameters.m_fieldId); dcgmReturn = dpt->ShutdownGpus(); if (dcgmReturn) { fprintf(stderr, "Error %d from ShutdownGpus(). Exiting.\n", dcgmReturn); return dcgmReturn; } return st; }); return -dcgmReturn; } catch (std::runtime_error const &ex) { fprintf(stderr, "Uncaught exception occured: %s\n", ex.what()); return -((int)DCGM_ST_GENERIC_ERROR); } catch (...) { fprintf(stderr, "Uncaught unexpected exception occured\n"); return -((int)DCGM_ST_GENERIC_ERROR); } return 0; }
chunkyboy068/archive
C_C++/Chat Client/SnoopsServer/SSLServer.h
<gh_stars>0 /* Names: <NAME> & <NAME> Emails: <EMAIL> & <EMAIL> Class: ECE 3574 Title: Homework 7 (SnoopsServer) Date of Submision: 12/9/2012 Description: SSLServer.h defines the functions implemented in SSLServer.cpp. See SSLServer.cpp for more info. */ #ifndef SSLSERVER_H #define SSLSERVER_H #include <QTcpServer> #include <QSslSocket> #include <QSslKey> #include <QList> class SSLServer : public QTcpServer { Q_OBJECT public: SSLServer(QObject *parent = 0); // Since we have a new version of incomingComing connection, we have // to keep track of the SSL sockets created and return them with a // a revised version of nextPendingConnection. QSslSocket *nextPendingConnection(); protected: // override of QTcpServer::incomingConnection(), see documentation // for QSslSocket. void incomingConnection(int socketDescriptor); private: // a list to keep track of the sockets that we have created QList<QSslSocket *> m_secureSocketList; }; #endif // SSLSERVER_H
amoshydra/cypress
packages/driver/cypress/integration/commands/clock_spec.js
<filename>packages/driver/cypress/integration/commands/clock_spec.js describe('src/cy/commands/clock', () => { beforeEach(function () { this.window = cy.state('window') this.setTimeoutSpy = cy.spy(this.window, 'setTimeout') this.setIntervalSpy = cy.spy(this.window, 'setInterval') }) describe('#clock', () => { it('sets clock as subject', () => { cy.clock().then((clock) => { expect(clock).to.exist expect(clock.tick).to.be.a('function') }) }) it('assigns clock to test context', () => { cy.clock().then(function (clock) { expect(clock).to.eq(this.clock) }) }) it('proxies @sinonjs/fake-timers clock, replacing window time methods', function (done) { expect(this.setTimeoutSpy).not.to.be.called cy.clock().then(function (clock) { // @sinonjs/fake-timers calls setTimeout once as part of its setup // but it shouldn't be called again by the @window.setTimeout() expect(this.setTimeoutSpy).to.be.calledOnce this.window.setTimeout(() => { expect(this.setTimeoutSpy).to.be.calledOnce done() }) clock.tick() }) }) it('takes number now arg', () => { const now = 1111111111111 cy.clock(now).then(function (clock) { expect(new this.window.Date().getTime()).to.equal(now) clock.tick(4321) expect(new this.window.Date().getTime()).to.equal(now + 4321) }) }) it('takes Date now arg', () => { // April 15, 2017 const now = new Date(2017, 3, 15) const nowTimestamp = now.getTime() cy.clock(now).then(function (clock) { expect(new this.window.Date().getTime()).to.equal(nowTimestamp) clock.tick(4321) expect(new this.window.Date().getTime()).to.equal(nowTimestamp + 4321) }) }) it('restores window time methods when calling restore', (done) => { cy.clock().then(function (clock) { this.window.setTimeout(() => { expect(this.setTimeoutSpy).to.be.calledOnce clock.restore() expect(this.window.setTimeout).to.equal(this.setTimeoutSpy) this.window.setTimeout(() => { expect(this.setTimeoutSpy).to.be.calledTwice done() }) }) clock.tick() }) }) it('unsets clock after restore', () => { cy.clock().then(function (clock) { expect(cy.state('clock')).to.exist clock.restore() expect(cy.state('clock')).to.be.null expect(this.clock).to.be.null }) }) it('automatically restores clock on \'restore\' event', () => { cy.clock().then((clock) => { const r = cy.spy(clock, 'restore') Cypress.emit('test:before:run', {}) expect(r).to.be.called }) }) it('returns clock on subsequent calls, ignoring arguments', () => { cy .clock() .clock(400) .then((clock) => { expect(clock.details().now).to.equal(0) }) }) it('new Date() is an instance of Date', () => { cy.clock() cy.window().then((win) => { expect(new win.Date()).to.be.an.instanceof(win.Date) expect(new win.Date() instanceof win.Date).to.be.true }) }) // this test was written to catch a bug in lolex (dep, now @sinonjs/fake-timers) 3 and was fixed by lolex 4 upgrade, it('doesn\'t override window.performance members', () => { cy.clock() .then((clock) => { cy.window().then((win) => { expect(win.performance.getEntries()).to.deep.eq([]) clock.restore() expect(win.performance.getEntries().length).to.be.at.least(1) }) }) }) it('overwrites without crashing', () => { Cypress.Commands.overwrite('clock', (originalCommand, ...args) => { return originalCommand(...args) }) cy.clock() }) context('errors', () => { it('throws if now is not a number (or options object)', (done) => { cy.on('fail', (err) => { expect(err.message).to.equal('`cy.clock()` only accepts a number or an `options` object for its first argument. You passed: `"250"`') expect(err.docsUrl).to.equal('https://on.cypress.io/clock') done() }) cy.clock('250') }) it('throws if methods is not an array (or options object)', (done) => { cy.on('fail', (err) => { expect(err.message).to.equal('`cy.clock()` only accepts an array of function names or an `options` object for its second argument. You passed: `"setTimeout"`') expect(err.docsUrl).to.equal('https://on.cypress.io/clock') done() }) cy.clock(0, 'setTimeout') }) it('throws if methods is not an array of strings (or options object)', (done) => { cy.on('fail', (err) => { expect(err.message).to.equal('`cy.clock()` only accepts an array of function names or an `options` object for its second argument. You passed: `[42]`') expect(err.docsUrl).to.equal('https://on.cypress.io/clock') done() }) cy.clock(0, [42]) }) }) context('arg for which functions to replace', () => { it('replaces specified functions', (done) => { cy.clock(null, ['setTimeout']).then(function (clock) { this.window.setTimeout(() => { expect(this.setTimeoutSpy).to.be.calledOnce done() }) clock.tick() }) }) it('does not replace other functions', function (done) { cy.clock(null, ['setTimeout']).then((clock) => { const interval = this.window.setInterval(() => { this.window.clearInterval(interval) expect(this.setIntervalSpy).to.be.called this.window.setTimeout(() => { expect(this.setTimeoutSpy).to.be.calledOnce done() }) clock.tick() }, 5) }) }) }) context('options', () => { beforeEach(function () { this.logged = false cy.on('log:added', (attrs, log) => { if (log.get('name') === 'clock') { this.logged = true } }) return null }) it('can be first arg', function () { cy.clock({ log: false }).then(() => { expect(this.logged).to.be.false }) }) it('can be second arg', function () { cy.clock(new Date().getTime(), { log: false }).then(() => { expect(this.logged).to.be.false }) }) it('can be third arg', function () { cy.clock(new Date().getTime(), ['setTimeout'], { log: false }).then(() => { expect(this.logged).to.be.false }) }) }) context('window changes', () => { it('binds to default window before visit', () => { cy.clock(null, ['setTimeout']).then((clock) => { const onSetTimeout = cy.spy() cy.state('window').setTimeout(onSetTimeout) clock.tick() expect(onSetTimeout).to.be.called }) }) it('re-binds to new window when window changes', () => { const newWindow = { setTimeout () {}, clearTimeout () {}, Date: function Date () {}, XMLHttpRequest: { prototype: {}, }, Function, } cy.clock(null, ['setTimeout']).then((clock) => { Cypress.emit('window:before:load', newWindow) const onSetTimeout = cy.spy() newWindow.setTimeout(onSetTimeout) clock.tick() expect(onSetTimeout).to.be.called }) }) it('binds to window if called before visit', () => { cy.clock() cy.visit('/fixtures/dom.html')// should not throw }) }) context('logging', () => { beforeEach(function () { this.logs = [] cy.on('log:added', (attrs, log) => { const name = log.get('name') if (['clock', 'tick', 'restore'].includes(name)) { return this.logs.push(log) } }) return null }) it('logs when created', function () { cy.clock().then(() => { const log = this.logs[0] expect(this.logs.length).to.equal(1) expect(log.get('name')).to.eq('clock') expect(log.get('message')).to.eq('') expect(log.get('type')).to.eq('parent') expect(log.get('state')).to.eq('passed') expect(log.get('snapshots').length).to.eq(1) expect(log.get('snapshots')[0]).to.be.an('object') }) }) it('logs when restored', function () { cy.clock().then((clock) => { clock.restore() const log = this.logs[1] expect(this.logs.length).to.equal(2) expect(log.get('name')).to.eq('restore') expect(log.get('message')).to.eq('') }) }) it('does not log when auto-restored', function (done) { cy.clock().then(() => { Cypress.emit('test:before:run', {}) expect(this.logs.length).to.equal(1) done() }) }) it('does not log when log: false', function () { cy.clock({ log: false }).then((clock) => { clock.tick() clock.restore() expect(this.logs.length).to.equal(0) }) }) it('only logs the first call', function () { cy .clock() .clock() .clock() .then(() => { expect(this.logs.length).to.equal(1) }) }) context('#consoleProps', () => { beforeEach(() => { cy.clock(100, ['setTimeout']).then(function (clock) { this.clock = clock this.clock.tick(100) }) }) it('includes clock\'s now value', function () { const consoleProps = this.logs[0].invoke('consoleProps') expect(consoleProps['Now']).to.equal(100) }) it('includes methods replaced by clock', function () { const consoleProps = this.logs[0].invoke('consoleProps') expect(consoleProps['Methods replaced']).to.eql(['setTimeout']) }) it('logs ticked amount on tick', function () { const createdConsoleProps = this.logs[0].invoke('consoleProps') expect(createdConsoleProps['Ticked']).to.be.undefined const tickedConsoleProps = this.logs[1].invoke('consoleProps') expect(tickedConsoleProps['Ticked']).to.equal('100 milliseconds') }) it('properties are unaffected by future actions', function () { this.clock.tick(100) this.clock.restore() const consoleProps = this.logs[1].invoke('consoleProps') expect(consoleProps['Now']).to.equal(200) expect(consoleProps['Methods replaced']).to.eql(['setTimeout']) }) }) }) }) describe('#tick', () => { beforeEach(function () { this.logs = [] cy.on('log:added', (attrs, log) => { if (log.get('name') === 'tick') { this.logs.push(log) } }) return null }) it('moves time ahead and triggers callbacks', function (done) { cy .clock() .then(() => { return this.window.setTimeout(() => { done() }, 1000) }).tick(1000) }) it('returns the clock object', () => { cy .clock() .tick(1000).then(function (clock) { expect(clock).to.equal(this.clock) }) }) it('defaults to 0ms', () => { cy.clock() .tick().then(function (clock) { const consoleProps = this.logs[0].invoke('consoleProps') expect(consoleProps['Ticked']).to.equal('0 milliseconds') }) }) context('errors', () => { it('throws if there is not a clock', (done) => { cy.on('fail', (err) => { expect(err.message).to.equal('`cy.tick()` cannot be called without first calling `cy.clock()`') expect(err.docsUrl).to.equal('https://on.cypress.io/tick') done() }) cy.tick() }) it('throws if ms is not undefined or a number', (done) => { cy.on('fail', (err) => { expect(err.message).to.equal('`clock.tick()`/`cy.tick()` only accepts a number as their argument. You passed: `"100"`') expect(err.docsUrl).to.equal('https://on.cypress.io/tick') done() }) cy.clock().tick('100') }) }) context('logging', () => { it('logs number of milliseconds', () => { cy .clock() .tick(250) .then(function () { const log = this.logs[0] expect(this.logs.length).to.equal(1) expect(log.get('name')).to.eq('tick') expect(log.get('message')).to.eq('250ms') }) }) it('logs before and after snapshots', () => { cy .clock() .tick(250) .then(function () { const log = this.logs[0] expect(log.get('snapshots').length).to.eq(2) expect(log.get('snapshots')[0].name).to.equal('before') expect(log.get('snapshots')[1].name).to.equal('after') }) }) it('does not emit when {log: false}', () => { cy .clock() .tick(10, { log: false }) .then(function () { expect(this.logs[0]).to.be.undefined }) }) }) }) })
smackfu/one-app-ducks
scripts/build-node-imports.js
<gh_stars>1-10 #!/usr/bin/env node /* * Copyright 2019 American Express Travel Related Services Company, 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. */ // Keep asynchronous dependency loading behavior consistent in both the client // and server source files const fs = require('fs'); const path = require('path'); const glob = require('glob'); const { promisify } = require('util'); const readFile = promisify(fs.readFile); const writeFile = promisify(fs.writeFile); function buildNodeImports(err, filePaths) { const fileTransforms = filePaths.map(async (filePath) => { const fileContents = await readFile(filePath); const newContents = fileContents.toString() .replace(/^\n/, 'const nodeImport = (path) => Promise.resolve(require(path));\n') .replace(/import\(([^)]+)\)/g, 'nodeImport($1)') .replace(/\/\*\swebpackChunkName:.*\*\//g, ''); return writeFile(filePath.replace('.client.js', '.node.js'), newContents); }); return Promise.all(fileTransforms); } glob(path.join(__dirname, '..', 'lib', '**', '*.client.js'), buildNodeImports);
JamesCao2048/BlizzardData
Corpus/aspectj/3388.java
import org.aspectj.testing.Tester; import org.aspectj.testing.Tester; public class CflowAlone { public static void main(String[] args){ new testclass1(); Tester.check(0 < Filteraspect.i, "0 < Filteraspect.i: " + Filteraspect.i); } } class testclass1 {} class testclass2 {} aspect Filteraspect { static int i; // all these variants fail //pointcut goCut(): cflow(this(testclass2)); //pointcut goCut(): cflow(target(testclass2)); //pointcut goCut(): cflow(args(testclass2)); //pointcut goCut(): cflow(!within(FilterAspect)); //pointcut goCut(): cflow(within(FilterAspect)); //pointcut goCut(): cflow(within(testclass1)); pointcut goCut(): !within(Filteraspect) && cflow(within(testclass1)) && !preinitialization(new(..)) && !initialization(new(..)); // works ok //pointcut goCut(): within(Filteraspect); Object around(): goCut() { i++; return proceed(); } // no bug when using before or after //after(): goCut() { int i = 1; System.getProperties().put("foo", "bar");} }
StyvenSoft/Learn-Ruby
5-MethodsBlocksAndSorting/Greeter.rb
def greeter(name) return "Hello, #{name}!" end def by_three?(num) if num % 3 == 0 return true else return false end end puts greeter("Steveen")
wilsonpage/gaia
apps/communications/dialer/test/unit/mock_mozVoicemail.js
<reponame>wilsonpage/gaia 'use strict'; var MockMozVoicemail = { _number: null, getNumber: function() { return this._number; } };
qianfei11/zstack
header/src/main/java/org/zstack/header/identity/role/api/APICreateRoleEvent.java
package org.zstack.header.identity.role.api; import org.zstack.header.identity.PolicyStatement; import org.zstack.header.identity.StatementEffect; import org.zstack.header.identity.role.RoleInventory; import org.zstack.header.identity.role.RolePolicyStatementInventory; import org.zstack.header.identity.role.RoleState; import org.zstack.header.identity.role.RoleType; import org.zstack.header.message.APIEvent; import org.zstack.header.rest.RestResponse; import java.sql.Timestamp; import static java.util.Arrays.asList; @RestResponse(allTo = "inventory") public class APICreateRoleEvent extends APIEvent { private RoleInventory inventory; public APICreateRoleEvent() { } public APICreateRoleEvent(String apiId) { super(apiId); } public RoleInventory getInventory() { return inventory; } public void setInventory(RoleInventory inventory) { this.inventory = inventory; } public static APICreateRoleEvent __example__() { APICreateRoleEvent event = new APICreateRoleEvent(); RoleInventory role = new RoleInventory(); role.setName("role-1"); RolePolicyStatementInventory inv = new RolePolicyStatementInventory(); PolicyStatement statement = new PolicyStatement(); statement.setEffect(StatementEffect.Allow); statement.setActions(asList("org.zstack.header.vm.APICreateVmInstanceMsg")); statement.setName("statement for test"); inv.setUuid(uuid()); inv.setStatement(statement); inv.setCreateDate(new Timestamp(System.currentTimeMillis())); inv.setLastOpDate(new Timestamp(System.currentTimeMillis())); inv.setRoleUuid(uuid()); role.setStatements(asList(inv)); role.setDescription("role for test"); role.setUuid(uuid()); role.setState(RoleState.Enabled); role.setType(RoleType.Customized); event.setInventory(role); return event; } }
autioch/movie-collector
app/utils/getTicker/getTemplate.js
<gh_stars>1-10 /* eslint no-magic-numbers: 0 */ /* eslint no-param-reassign: 0 */ const padRight = require('./padRight'); const { maxLabelWidth } = require('./settings'); /** * Prepares template for ProgressBar package. * @param {String} title Title od the progress bar * @param {Number} total Number of actions to perform * @return {String} Prepared template */ module.exports = function getTemplate(title, total) { if (title.length < maxLabelWidth) { title = padRight(title, maxLabelWidth); } if (title.length > maxLabelWidth) { title = `${title.slice(0, 16)}...`; } let template = `${title} :percent `; if (total < 10) { template += ' '; } if (total < 100) { template += ' '; } if (total < 1000) { template += ' '; } return `${template}:current/:total :bar`; };
zeisler/active_mocker
lib/active_mocker/inspectable/time.rb
<filename>lib/active_mocker/inspectable/time.rb # frozen_string_literal: true module ActiveMocker module Inspectable refine Time do def inspect strftime("Time.new(%Y, %-m, %-d, %-H, %-M, %-S, \"%:z\")") end end end end
sciage/NewProject
app/src/main/java/in/voiceme/app/voiceme/PostsDetails/PostsDetailsActivity.java
<filename>app/src/main/java/in/voiceme/app/voiceme/PostsDetails/PostsDetailsActivity.java package in.voiceme.app.voiceme.PostsDetails; import android.content.Intent; import android.media.AudioManager; import android.media.MediaPlayer; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.util.Log; import android.view.View; import android.widget.EditText; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.like.LikeButton; import com.like.OnLikeListener; import com.squareup.picasso.Picasso; import java.io.IOException; import java.text.NumberFormat; import java.util.List; import in.voiceme.app.voiceme.DiscoverPage.LikeUnlikeClickListener; import in.voiceme.app.voiceme.ProfilePage.SecondProfile; import in.voiceme.app.voiceme.R; import in.voiceme.app.voiceme.infrastructure.BaseActivity; import in.voiceme.app.voiceme.infrastructure.BaseSubscriber; import in.voiceme.app.voiceme.infrastructure.Constants; import in.voiceme.app.voiceme.infrastructure.MySharedPreferences; import in.voiceme.app.voiceme.infrastructure.VoicemeApplication; import in.voiceme.app.voiceme.l; import in.voiceme.app.voiceme.services.LikesResponse; import in.voiceme.app.voiceme.services.PostsModel; import in.voiceme.app.voiceme.userpost.Response; import rx.android.schedulers.AndroidSchedulers; import timber.log.Timber; import static in.voiceme.app.voiceme.R.id.detail_list_item_posts_avatar; public class PostsDetailsActivity extends BaseActivity implements View.OnClickListener, OnLikeListener { EditText mMessageEditText; ImageButton mSendMessageImageButton; RecyclerView mMessageRecyclerView; private MessageAdapter mMessageAdapter; private LinearLayoutManager mLinearLayoutManager; private String postId; private List<PostsModel> myList; List<UserCommentModel> myCommentList; private static LikeUnlikeClickListener myClickListener; private boolean doDislike; private ImageView user_avatar; private ImageView play_button; private TextView user_name; private TextView isPost; private TextView feeling; private TextView category; //post data private TextView timeStamp; private TextView postMessage; private TextView postReadMore; private TextView post_audio_duration; //counter numbers private TextView like_counter; private TextView hug_counter; private TextView same_counter; private TextView post_comments; private TextView post_listen; //emoji for like, hug and same above private ImageView likeCounterImage; private ImageView hugCounterImage; private ImageView sameCounterImage; private ImageView commentCounterImage; private ImageView listenCounterImage; private int likeCounter; private int hugCounter; private int sameCounter; protected MediaPlayer mediaPlayer = new MediaPlayer(); //animated buttons private LikeButton likeButtonMain, HugButtonMain, SameButtonMain; private MessageAdapter.InsertMessageListener mInsertMessageListener = new MessageAdapter.InsertMessageListener() { @Override public void onMessageInserted(int position) { mLinearLayoutManager.scrollToPosition(position); } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_posts_details); getSupportActionBar().setTitle("Post Details"); toolbar.setNavigationIcon(R.mipmap.ic_ab_close); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { processLoggedState(v); finish(); } }); postId = getIntent().getStringExtra(Constants.POST_BACKGROUND); //Imageview for avatar and play pause button user_avatar = (ImageView) findViewById(detail_list_item_posts_avatar); play_button = (ImageView) findViewById(R.id.detail_list_item_posts_play_button); //username, feeling and category user_name = (TextView) findViewById(R.id.detail_list_item_post_userNickName); isPost = (TextView) findViewById(R.id.detail_list_item_post_is); feeling = (TextView) findViewById(R.id.detail_list_item_posts_feeling); category = (TextView) findViewById(R.id.detail_list_item_posts_category); //post data post_audio_duration = (TextView) findViewById(R.id.detail_list_item_posts_duration_count); timeStamp = (TextView) findViewById(R.id.detail_list_item_posts_timeStamp); postMessage = (TextView) findViewById(R.id.detail_list_item_posts_message); postReadMore = (TextView) findViewById(R.id.detail_list_item_posts_read_more); //counter numbers like_counter = (TextView) findViewById(R.id.detail_post_likes_counter); hug_counter = (TextView) findViewById(R.id.detail_post_hugs_counter); same_counter = (TextView) findViewById(R.id.detail_post_same_counter); post_comments = (TextView) findViewById(R.id.detail_post_comment_counter); post_listen = (TextView) findViewById(R.id.detail_post_listen_counter); //emoji for like, hug and same above likeCounterImage = (ImageView) findViewById(R.id.detail_emoji_above_like); hugCounterImage = (ImageView) findViewById(R.id.detail_emoji_above_hug); sameCounterImage = (ImageView) findViewById(R.id.detail_emoji_above_same); commentCounterImage = (ImageView) findViewById(R.id.detail_emoji_above_comment); listenCounterImage = (ImageView) findViewById(R.id.detail_emoji_above_listen); //animated buttons likeButtonMain = (LikeButton) findViewById(R.id.detail_list_item_like_button); HugButtonMain = (LikeButton) findViewById(R.id.detail_list_item_hug_button); SameButtonMain = (LikeButton) findViewById(R.id.detail_list_item_same_button); mMessageEditText = (EditText) findViewById(R.id.detail_et_message); mMessageEditText = (EditText) findViewById(R.id.detail_et_message); mMessageEditText = (EditText) findViewById(R.id.detail_et_message); mMessageEditText = (EditText) findViewById(R.id.detail_et_message); mSendMessageImageButton = (ImageButton) findViewById(R.id.detail_btn_send_message); mMessageRecyclerView = (RecyclerView) findViewById(R.id.detail_rv_messages); mSendMessageImageButton.setOnClickListener(this); //OnClickListeners likeButtonMain.setOnLikeListener(this); HugButtonMain.setOnLikeListener(this); SameButtonMain.setOnLikeListener(this); like_counter.setOnClickListener(this); hug_counter.setOnClickListener(this); same_counter.setOnClickListener(this); post_comments.setOnClickListener(this); post_listen.setOnClickListener(this); category.setOnClickListener(this); feeling.setOnClickListener(this); likeCounterImage.setOnClickListener(this); hugCounterImage.setOnClickListener(this); commentCounterImage.setOnClickListener(this); listenCounterImage.setOnClickListener(this); user_name.setOnClickListener(this); user_avatar.setOnClickListener(this); play_button.setOnClickListener(this); try { if (postId != null){ Toast.makeText(this, "post is not null: " + postId, Toast.LENGTH_SHORT).show(); } getData(postId); getComments(postId); } catch (Exception e) { e.printStackTrace(); } initRecyclerView(); } private void initRecyclerView() { mMessageAdapter = new MessageAdapter(PostsDetailsActivity.this, myCommentList, mInsertMessageListener); mLinearLayoutManager = new LinearLayoutManager(PostsDetailsActivity.this) { @Override public boolean canScrollVertically() { return false; } }; mLinearLayoutManager.setStackFromEnd(true); mMessageRecyclerView.setLayoutManager(mLinearLayoutManager); mMessageRecyclerView.setAdapter(mMessageAdapter); } @Override public void onClick(View view) { processLoggedState(view); if (view.getId() == R.id.detail_btn_send_message) { sendMessage(); } else if (view.getId() == R.id.detail_list_item_post_userNickName || view.getId() == R.id.detail_list_item_posts_avatar){ Intent intent = new Intent(this, SecondProfile.class); Toast.makeText(view.getContext(), "Post ID is " + myList.get(0).getIdUserName(), Toast.LENGTH_SHORT).show(); intent.putExtra(Constants.SECOND_PROFILE_ID, myList.get(0).getIdUserName()); startActivity(intent); } else if (view.getId() == R.id.detail_list_item_posts_feeling){ Intent intent = new Intent(this, UserFeelingActivity.class); intent.putExtra(Constants.EMOTION, myList.get(0).getEmotions()); startActivity(intent); } else if (view.getId() == R.id.detail_list_item_posts_category){ Intent intent = new Intent(this, UserCategoryActivity.class); intent.putExtra(Constants.CATEGORY, myList.get(0).getCategory()); startActivity(intent); } else if (view.getId() == R.id.detail_post_likes_counter){ Intent intent = new Intent(this, UserLikeCounterActivity.class); Toast.makeText(this, "Post ID is " + myList.get(0).getIdPosts(), Toast.LENGTH_SHORT).show(); intent.putExtra(Constants.LIKE_FEELING, myList.get(0).getIdPosts()); startActivity(intent); } else if(view.getId() == R.id.detail_post_hugs_counter){ Intent intent = new Intent(this, UserHugCounterActivity.class); Toast.makeText(this, "Post ID is " + myList.get(0).getIdPosts(), Toast.LENGTH_SHORT).show(); intent.putExtra(Constants.HUG_FEELING, myList.get(0).getIdPosts()); startActivity(intent); } else if(view.getId() == R.id.detail_post_same_counter){ Intent intent = new Intent(this, UserSameCounterActivity.class); Toast.makeText(this, "Post ID is " + myList.get(0).getIdPosts(), Toast.LENGTH_SHORT).show(); intent.putExtra(Constants.SAME_FEELING, myList.get(0).getIdPosts()); startActivity(intent); } else if(view.getId() == R.id.detail_post_listen_counter){ Intent intent = new Intent(this, UserListenCounterActivity.class); Toast.makeText(this, "Post ID is " + myList.get(0).getIdPosts(), Toast.LENGTH_SHORT).show(); intent.putExtra(Constants.LISTEN_FEELING, myList.get(0).getIdPosts()); startActivity(intent); } else if(view.getId() == R.id.detail_list_item_posts_play_button){ if (!mediaPlayer.isPlaying()){ if (mediaPlayer != null){ try { mediaPlayer.stop(); } catch (Exception e){ } mediaPlayer = null; } mediaPlayer = new MediaPlayer(); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); try { mediaPlayer.setDataSource(myList.get(0).getAudioFileLink()); mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(MediaPlayer mediaPlayer) { try { mediaPlayer.start(); flipPlayPauseButton(true); } catch (Exception e){ e.printStackTrace(); } } }); mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mediaPlayer) { flipPlayPauseButton(false); } }); mediaPlayer.prepareAsync(); } catch (IOException e){ e.printStackTrace(); } } else { try { mediaPlayer.pause(); flipPlayPauseButton(false); } catch (Exception e){ e.printStackTrace(); } } } } public void flipPlayPauseButton(boolean isPlaying){ if (isPlaying){ play_button.setImageResource(R.drawable.stop_button); } else { play_button.setImageResource(R.drawable.play_button); } } void sendMessage() { String message = mMessageEditText.getText().toString(); if (!TextUtils.isEmpty(message)) { // Todo post comment on server try { postComment(message); String sendLike = "senderid@" + MySharedPreferences.getUserId(preferences) + "_contactId@" + "21" /* "dataItem.getIdUserName()" */ + "_postId" + postId + "_click" + "5"; sendLikeNotification(application, sendLike); } catch (Exception e) { e.printStackTrace(); } mMessageAdapter.addMessage(new UserCommentModel(message, MySharedPreferences.getImageUrl(preferences), MySharedPreferences.getUsername(preferences))); mMessageEditText.setText(""); } else { Toast.makeText(this, "You have not entered anything", Toast.LENGTH_SHORT).show(); } } private void getComments(String postId) throws Exception { application.getWebService() .getUserComments(postId) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new BaseSubscriber<List<UserCommentModel>>() { @Override public void onNext(List<UserCommentModel> response) { Log.e("RESPONSE:::", "Size===" + response.size()); showComments(response); } }); } private void showComments(final List<UserCommentModel> myList) { this.myCommentList = myList; mMessageAdapter = new MessageAdapter(this, myList, mInsertMessageListener); mMessageRecyclerView.setAdapter(mMessageAdapter); } private void postComment(String message) throws Exception { application.getWebService() .sendComment(MySharedPreferences.getUserId(preferences), postId, message) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new BaseSubscriber<Response>() { @Override public void onNext(Response response) { Toast.makeText(PostsDetailsActivity.this, "Response for posting comments " + response.getMsg(), Toast.LENGTH_SHORT).show(); } }); } private void getData(String postId) throws Exception { application.getWebService() .getSinglePost(postId, MySharedPreferences.getUserId(preferences)) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new BaseSubscriber<List<PostsModel>>() { @Override public void onNext(List<PostsModel> response) { String name = response.get(0).getIdUserName(); Toast.makeText(PostsDetailsActivity.this, "response for details", Toast.LENGTH_SHORT).show(); showRecycleWithDataFilled(response); } }); } private void showRecycleWithDataFilled(final List<PostsModel> myList) { this.myList = myList; user_name.setText(myList.get(0).getUserNicName()); timeStamp.setText(myList.get(0).getPostTime()); postMessage.setText(myList.get(0).getTextStatus()); feeling.setText(myList.get(0).getEmotions()); category.setText(myList.get(0).getCategory()); post_comments.setText(myList.get(0).getComments()); like_counter.setText(myList.get(0).getLikes()); same_counter.setText(myList.get(0).getSame()); hug_counter.setText(myList.get(0).getHug()); if (myList.get(0).getAudioDuration() != null){ post_audio_duration.setText(myList.get(0).getAudioDuration()); post_listen.setText(myList.get(0).getListen()); } likeCounter = Integer.parseInt(myList.get(0).getLikes()); hugCounter = Integer.parseInt(myList.get(0).getHug()); sameCounter = Integer.parseInt(myList.get(0).getSame()); if (!myList.get(0).getAvatarPics().equals("")) { Picasso.with(this) .load(myList.get(0).getAvatarPics()) .resize(75, 75) .centerInside() .into(user_avatar); } if (myList.get(0).getUserLike() != null){ if (myList.get(0).getUserLike()){ likeButtonMain.setLiked(true); } else { likeButtonMain.setLiked(false); } if (myList.get(0).getUserHuge()){ HugButtonMain.setLiked(true); } else { HugButtonMain.setLiked(false); } if (myList.get(0).getUserSame()){ SameButtonMain.setLiked(true); } else { SameButtonMain.setLiked(false); } } if (myList.get(0).getAudioFileLink() == null){ play_button.setVisibility(View.GONE); post_audio_duration.setVisibility(View.GONE); post_listen.setVisibility(View.GONE); listenCounterImage.setVisibility(View.GONE); } else { play_button.setVisibility(View.VISIBLE); post_audio_duration.setVisibility(View.VISIBLE); post_listen.setVisibility(View.VISIBLE); listenCounterImage.setVisibility(View.VISIBLE); } } @Override public void liked(LikeButton likeButton) { processLoggedState(likeButton); try { if (myClickListener != null) { myClickListener.onLikeUnlikeClick(myList.get(0), likeButton); final LikeButton likeButtonLcl = likeButton; if (doDislike) new Thread(new Runnable() { @Override public void run() { l.pause(1000); likeButtonLcl.post(new Runnable() { @Override public void run() { likeButtonLcl.setLiked(false); } }); } }).start(); } else { Toast.makeText(likeButton.getContext(), "Click Event Null", Toast.LENGTH_SHORT).show(); } } catch (NullPointerException e) { Toast.makeText(likeButton.getContext(), "Click Event Null Ex", Toast.LENGTH_SHORT).show(); } if (doDislike) return; if (likeButton == likeButtonMain) { likeCounter++; like_counter.setText(NumberFormat.getIntegerInstance().format(likeCounter)); String sendLike = "senderid@" + MySharedPreferences.getUserId(preferences) + "_contactId@" + myList.get(0).getIdUserName() + "_postId@" + postId + "_click@" + "1"; sendLikeToServer(application, 1, 0, 0, 0, "clicked like button"); if (MySharedPreferences.getUserId(preferences).equals(myList.get(0).getIdUserName())){ Toast.makeText(this, "same user", Toast.LENGTH_SHORT).show(); } else { sendLikeNotification(application, sendLike); } } else if (likeButton == HugButtonMain) { hugCounter++; hug_counter.setText(NumberFormat.getIntegerInstance().format(hugCounter)); String sendLike = "senderid@" + MySharedPreferences.getUserId(preferences) + "_contactId@" + myList.get(0).getIdUserName() + "_postId@" + postId + "_click@" + "2"; sendLikeToServer(application, 0, 1, 0, 0, "clicked hug button"); if (MySharedPreferences.getUserId(preferences).equals(myList.get(0).getIdUserName())){ Toast.makeText(this, "same user", Toast.LENGTH_SHORT).show(); } else { sendLikeNotification(application, sendLike); } } else if (likeButton == SameButtonMain) { sameCounter++; same_counter.setText(NumberFormat.getIntegerInstance().format(sameCounter)); String sendLike = "senderid@" + MySharedPreferences.getUserId(preferences) + "_contactId@" + myList.get(0).getIdUserName() + "_postId@" + postId + "_click@" + "3"; sendLikeToServer(application, 0, 0, 1, 0, "clicked same button"); if (MySharedPreferences.getUserId(preferences).equals(myList.get(0).getIdUserName())){ Toast.makeText(this, "same user", Toast.LENGTH_SHORT).show(); } else { sendLikeNotification(application, sendLike); } } } @Override public void unLiked(LikeButton likeButton) { processLoggedState(likeButton); if (doDislike) return; try { if (myClickListener != null) { return; } else { Toast.makeText(likeButton.getContext(), "Click Event Null", Toast.LENGTH_SHORT).show(); } } catch (NullPointerException e) { Toast.makeText(likeButton.getContext(), "Click Event Null Ex", Toast.LENGTH_SHORT).show(); } if (likeButton == likeButtonMain) { likeCounter--; like_counter.setText(NumberFormat.getIntegerInstance().format(likeCounter)); sendUnlikeToServer(application, 0, 1, 1, 1, "clicked unlike button"); } else if (likeButton == HugButtonMain) { hugCounter--; hug_counter.setText(NumberFormat.getIntegerInstance().format(hugCounter)); sendUnlikeToServer(application, 1, 0, 1, 1, "clicked unlike button"); } else if (likeButton == SameButtonMain) { sameCounter--; same_counter.setText(NumberFormat.getIntegerInstance().format(sameCounter)); sendUnlikeToServer(application, 1, 1, 0, 1, "clicked unlike button"); } } protected void sendLikeToServer(final VoicemeApplication application, int like, int hug, int same, int listen, final String message) { application.getWebService().likes(MySharedPreferences.getUserId(preferences), postId, like, hug, same, listen) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new BaseSubscriber<LikesResponse>() { @Override public void onNext(LikesResponse likesResponse) { Toast.makeText(application, message, Toast.LENGTH_SHORT).show(); } }); } protected void sendLikeNotification(final VoicemeApplication application, String likeUrl) { application.getWebService() .sendLikeNotification(likeUrl) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new BaseSubscriber<String>() { @Override public void onNext(String response) { Timber.d("Got user details"); // followers.setText(String.valueOf(response.size())); // Toast.makeText(ChangeProfileActivity.this, "Message Sent", Toast.LENGTH_SHORT).show(); // Timber.d("Message from server" + response); } }); } protected void sendUnlikeToServer(final VoicemeApplication application, int like, int hug, int same, int listen, final String message) { application.getWebService().unlikes(MySharedPreferences.getUserId(preferences), postId, like, hug, same, listen) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new BaseSubscriber<LikesResponse>() { @Override public void onNext(LikesResponse likesResponse) { Toast.makeText(application, message, Toast.LENGTH_SHORT).show(); } }); } @Override public boolean processLoggedState(View viewPrm) { if (this.mBaseLoginClass.isDemoMode(viewPrm)) { l.a(666); if (!viewPrm.getClass().getCanonicalName().contains(("LikeButton"))) Toast.makeText(viewPrm.getContext(), "You aren't logged in", Toast.LENGTH_SHORT).show(); else doDislike = true; return true; } return false; } }
mauriciord/expo
packages/expo-google-sign-in/src/GoogleSignIn.js
// @flow import AuthData from './AuthData'; import Authentication from './Authentication'; import Identity from './Identity'; import User from './User'; import ExpoGoogleSignIn from './ExpoGoogleSignIn'; const { ERRORS, SCOPES, TYPES } = ExpoGoogleSignIn; export type GoogleSignInType = 'default' | 'games'; export type GoogleSignInOptions = { scopes: ?Array<string>, webClientId: ?string, hostedDomain: ?string, accountName: ?string, // Android signInType: ?GoogleSignInType, isOfflineEnabled: ?boolean, isPromptEnabled: ?boolean, // iOS clientId: ?string, language: ?string, openIdRealm: ?string, }; export type GoogleSignInAuthResultType = 'success' | 'cancel'; export type GoogleSignInAuthResult = { type: GoogleSignInAuthResultType, user: ?User, }; export type GoogleSignInPlayServicesOptions = { shouldUpdate: boolean, }; export class GoogleSignIn { _initialization: Promise; _currentUser: User; get ERRORS() { return ERRORS; } get SCOPES() { return SCOPES; } get TYPES() { return TYPES; } get AuthData() { return AuthData; } get Authentication() { return Authentication; } get Identity() { return Identity; } get User() { return User; } get currentUser(): ?User { return this._currentUser; } _setCurrentUser(currentUser: ?User): User { this._currentUser = currentUser; return this._currentUser; } _validateOptions = (options: ?GoogleSignInOptions): GoogleSignInOptions => { if (!options || !Object.keys(options).length) { throw new Error('GoogleSignIn: you must provide a meaningful configuration, empty provided'); } if (options.offlineAccess && !options.webClientId) { throw new Error('GoogleSignIn: Offline access requires server `webClientId`'); } const DEFAULT_SCOPES = [SCOPES.PROFILE, SCOPES.EMAIL]; return { ...options, scopes: options.scopes || DEFAULT_SCOPES, }; }; _invokeAuthMethod = async (method: string): Promise<?GoogleSignInAuthResult> => { await this._ensureGoogleIsInitializedAsync(); const payload = await ExpoGoogleSignIn[method](); let account = payload != null ? new User(payload) : null; return this._setCurrentUser(account); }; askForPlayServicesAsync = (): Promise<boolean> => { return this.arePlayServicesAvailableAsync({ shouldUpdate: true }); }; arePlayServicesAvailableAsync = async ( options?: GoogleSignInPlayServicesOptions = { shouldUpdate: false } ): Promise<boolean> => { if (ExpoGoogleSignIn.arePlayServicesAvailableAsync) { if (options && options.shouldUpdate === undefined) { throw new Error( 'ExpoGoogleSignIn: Missing property `shouldUpdate` in options object for `shouldUpdate`' ); } return ExpoGoogleSignIn.arePlayServicesAvailableAsync(options.shouldUpdate); } else { return true; } }; initAsync = async (options: ?GoogleSignInOptions): Promise<any> => { this.options = this._validateOptions(options || this.options); const hasPlayServices = await this.arePlayServicesAvailableAsync(); if (!hasPlayServices) { return false; } this._initialization = ExpoGoogleSignIn.initAsync(this.options); return this._initialization; }; /* TODO: Bacon: Maybe we should throw an error: "attempting to ... before Google has been initialized" */ _ensureGoogleIsInitializedAsync = async (options: ?GoogleSignInOptions): Promise<any> => { if (this._initialization == null) { return this.initAsync(options); } return this._initialization; }; isSignedInAsync = async (): Promise<boolean> => { const user = await this.getCurrentUserAsync(); return user != null; }; isConnectedAsync = async (): Promise<boolean> => { return ExpoGoogleSignIn.isConnectedAsync(); }; signInSilentlyAsync = async (): Promise<?User> => { const isConnected = await this.isConnectedAsync(); if (isConnected) { try { const auth = await this._invokeAuthMethod('signInSilentlyAsync'); return auth; } catch (error) { // Android parity if (error.code === ERRORS.SIGN_IN_REQUIRED) { return null; } throw error; } } return null; }; signInAsync = async (): Promise<?GoogleSignInAuthResult> => { try { const user = await this._invokeAuthMethod('signInAsync'); return { type: 'success', user }; } catch (error) { if (error.code === ERRORS.SIGN_IN_CANCELLED) { return { type: 'cancel', user: null }; } throw error; } }; signOutAsync = (): Promise => this._invokeAuthMethod('signOutAsync'); disconnectAsync = (): Promise => this._invokeAuthMethod('disconnectAsync'); getCurrentUserAsync = (): Promise<?User> => this._invokeAuthMethod('getCurrentUserAsync'); getPhotoAsync = async (size: number = 128): Promise<?string> => { await this._ensureGoogleIsInitializedAsync(); return ExpoGoogleSignIn.getPhotoAsync(size); }; } export default new GoogleSignIn();
DioSpace/MyAndroid
service1/src/main/java/com/myself/learnservice/MainActivity.java
<reponame>DioSpace/MyAndroid package com.myself.learnservice; import androidx.appcompat.app.AppCompatActivity; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.Bundle; import android.os.IBinder; import android.util.Log; import android.view.View; import static java.lang.Thread.sleep; /* 至于startservice和bindservice的使用场景,有网友这么说: 1.通过startservice开启的服务.一旦服务开启, 这个服务和开启他的调用者之间就没有任何的关系了. 调用者不可以访问 service里面的方法. 调用者如果被系统回收了或者调用了ondestroy方法, service还会继续存在。 2.通过bindService开启的服务,服务开启之后,调用者和服务之间 还存在着联系 , 一旦调用者挂掉了.service也会跟着挂掉。 注意:bindServices一定要调用unbindServices方法,否则会抛出一个serviceConnection泄露异常 * */ public class MainActivity extends AppCompatActivity implements ServiceConnection { static String TAG = "10001"; private Intent intent; int num = 0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); intent = new Intent(MainActivity.this, MyService.class); } //启动服务按钮的点击方法 public void startFunc(View view) { Log.e(TAG, "MainActivity ----> startFunc"); //startService启动后 Service中的onStartCommand就会调用 startService(intent); } //停止服务按钮的点击方法 public void stopFunc(View view) { Log.e(TAG, "MainActivity ---> stopFunc"); stopService(intent); } //绑定服务的按钮方法 public void bindFunc(View view) { Log.e(TAG, "MainActivity ---> bindFunc"); bindService(intent, this, Context.BIND_AUTO_CREATE); } //解除绑定服务的按钮方法 public void unBindFunc(View view) { Log.e(TAG, "MainActivity ---> unBindFunc\" + \"服务解除绑定执行"); unbindService(this); } //服务被绑定成功时执行 @Override public void onServiceConnected(ComponentName name, IBinder service) { Log.e(TAG, "服务绑定成功"); Thread thread = new Thread(new Runnable() { @Override public void run() { while (true) { Log.e(TAG, "onServiceConnected() ----> " + num + "号==任务==正在运行... "); num++; try { sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } } } }); thread.start(); } //服务被杀掉或服务崩溃时执行 @Override public void onServiceDisconnected(ComponentName name) { Log.e(TAG, "服务被杀掉或服务崩溃"); } }
abelard2008/overlog
debugger/tableTracer.h
/* * @(#)$Id$ * * Copyright (c) 2005 Intel Corporation. All rights reserved. * * This file is distributed under the terms in the attached INTEL-LICENSE file. * If you do not find these files, copies can be found by writing to: * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, * Berkeley, CA, 94704. Attention: Intel License Inquiry. * Or * UC Berkeley EECS Computer Science Division, 387 Soda Hall #1776, * Berkeley, CA, 94707. Attention: P2 Group. * * DESCRIPTION: Element that wraps around a table and exports a stream * of the operations that the table performs, presumably to log or * otherwise utilize. * * It appears as a subclass of Table and Element. It passes through all * table operations. As an element it has 0 inputs and a single push * output. */ #ifndef __TABLETRACER_H__ #define __TABLETRACER_H__ #include "element.h" #include "table2.h" #include "val_tuple.h" class TableTracer : public Table2 { public: TableTracer(string tableName, Key& key, uint32_t maxSize, boost::posix_time::time_duration& lifetime); TableTracer(string tableName, Key& key, uint32_t maxSize, string lifetime); TableTracer(string tableName, Key& key, uint32_t maxSize); TableTracer(string tableName, Key& key); ~TableTracer(); /** Lookup overload. Pushes out all requests. */ Iterator lookup(Key& lookupKey, Key& indexKey, TuplePtr t); /** Lookup overload. Pushes out all requests. */ Iterator lookup(Key& indexKey, TuplePtr t); /** My element interface */ class TableTracerElement : public Element { public: /** My typical element constructor */ TableTracerElement(string instanceName, unsigned ninputs, unsigned noutputs, TableTracer* tt); const char* class_name() const {return "TableTracerElement";} const char* processing() const {return "/h";} const char* flow_code() const {return "/-"; } private: /** My containing table tracer */ TableTracer* _tt; }; /** Fetch my element face */ ElementPtr getElementPtr(); private: /** My actual element */ ElementPtr _e; }; #endif /* __TABLETRACER_H_ */
vcabbage/todd
agent/responses/responses.go
<filename>agent/responses/responses.go<gh_stars>0 /* ToDD agent responses These are asynchronous responses sent back to the server, usually as a response to a task. Not all tasks result in an agent sending a response to the server. Responses are for highly sensitive operations like test distribution and execution. Copyright 2016 <NAME>. Use or modification of this source code is governed by the license provided here: https://github.com/Mierdin/todd/blob/master/LICENSE */ package responses // Response is an interface to define Response behavior type Response interface{} // BaseResponse is a struct that is intended to be embedded by specific response structs. Both of these in conjunction // are used primarily to house the JSON message for passing responses over the comms package (i.e. message queue), but may also contain important // dependencies of the response, such as an HTTP handler. type BaseResponse struct { AgentUuid string `json:"agentuuid"` Type string `json:"type"` }
jelc/JAK
widgets/easy_tooltip/easy_tooltip.js
/** * @overview Universal tooltip */ /** * @class Widget Tooltip zobrazuje bublinu u prvku v závislosti definovaných na akcích (hover/click atd). * @group jak-widgets */ JAK.Easy_Tooltip = JAK.ClassMaker.makeClass({ NAME: "JAK.Easy_Tooltip", VERSION: "1.0" }); /** * Konstruktor tooltipu. * Alespoň jeden z parametrů content/contentElm/contentFromAttribute musí být zadán (jinak jsou všechny parametry volitelné). * * @param {object} optObj Asociativní pole parametrů nastavujících tooltip * * @param {string} [optObj.content] Text nebo HTML, které se má zobrazit v tooltipu * @param {string/node reference} [optObj.contentElm] Určuje element ve stránce, který se má použít jako obsah tooltipu. Parametr může být string (IDčko elementu), nebo přímo reference na element. Pokud chceme mít ve stránce tento element neviditelný, nastavíme mu display:none a zobrazíme ho až bude v tooltipu (třeba přes selector .jak-tooltip #elmId) * @param {string} [optObj.contentFromAttribute] Můžeme obsah tooltipu zobrazovat i z libovolného atributu elementu, který tooltip spouští. Například po najetí myší na obrázek se zobrazí v tooltipu jeho title. Předmětem tohoto parametru je název atributu, ze kterého se má text použít. * @param {string} [optObj.cssQuery] CSS 1 selector, který určuje, na které elementy se má tooltip navázat * @param {string} [optObj.defaultPosition="bottom"] Kde chceme tooltip defaultně zobrazovat. Povolené hodnoty jsou top, right, bottom a left. Pokud tooltip nemá dost místa na zobrazení (v rámci průhledu stránky), pozice se invertuje (bottom => top, right => left atd.) * @param {bool} [optObj.forceDefaultPosition=false] Nastaveno na true zakáže invertování pozice, pokud se na zvolené místo tooltip nevejde (tzn. při nastaveném true se nebude automaticky měnit nastavený defaultPosition) * @param {string[]} [optObj.showMethods=['mouseover']] Pole názvů eventů, na jejichž základě se má tooltip spouštět. * @param {string[]} [optObj.hideMethods=['mouseout']] Pole názvů eventů, na jejichž základě se má tooltip skrývat. * @param {bool} [optObj.noHideOverTooltip=false] Schovat tooltip pokud ze spouštěcího elementu najedeme nad tooltip samotný? (kopírování textu z tooltipu, proklik odkazu v tooltipu apod.) * @param {int} [optObj.top=0] Relativní posun tooltipu po y-ové souřadnici (od místa, kde by se jinak zobrazil) * @param {int} [optObj.left=0] Relativní posun tooltipu po x-ové souřadnici (od místa, kde by se jinak zobrazil) * @param {int} [optObj.showDelay=0] Za jak dlouho se má tooltip po spouštěcí akci (showMethods) zobrazit (v milisekundách) * @param {int} [optObj.hideDelay=0] Za jak dlouho se má tooltip po skrývací akci (hideMethods) skrýt (v milisekundách) * @param {string} [optObj.tooltipId] Určuje, jaké chceme ID kontejneru tooltipu * @param {int/string} [optObj.width=200] Šířka tooltipu včetně borderu. Lze zadat hodnotu 'auto' pro automatickou šířku podle obsahu. * @param {int} [optObj.maxWidth=320] Omezení maximální šířky tooltipu při použití width='auto' (včetně borderu). * @param {bool} [optObj.showDirectionalArrow=true] Informace, zdali se má ze spritu použít směrová šipka (nepodstatné, pokud sprite žádné šipky neobsahuje) * @param {string/node reference} [optObj.parentElm] Do jakého kontejneru se má tooltip vložit (string = ID elementu, reference, null = vložit do BODY). Je nutné, aby element byl rodičem prvku, který spouští tooltip. Rodič by měl mít position relative nebo absolute pro správné pozicování tooltipu. */ JAK.Easy_Tooltip.prototype.$constructor = function(optObj) { // defaultní nastavení this.options = { content: null, contentElm: null, contentFromAttribute: null, cssQuery: null, defaultPosition: 'bottom', forceDefaultPosition: false, showMethods: ['mouseover'], hideMethods: ['mouseout'], noHideOverTooltip: false, top: 0, left: 0, showDelay: 0, hideDelay: 0, tooltipId: '', width: 200, showDirectionalArrow: true, parentElm: null, userPosFunction: null, arrowSize: null, offset: 2, // [px] css: '/js/widgets/easy_tooltip/easy_tooltip.css' }; // aplikace nastavení for (var p in optObj) { this.options[p] = optObj[p]; } // místo pro uložení vypočtených hodnot this._saved = { 'arrow': null } // pokud se má tooltip házet do nějakého prvku, získám si na něj referenci this.options.parentElm = JAK.gel(this.options.parentElm); // pokud se má pro obsah tooltipu použít element ve stránce, získám si na něj referenci this.options.contentElm = JAK.gel(this.options.contentElm); // kontrola povinných parametrů if(!this.options.content && !this.options.contentElm && !this.options.contentFromAttribute) { throw new Error('[JAK.Tooltip] Není nastaven žádný zdroj, odkud si tooltip může získat svůj obsah. Zadejte některé z nastavení content/contentElm/contentFromAttribute v konstruktoru.'); } // end // přidám styly if (this.options.css) { var place2put = (typeof document.head === "object") ? document.head : document.body; // hack for IE 8 var alreadyAdded = place2put.querySelector("[name='jak_tooltip']"); if (!alreadyAdded) { var elmStyle = document.createElement("link"); elmStyle.href = this.options.css; elmStyle.name = 'jak_tooltip'; elmStyle.setAttribute('rel', 'stylesheet'); if (place2put === document.body) { place2put.insertBefore(elmStyle, place2put.children[0]); } else { place2put.appendChild(elmStyle); } } } this.ec = []; // používá se pro evidenci eventů, abych je mohl odvěsit v destructoru this.dom = {}; // v tomto objektu budou všechny elementy tooltipu, které jsou nakonec appendnuty do finálního kontejneru this.dom.tooltip // navěsím na všechny požadované elementy příslušné spouštěcí a vypínací metody if(this.options.cssQuery) { var dispatcherElms = JAK.query(this.options.cssQuery); for(var i = 0; i < dispatcherElms.length; i++) { // spouštěcí eventy for(var j = 0; j < this.options.showMethods.length; j++) { this.ec.push(JAK.Events.addListener(dispatcherElms[i], this.options.showMethods[j], this, "_showOnDomReady")); } // vypínací eventy for(var j = 0; j < this.options.hideMethods.length; j++) { this.ec.push(JAK.Events.addListener(dispatcherElms[i], this.options.hideMethods[j], this, "_hide")); } } } // end }; /** * Funkce pro zobrazení tooltipu * Pokud ještě není domReady, tooltip se zobrazí až na onDomReady (kvůli správnému výpočtu odscrollování). * Pokud už je domReady, tooltip se zobrazí až za showDelay. * * @param {string/node reference} dispatcherElm Povinný parametr. Element, který spustil zobrazení tooltipu (k němu bude tooltip pozicován) */ JAK.Easy_Tooltip.prototype.show = function(dispatcherElm) { this._showOnDomReady(null, dispatcherElm); }; /** * Funkce rozhoduje, kdy zobrazit tooltip (na onDomReady/za stanovený čas/ihned) * * @param {string/node reference} dispatcherElm Povinný parametr. Element, který spustil zobrazení tooltipu (k němu bude tooltip pozicován) */ JAK.Easy_Tooltip.prototype._showOnDomReady = function(e, dispatcherElm) { // pokud se čeká na skrytí nebo zobrazení tooltipu, vymažu timeout this._clearDelays(); if(/in/.test(document.readyState)) { // not dom ready var showFunc = this._showTooltip.bind(this, e, dispatcherElm); JAK.Events.onDomReady(null, showFunc); } else { // dom ready if(this.options.showDelay) { // zobrazím tooltip až za definovaný čas var showFunc = this._showTooltip.bind(this, e, dispatcherElm); this.showHideTimeout = setTimeout(showFunc, this.options.showDelay); } else { // zobrazím tooltip hned this._showTooltip(e, dispatcherElm); } } }; /** * Funkce zavolá vybuildění tooltipu, jeho napozicování a vloží jej do stránky * * @param {string/node reference} dispatcherElm Povinný parametr. Element, který spustil zobrazení tooltipu (k němu bude tooltip pozicován) */ JAK.Easy_Tooltip.prototype._showTooltip = function(e, dispatcherElm) { var that = this; // pokud se čeká na skrytí nebo zobrazení tooltipu, vymažu timeout this._clearDelays(); // pokusím se najít element, který spustil tooltip dispatcherElm = JAK.gel(dispatcherElm); if(!dispatcherElm) { throw new Error('[JAK.Tooltip] Element, který spustil tooltip, není definován nebo jej nelze nalézt. Pravděpodobně je špatně zadán parametr elm ve volání funkce JAK.Tooltip.show(elm).'); } // pokud již tooltip ve stránce je, odstraním ho if(this.dom.tooltip) { this._hideTooltip(); } // nechám vybuildit tooltip this._buildTooltip(dispatcherElm); // jestli není tooltip vytvořen, něco se nepovedlo if(!this.dom.tooltip) { throw new Error('[JAK.Tooltip] Nepodařilo se vytvořit tooltip.'); } // vložím tooltip do stránky if(this.options.parentElm) { this.options.parentElm.appendChild(this.dom.tooltip); } else { document.body.appendChild(this.dom.tooltip); } // napozicuju tooltip this._setTooltipPosition(dispatcherElm); // --- navěsím událost pro window resize var changePosition = function() { that._setTooltipPosition(dispatcherElm); } var resized = function() { setTimeout(changePosition, 200); } JAK.Events.addListener(window, 'resize', window, resized); }; /** * Funkce zajistí skrytí tooltipu ihned nebo za stanovený čas */ JAK.Easy_Tooltip.prototype._hide = function (e, elm) { if (this.options.noHideOverTooltip) { // nechceme schovávat pokud bylo najeto myší přímo nad tooltip if (JAK.DOM.findParent(e.relatedTarget, ".jak-tooltip")) { return; } } // pokud se čeká na skrytí nebo zobrazení tooltipu, vymažu timeout this._clearDelays(); if(!this.dom.tooltip) { return; } // odstraním tooltip až za zadaný čas nebo ihned (pokud čas nebyl zadán) if(this.options.hideDelay) { this.showHideTimeout = setTimeout(this._hideTooltip.bind(this), this.options.hideDelay); } else { this._hideTooltip(); } }; /** * Skrýt tooltip */ JAK.Easy_Tooltip.prototype.hide = function() { // pokud se čeká na skrytí nebo zobrazení tooltipu, vymažu timeout this._clearDelays(); if (this.dom.tooltip) { this._hideTooltip(); } }; /** * Funkce odstraní tooltip ze stránky */ JAK.Easy_Tooltip.prototype._hideTooltip = function(e) { if(e) { JAK.Events.stopEvent(e); JAK.Events.cancelDef(e); } // pokud se čeká na skrytí nebo zobrazení tooltipu, vymažu timeout this._clearDelays(); // odstraním tooltip ze stránky if(this.options.parentElm) { this.options.parentElm.removeChild(this.dom.tooltip); } else { document.body.removeChild(this.dom.tooltip); } // zruším všechny reference na tooltip for (var p in this.dom) { this.dom[p] = null; } this.dom = {}; }; /** * Funkce vytvoří nový tooltip (much more easier way) * * @param {string} content - Obsah tooltipu (např. "5 litrů je dost") */ JAK.Easy_Tooltip.prototype._buildNewTooltip = function(content) { var arrow_size = (typeof this.options.arrowSize === "number") ? this.options.arrowSize : 10; this._saved.arrow = arrow_size; this.dom.tooltip = document.createElement("div"); this.dom.tooltip.innerHTML = content; this.dom.tooltip.className = 'jak_tooltip'; if (this.options.width === "auto") { this.dom.tooltip.style.whiteSpace = "nowrap"; } if (this.options.tooltipId) { this.dom.tooltip.id = this.options.tooltipId; } var width = this.options.width; var type = typeof width; if (type === "number") { this.dom.tooltip.style.width = width + 'px'; } else if (type === "string" && width !== 'auto') { this.dom.tooltip.style.width = width; } document.body.appendChild(this.dom.tooltip); }; /** * Vytvoří tooltip * * @param {node reference} dispatcherElm Povinný parametr. Element, který spustil zobrazení tooltipu (k němu bude tooltip pozicován) */ JAK.Easy_Tooltip.prototype._buildTooltip = function(dispatcherElm) { // uložím si obsah tooltipu pokud je zadán nebo se má vytáhnout z atributu (pokud ho tahám jako element, vyřeším to později) var content = this.options.content; if (this.options.contentFromAttribute && dispatcherElm) { content = dispatcherElm.getAttribute(this.options.contentFromAttribute); } this._buildNewTooltip(content); // při volbě "noHideOverTooltip" schovávat tooltip při mouseout události if (this.options.noHideOverTooltip) { JAK.Events.addListener(this.dom.tooltip, "mouseout", this, "_hide"); } }; /** * Zjistí rozměry a pozice elementů * * @param {node reference} dispatcherElm - Element, který spustil zobrazení tooltipu (k němu bude tooltip pozicován) */ JAK.Easy_Tooltip.prototype._getPositions = function(dispatcherElm) { // pozice spouštěcího elementu var pos = dispatcherElm.getBoundingClientRect(); var parent_pos = this.options.parentElm.getBoundingClientRect(); var _dispatcherPosition = JAK.DOM.getPosition(dispatcherElm, this.options.parentElm); var elm_height = dispatcherElm.offsetHeight; var dispatcherDimensions = { 'width': dispatcherElm.offsetWidth, 'height': elm_height, 'top': _dispatcherPosition.top, 'left': _dispatcherPosition.left, 'bottom': _dispatcherPosition.top + elm_height }; // vypočítám si absolutní souřadky středu spouštěcího elementu var dispatcherCenter = { 'top': _dispatcherPosition.top + dispatcherDimensions.height/2, 'left': _dispatcherPosition.left + dispatcherDimensions.width/2 }; var tooltipDimensions = { 'width': this.dom.tooltip.offsetWidth, 'height': this.dom.tooltip.offsetHeight }; var viewportDimensions = { 'width': document.documentElement.clientWidth, 'height': document.documentElement.clientHeight }; var dispatcherViewport = { 'top': pos.top, 'left': pos.left, 'bottom': pos.top + elm_height, 'right': pos.left + dispatcherDimensions.width }; var parentViewport = { 'top': parent_pos.top, 'left': parent_pos.left }; return { 'dispatcher': dispatcherDimensions, 'dispatcherCenter': dispatcherCenter, 'tooltipDimensions': tooltipDimensions, 'viewportDimensions': viewportDimensions, 'dispatcherViewport': dispatcherViewport, 'parentViewport': parentViewport }; }; /** * Vypočítá pozice elementu pro absolutní pozicování vůči parent elm. * * @param {dict} calc - dictionary s rozměry a pozicemi * @param {string} position - požadované umístění ('top' / 'right' / 'bottom' / 'left') */ JAK.Easy_Tooltip.prototype._calcTooltipPos = function(calc, position) { var dispatcherDimensions = calc.dispatcher; var dispatcherCenter = calc.dispatcherCenter; var tooltipDimensions = calc.tooltipDimensions; var tooltipRelativeLeft = this.options.left; var tooltipRelativeTop = this.options.top; var offset = this.options.offset; var tooltipLeft = 0; var tooltipRight = 0; var tooltipTop = 0; var tooltipBottom = 0; if (position === 'bottom') { tooltipTop = dispatcherDimensions.bottom + tooltipRelativeTop + this._saved.arrow + offset; tooltipBottom = tooltipTop + tooltipDimensions.height; } else if (position === 'top') { tooltipTop = dispatcherDimensions.top - tooltipDimensions.height + tooltipRelativeTop - this._saved.arrow - offset; tooltipBottom = tooltipTop + tooltipDimensions.height; } else if (position === 'left') { tooltipLeft = dispatcherCenter.left - dispatcherDimensions.width/2 - tooltipDimensions.width + tooltipRelativeLeft - this._saved.arrow - offset; } else if (position === 'right') { tooltipLeft = dispatcherDimensions.left + dispatcherDimensions.width + this._saved.arrow + offset + tooltipRelativeLeft; tooltipRight = tooltipLeft + tooltipDimensions.width; } return { 'left': tooltipLeft, 'right': tooltipRight, 'top': tooltipTop, 'bottom': tooltipBottom }; }; /** * Provede korekci pozice tak, aby šel tooltip vykreslit * * @param {dict} calc - dictionary s rozměry a pozicemi */ JAK.Easy_Tooltip.prototype._corrections = function(calc, dispatcherElm) { var dispatcherCenter = calc.dispatcherCenter; var tooltipDimensions = calc.tooltipDimensions; var viewport = calc.viewportDimensions; var real_dispatcher = calc.dispatcherViewport; var real_parent = calc.parentViewport; // aktuální odscrollování var scrollOffset = JAK.DOM.getScrollPos(); // zjistím, jestli se tooltip vejde do defaultní pozice. Pokud ne, tak pozici invertuju var defaultPosition = this.options.defaultPosition; var actualPosition = defaultPosition; var tooltipRelativeLeft = this.options.left; var tooltipRelativeTop = this.options.top; if ( !this.options.forceDefaultPosition ) { // invertuju pouze v případě, že nemám pozici "nařízenou" napevno var calc_pos = this._calcTooltipPos(calc, defaultPosition); if (defaultPosition === 'bottom') { var tooltip_bottom = real_parent.top + calc_pos.bottom; if (tooltip_bottom > viewport.height) { actualPosition = 'top'; tooltipRelativeTop = (tooltipRelativeTop === 0) ? 0 : -tooltipRelativeTop; } } else if (defaultPosition === 'top') { var tooltip_top = real_parent.top + calc_pos.top; if (tooltip_top < 0) { actualPosition = 'bottom'; tooltipRelativeTop = (tooltipRelativeTop === 0) ? 0 : -tooltipRelativeTop; } } else if (defaultPosition === 'left') { var left_pos = real_parent.left + calc_pos.left; if (left_pos < 0) { actualPosition = 'right'; tooltipRelativeLeft = (tooltipRelativeLeft === 0) ? 0 : -tooltipRelativeLeft; } } else if (defaultPosition === 'right') { var right_pos = real_parent.left + calc_pos.right; if (right_pos > viewport.width) { actualPosition = 'left'; tooltipRelativeLeft = (tooltipRelativeLeft === 0) ? 0 : -tooltipRelativeLeft; } } } var tooltipLeft = 0; var tooltipTop = 0; // Is here enough space? if (actualPosition == 'bottom' || actualPosition == 'top') { tooltipLeft = dispatcherCenter.left - tooltipDimensions.width/2; var delta = viewport.width - (tooltipLeft + tooltipRelativeLeft + tooltipDimensions.width); if (delta < 0) { tooltipLeft += delta; } } else { tooltipTop = dispatcherCenter.top - tooltipDimensions.height/2; } return { 'actual_position': actualPosition, 'relative_top': tooltipRelativeTop, 'relative_left': tooltipRelativeLeft, 'left': tooltipLeft, 'top': tooltipTop }; }; /** * Napozicuje tooltip * * @param {node reference} dispatcherElm Povinný parametr. Element, který spustil zobrazení tooltipu (k němu bude tooltip pozicován) */ JAK.Easy_Tooltip.prototype._setTooltipPosition = function(dispatcherElm) { // zjistím si rozměry a pozice pro další výpočty var calc = this._getPositions(dispatcherElm); // provede korekci pozic, aby se vešel celý var correction = this._corrections(calc, dispatcherElm); var calc_pos = this._calcTooltipPos(calc, correction.actual_position); if (typeof this.options.userPosFunction === "function") { var obj = this.options.userPosFunction(calc, correction); for (var p in optObj) { if (p in correction) { correction[p] = obj[p]; } } } // provede korekci pozic, aby se vešel celý var actualPosition = correction.actual_position; // zjistím souřadnice tooltipu var tooltipLeft = correction.left; var tooltipTop = correction.top; this.dom.tooltip.className = this.dom.tooltip.classList[0]; this.dom.tooltip.classList.add('_' + actualPosition); if (actualPosition == 'bottom') { tooltipTop = calc_pos.top; } else if (actualPosition == 'top') { tooltipTop = calc_pos.top; } else if (actualPosition == 'left') { tooltipLeft = calc_pos.left; } else if (actualPosition == 'right') { tooltipLeft = calc_pos.left; } // nastavím souřadnice tooltipu this.dom.tooltip.style.left = tooltipLeft + correction.relative_left + 'px'; this.dom.tooltip.style.top = tooltipTop + correction.relative_top + 'px'; }; /** * Destruktor třídy */ JAK.Easy_Tooltip.prototype.$destructor = function() { this.hide(); JAK.Events.removeListeners(this.ec); }; /** * Vynuluje probíhající timeout pro zobrazení/skrytí tooltipu */ JAK.Easy_Tooltip.prototype._clearDelays = function() { if (this.showHideTimeout) { clearTimeout(this.showHideTimeout); } };
Miridescen/BWT
Pods/Meiqia/Meiqia-SDK-files/MQChatViewController/TableCells/CellModel/MQImageCellModel.h
<gh_stars>100-1000 // // MQImageCellModel.h // MeiQiaSDK // // Created by ijinmao on 15/10/29. // Copyright © 2015年 MeiQia Inc. All rights reserved. // #import <Foundation/Foundation.h> #import "MQCellModelProtocol.h" #import "MQImageMessage.h" /** * 聊天气泡和其中的图片较大一边的水平间距 */ static CGFloat const kMQCellBubbleToImageHorizontalLargerSpacing = 14.0; /** * 聊天气泡和其中的图片较小一边的水平间距 */ static CGFloat const kMQCellBubbleToImageHorizontalSmallerSpacing = 8.0; /** * 聊天气泡和其中的图片垂直间距 */ static CGFloat const kMQCellBubbleToImageVerticalSpacing = 8.0; /** * MQImageCellModel定义了图片消息的基本类型数据,包括产生cell的内部所有view的显示数据,cell内部元素的frame等 * @warning MQImageCellModel必须满足MQCellModelProtocol协议 */ @interface MQImageCellModel : NSObject <MQCellModelProtocol> /** * @brief cell中消息的id */ @property (nonatomic, readonly, strong) NSString *messageId; /** * @brief 用户名字,暂时没用 */ @property (nonatomic, readonly, copy) NSString *userName; /** * @brief 该cellModel的委托对象 */ @property (nonatomic, weak) id<MQCellModelDelegate> delegate; /** * @brief cell的高度 */ @property (nonatomic, readonly, assign) CGFloat cellHeight; /** * @brief 图片image(当imagePath不存在时使用) */ @property (nonatomic, readonly, strong) UIImage *image; /** * bubble中的imageView的frame,该frame是在关闭bubble mask情况下生效 */ @property (nonatomic, readonly, assign) CGRect contentImageViewFrame; /** * @brief 消息的时间 */ @property (nonatomic, readonly, copy) NSDate *date; /** * @brief 发送者的头像Path */ @property (nonatomic, readonly, copy) NSString *avatarPath; /** * @brief 发送者的头像的图片 */ @property (nonatomic, readonly, copy) UIImage *avatarImage; /** * @brief 聊天气泡的image(该气泡image已经进行了resize) */ @property (nonatomic, readonly, copy) UIImage *bubbleImage; /** * @brief 消息气泡的frame */ @property (nonatomic, readonly, assign) CGRect bubbleImageFrame; /** * @brief 发送者的头像frame */ @property (nonatomic, readonly, assign) CGRect avatarFrame; /** * @brief 发送状态指示器的frame */ @property (nonatomic, readonly, assign) CGRect sendingIndicatorFrame; /** * @brief 读取照片的指示器的frame */ @property (nonatomic, readonly, assign) CGRect loadingIndicatorFrame; /** * @brief 发送出错图片的frame */ @property (nonatomic, readonly, assign) CGRect sendFailureFrame; /** * @brief 消息的来源类型 */ @property (nonatomic, readonly, assign) MQChatCellFromType cellFromType; /** * @brief 消息的发送状态 */ @property (nonatomic, assign) MQChatMessageSendStatus sendStatus; - (void)showImageViewerFromRect:(CGRect)rect; /** * 根据MQMessage内容来生成cell model */ - (MQImageCellModel *)initCellModelWithMessage:(MQImageMessage *)message cellWidth:(CGFloat)cellWidth delegate:(id<MQCellModelDelegate>)delegator; @end
naustudio/date-fns
src/isValid/test.js
<reponame>naustudio/date-fns<gh_stars>0 // @flow /* eslint-env mocha */ import assert from 'power-assert' import isValid from '.' describe('isValid', function () { it('returns true if the given date is valid', function () { var result = isValid(new Date()) assert(result === true) }) it('returns false if the given date is invalid', function () { var result = isValid(new Date('')) assert(result === false) }) it('accepts a string', function () { assert(isValid(new Date(2014, 6 /* Jul */, 8).toString()) === true) assert(isValid('') === false) }) it('accepts a timestamp', function () { assert(isValid(new Date(2014, 1 /* Feb */, 11).getTime()) === true) assert(isValid(NaN) === false) }) it('throws `RangeError` if `options.additionalDigits` is not convertable to 0, 1, 2 or undefined', function () { // $ExpectedMistake var block = isValid.bind(null, new Date(), {additionalDigits: NaN}) assert.throws(block, RangeError) }) it('throws TypeError exception if passed less than 1 argument', function () { assert.throws(isValid.bind(null), TypeError) }) })
NifTK/NifTK
Libraries/ITK/Testing/Segmentation/MIDASIrregularVolumeEditor/itkMIDASRegionOfInterestCalculatorTest.cxx
<reponame>NifTK/NifTK /*============================================================================= NifTK: A software platform for medical image computing. Copyright (c) University College London (UCL). All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt in the top level directory for details. =============================================================================*/ #if defined(_MSC_VER) #pragma warning ( disable : 4786 ) #endif #include <iostream> #include <memory> #include <math.h> #include <itkImage.h> #include <itkMIDASHelper.h> #include <itkMIDASRegionOfInterestCalculator.h> /** * Basic tests for itkMIDASRegionOfInterestCalculator */ int itkMIDASRegionOfInterestCalculatorTest(int argc, char * argv[]) { typedef itk::Image<unsigned char, 3> ImageType; typedef itk::MIDASRegionOfInterestCalculator<unsigned char, 3> CalculatorType; typedef ImageType::RegionType RegionType; typedef ImageType::SizeType SizeType; typedef ImageType::IndexType IndexType; /********************************************************** * Normal, default ITK image, should be RAI * i.e. * 1 0 0 * 0 1 0 == RAI * 0 0 1 **********************************************************/ CalculatorType::Pointer calculator = CalculatorType::New(); //calculator->DebugOn(); ImageType::Pointer image = ImageType::New(); std::string orientation = calculator->GetOrientationString(image); if (orientation != "RAI") { std::cerr << "Expected RAI, but got:" << orientation << " from direction=\n" << image->GetDirection() << std::endl; return EXIT_FAILURE; } int axis = calculator->GetAxis(image, itk::ORIENTATION_AXIAL); if (axis != 2) { std::cerr << "Expected 2, but got:" << axis << std::endl; return EXIT_FAILURE; } axis = calculator->GetAxis(image, itk::ORIENTATION_SAGITTAL); if (axis != 0) { std::cerr << "Expected 0, but got:" << axis << std::endl; return EXIT_FAILURE; } axis = calculator->GetAxis(image, itk::ORIENTATION_CORONAL); if (axis != 1) { std::cerr << "Expected 1, but got:" << axis << std::endl; return EXIT_FAILURE; } int direction = 0; direction = calculator->GetPlusOrUpDirection(image, itk::ORIENTATION_AXIAL); if (direction != -1) { std::cerr << "Expected -1, but got:" << direction << std::endl; return EXIT_FAILURE; } direction = calculator->GetPlusOrUpDirection(image, itk::ORIENTATION_SAGITTAL); if (direction != -1) { std::cerr << "Expected -1, but got:" << direction << std::endl; return EXIT_FAILURE; } direction = calculator->GetPlusOrUpDirection(image, itk::ORIENTATION_CORONAL); if (direction != -1) { std::cerr << "Expected -1, but got:" << direction << std::endl; return EXIT_FAILURE; } SizeType size; size.Fill(256); IndexType voxelIndex; voxelIndex.Fill(0); RegionType region; region.SetSize(size); region.SetIndex(voxelIndex); image->SetRegions(region); image->Allocate(); image->FillBuffer(0); region = calculator->GetPlusOrUpRegion(image, itk::ORIENTATION_AXIAL, 10); size = region.GetSize(); voxelIndex = region.GetIndex(); if (size[0] != 256 || size[1] != 256 || size[2] != 10 || voxelIndex[0] != 0 || voxelIndex[1] != 0 || voxelIndex[2] != 0) { std::cerr << "Expected 256, 256, 10, 0, 0, 0, but got:\n" << region << std::endl; return EXIT_FAILURE; } region = calculator->GetMinusOrDownRegion(image, itk::ORIENTATION_AXIAL, 10); size = region.GetSize(); voxelIndex = region.GetIndex(); if (size[0] != 256 || size[1] != 256 || size[2] != 245 || voxelIndex[0] != 0 || voxelIndex[1] != 0 || voxelIndex[2] != 11) { std::cerr << "Expected 256, 256, 245, 0, 0, 11, but got:\n" << region << std::endl; return EXIT_FAILURE; } region = calculator->GetPlusOrUpRegion(image, itk::ORIENTATION_CORONAL, 10); size = region.GetSize(); voxelIndex = region.GetIndex(); if (size[0] != 256 || size[1] != 10 || size[2] != 256 || voxelIndex[0] != 0 || voxelIndex[1] != 0 || voxelIndex[2] != 0) { std::cerr << "Expected 256, 10, 256, 0, 0, 0, but got:\n" << region << std::endl; return EXIT_FAILURE; } region = calculator->GetMinusOrDownRegion(image, itk::ORIENTATION_CORONAL, 10); size = region.GetSize(); voxelIndex = region.GetIndex(); if (size[0] != 256 || size[1] != 245 || size[2] != 256 || voxelIndex[0] != 0 || voxelIndex[1] != 11 || voxelIndex[2] != 0) { std::cerr << "Expected 256, 245, 256, 0, 11, 0, but got:\n" << region << std::endl; return EXIT_FAILURE; } region = calculator->GetPlusOrUpRegion(image, itk::ORIENTATION_SAGITTAL, 10); size = region.GetSize(); voxelIndex = region.GetIndex(); if (size[0] != 10 || size[1] != 256 || size[2] != 256 || voxelIndex[0] != 0 || voxelIndex[1] != 0 || voxelIndex[2] != 0) { std::cerr << "Expected 10, 256, 256, 0, 0, 0, but got:\n" << region << std::endl; return EXIT_FAILURE; } region = calculator->GetMinusOrDownRegion(image, itk::ORIENTATION_SAGITTAL, 10); size = region.GetSize(); voxelIndex = region.GetIndex(); if (size[0] != 245 || size[1] != 256 || size[2] != 256 || voxelIndex[0] != 11 || voxelIndex[1] != 0 || voxelIndex[2] != 0) { std::cerr << "Expected 245, 256, 256, 11, 0, 0, but got:\n" << region << std::endl; return EXIT_FAILURE; } region = calculator->GetSliceRegion(image, itk::ORIENTATION_AXIAL, 10); size = region.GetSize(); voxelIndex = region.GetIndex(); if (size[0] != 256 || size[1] != 256 || size[2] != 1 || voxelIndex[0] != 0 || voxelIndex[1] != 0 || voxelIndex[2] != 10) { std::cerr << "Expected 256, 256, 1, 0, 0, 10, but got:\n" << region << std::endl; return EXIT_FAILURE; } region = calculator->GetSliceRegion(image, itk::ORIENTATION_CORONAL, 10); size = region.GetSize(); voxelIndex = region.GetIndex(); if (size[0] != 256 || size[1] != 1 || size[2] != 256 || voxelIndex[0] != 0 || voxelIndex[1] != 10 || voxelIndex[2] != 0) { std::cerr << "Expected 256, 1, 256, 0, 10, 0, but got:\n" << region << std::endl; return EXIT_FAILURE; } region = calculator->GetSliceRegion(image, itk::ORIENTATION_SAGITTAL, 10); size = region.GetSize(); voxelIndex = region.GetIndex(); if (size[0] != 1 || size[1] != 256 || size[2] != 256 || voxelIndex[0] != 10 || voxelIndex[1] != 0 || voxelIndex[2] != 0) { std::cerr << "Expected 1, 256, 256, 10, 0, 0, but got:\n" << region << std::endl; return EXIT_FAILURE; } return EXIT_SUCCESS; }
wheatandcat/dotstamp_client
src/js/redux/message/actions/show.js
<reponame>wheatandcat/dotstamp_client // @flow import * as types from "../../../constants/ActionTypes" /** * 初期化する */ export function init() { return { type: types.INIT_MESSAGE_SHOW } } /** * 文言を表示する */ export function message(message: string, style: number) { return { type: types.OPEN_MESSAGE_SHOW, message, style } } /** * 閉じる */ export function close() { return { type: types.CLOSE_MESSAGE_SHOW } }
shannliu/nju-judge
judge-core/src/main/java/cn/edu/nju/software/judge/aspect/SubmissionAspect.java
package cn.edu.nju.software.judge.aspect; import cn.edu.nju.software.judge.constant.RedisConstants; import cn.edu.nju.software.judge.model.SubmissionModel; import cn.edu.nju.software.judge.submission.RedisSubmission; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; /** * //////////////////////////////////////////////////////////////////// * // _ooOoo_ // * // o8888888o // * // 88" . "88 // * // (| ^_^ |) // * // O\ = /O // * // ____/`---'\____ // * // .' \\| |// `. // * // / \\||| : |||// \ // * // / _||||| -:- |||||- \ // * // | | \\\ - /// | | // * // | \_| ''\---/'' | | // * // \ .-\__ `-` ___/-. / // * // ___`. .' /--.--\ `. . ___ // * // ."" '< `.___\_<|>_/___.' >'"". // * // | | : `- \`.;`\ _ /`;.`/ - ` : | | // * // \ \ `-. \_ __\ /__ _/ .-` / / // * // ========`-.____`-.___\_____/___.-`____.-'======== // * // `=---=' // * // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // * // 佛祖保佑 永不宕机 永无BUG // * //////////////////////////////////////////////////////////////////// */ @Aspect @Component public class SubmissionAspect { private static final Logger LOG = LoggerFactory.getLogger(SubmissionAspect.class); @Autowired private RedisTemplate redisTemplate; @Around("execution(* addSubmission(..))") public Object addSubmissionToRedis(ProceedingJoinPoint proceedingJoinPoint){ try { Object proceed = proceedingJoinPoint.proceed(); if(proceed instanceof SubmissionModel){ SubmissionModel model = (SubmissionModel) proceed; RedisSubmission redisSubmission = new RedisSubmission(); redisSubmission.setLanguage(model.getLanguage()); redisSubmission.setMemory(model.getMemory()); redisSubmission.setTime(model.getTime()); redisSubmission.setProblemId(model.getProblemId()); redisSubmission.setRunId(model.getSubmissionId()); redisSubmission.setUserId(model.getUserId()); redisSubmission.setSource(model.getSource()); redisSubmission.setType(model.getJudgeType()); redisTemplate.opsForList().rightPush(RedisConstants.JUDGE_LIST_KEY,redisSubmission); } return proceed; }catch (Throwable e){ LOG.error("addSubmissionToRedis fail",e); throw new RuntimeException(e); } } }
chronos-tachyon/mojo
net/unix.cc
// Copyright © 2016 by <NAME> <<EMAIL>> // Available under the MIT License. See LICENSE for details. #include "net/unix.h" #include <arpa/inet.h> #include <netdb.h> #include <sys/socket.h> #include <sys/types.h> #include <sys/un.h> #include <unistd.h> #include <cerrno> #include <cstring> #include <map> #include <mutex> #include "base/logging.h" #include "net/addr.h" #include "net/conn.h" #include "net/connfd.h" #include "net/protocol.h" #include "net/registry.h" #ifndef UNIX_PATH_MAX #define UNIX_PATH_MAX (sizeof(sockaddr_un) - sizeof(sa_family_t)) #endif using P = net::ProtocolType; namespace net { namespace { static const std::map<std::string, ProtocolType>& protomap() { static const auto& ref = *new std::map<std::string, ProtocolType>{ {"unix", P::stream}, {"unixgram", P::datagram}, {"unixpacket", P::seqpacket}, }; return ref; } class UnixAddr : public AddrImpl { public: UnixAddr(ProtocolType p, const sockaddr_un* ptr, socklen_t len) : len_(len), protocol_(p) { CHECK_GE(len, sizeof(sa_family_t)); CHECK_LE(len, sizeof(sockaddr_un)); CHECK_EQ(ptr->sun_family, AF_UNIX); ::memcpy(&sun_, ptr, len); } std::string protocol() const override { switch (protocol_) { case P::stream: return "unix"; case P::datagram: return "unixgram"; case P::seqpacket: return "unixpacket"; default: LOG(DFATAL) << "BUG! Unknown protocol: " << protocol_; return ""; } } ProtocolType protocol_type() const noexcept override { return protocol_; } std::string address() const override { std::string out; if (len_ > sizeof(sa_family_t)) { const char* ptr = sun_.sun_path; std::size_t len = len_ - sizeof(sa_family_t); if (*ptr == '\0') { out.insert(out.end(), ptr, ptr + len); out.front() = '@'; } else { len = ::strnlen(ptr, len); out.insert(out.end(), ptr, ptr + len); } } else { // anonymous socket -> "" } return out; } std::pair<const void*, std::size_t> raw() const override { return std::make_pair(&sun_, len_); } private: sockaddr_un sun_; socklen_t len_; ProtocolType protocol_; }; class UnixProtocol : public FDProtocol { public: bool interprets(int family) const override { return family == AF_UNIX; } base::Result interpret(Addr* out, ProtocolType p, const sockaddr* sa, int len) const override; bool supports(const std::string& protocol) const override { return protomap().count(protocol) != 0; } base::Result parse(Addr* out, const std::string& protocol, const std::string& address) const override; void resolve(event::Task* task, std::vector<Addr>* out, const std::string& protocol, const std::string& address, const base::Options& options) override; private: std::shared_ptr<Protocol> self() const override { return unixprotocol(); } std::tuple<int, int, int> socket_triple( const std::string& protocol) const override; }; base::Result UnixProtocol::interpret(Addr* out, ProtocolType p, const sockaddr* sa, int len) const { CHECK_NOTNULL(out); CHECK_NOTNULL(sa); CHECK_GE(len, int(sizeof(sa_family_t))); CHECK(interprets(sa->sa_family)); auto ptr = reinterpret_cast<const sockaddr_un*>(sa); *out = Addr(std::make_shared<UnixAddr>(p, ptr, len)); return base::Result(); } base::Result UnixProtocol::parse(Addr* out, const std::string& protocol, const std::string& address) const { CHECK_NOTNULL(out); CHECK(supports(protocol)); if (address.size() >= UNIX_PATH_MAX) { return base::Result::invalid_argument("AF_UNIX path is too long"); } auto p = protomap().at(protocol); *out = unixaddr(p, address); return base::Result(); } void UnixProtocol::resolve(event::Task* task, std::vector<Addr>* out, const std::string& protocol, const std::string& address, const base::Options& options) { CHECK_NOTNULL(task); CHECK_NOTNULL(out); CHECK(supports(protocol)); if (!task->start()) return; Addr addr; base::Result r = parse(&addr, protocol, address); if (r) out->push_back(std::move(addr)); task->finish(std::move(r)); } std::tuple<int, int, int> UnixProtocol::socket_triple( const std::string& protocol) const { int domain, type, protonum; domain = AF_UNIX; switch (protomap().at(protocol)) { case P::stream: type = SOCK_STREAM; break; case P::datagram: type = SOCK_DGRAM; break; case P::seqpacket: type = SOCK_SEQPACKET; break; default: LOG(DFATAL) << "BUG! protocol \"" << protocol << "\" " << "does not map to a known Unix socket type"; type = SOCK_RAW; } protonum = 0; return std::make_tuple(domain, type, protonum); } } // anonymous namespace Addr unixaddr(ProtocolType p, const std::string& address) { CHECK_LT(address.size(), UNIX_PATH_MAX); std::size_t size = address.size(); if (size >= UNIX_PATH_MAX) size = UNIX_PATH_MAX - 1; sockaddr_un sun; socklen_t len; ::bzero(&sun, sizeof(sun)); sun.sun_family = AF_UNIX; if (address.empty()) { len = sizeof(sa_family_t); } else if (address.front() == '@') { len = sizeof(sa_family_t) + size; ::memcpy(sun.sun_path, address.data(), size); sun.sun_path[0] = '\0'; } else { len = sizeof(sa_family_t) + size + 1; ::memcpy(sun.sun_path, address.c_str(), size + 1); } return Addr(std::make_shared<UnixAddr>(p, &sun, len)); } static std::once_flag g_once; static std::shared_ptr<Protocol>* g_proto = nullptr; std::shared_ptr<Protocol> unixprotocol() { std::call_once(g_once, [] { g_proto = new std::shared_ptr<Protocol>(std::make_shared<UnixProtocol>()); }); return *g_proto; } } // namespace net static void init() __attribute__((constructor)); static void init() { net::system_registry_mutable().add(nullptr, 50, net::unixprotocol()); }
lechium/iOS1351Headers
System/Library/PrivateFrameworks/OnBoardingKit.framework/OBTextBulletedListItem.h
/* * This header is generated by classdump-dyld 1.5 * on Friday, April 30, 2021 at 11:35:53 AM Mountain Standard Time * Operating System: Version 13.5.1 (Build 17F80) * Image Source: /System/Library/PrivateFrameworks/OnBoardingKit.framework/OnBoardingKit * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by <NAME>. Updated by <NAME>. */ #import <OnBoardingKit/OBBulletedListItem.h> @interface OBTextBulletedListItem : OBBulletedListItem -(id)initWithTitle:(id)arg1 description:(id)arg2 image:(id)arg3 accessoryButton:(id)arg4 ; -(double)imageSizeForImage:(id)arg1 ; -(BOOL)shouldLayoutVertically; -(double)leadingMargins; -(double)trailingMargins; @end
reenhanced/usps
spec/address_spec.rb
require 'spec_helper' describe USPS::Address do it "should have the expected fields" do address = USPS::Address.new address.should respond_to( :name, :name=, :address1, :address1=, :address2, :address2=, :city, :city=, :state, :state=, :zip5, :zip5=, :zip4, :zip4= ) end it "should be initializable with a hash" do address = USPS::Address.new( :name => 'Chris', :address => '123 Main St', :city => 'Holland' ) address.name.should == 'Chris' address.address.should == '123 Main St' address.city.should == 'Holland' end it "know how to combine the zip coes" do USPS::Address.new(:zip5 => 12345).zip.should == '12345' USPS::Address.new(:zip5 => 12345, :zip4 => 9999).zip.should == '12345-9999' end it "should be able to parse zip into individual parts" do addy = USPS::Address.new(:zip => '12345-9988') addy.zip5.should == '12345' addy.zip4.should == '9988' addy.zip.should == '12345-9988' end it "should be able to be verified with the USPS" do addy = USPS::Address.new( :name => '<NAME>', :address => '1600 Pennsylvania Avenue NW', :city => 'Washington', :state => 'DC', :zip => 20006 ) USPS.client.should_receive(:request).and_return( USPS::Response::AddressStandardization.new( addy, load_xml('address_standardization_1.xml') ) ) addy.valid?.should be_true error = USPS::Error.new('error', '1234', 'source') # Failure USPS.client.should_receive(:request).and_raise(error) addy.valid?.should be_false addy.error.should be(error) end end
wishl/brcc
brcc-cache/src/main/java/com/baidu/brcc/retry/RetryActionWithThrParam.java
<reponame>wishl/brcc /* * Copyright (C) 2021 Baidu, Inc. All Rights Reserved. */ package com.baidu.brcc.retry; import org.springframework.dao.DataAccessException; import com.baidu.brcc.utils.gson.GsonUtils; import lombok.extern.slf4j.Slf4j; /** * 三参数重试类 * * @param <P1> 第一参数类型 * @param <P2> 第二参数类型 * @param <P3> 第三参数类型 * @param <R> 返回结果类型 */ @Slf4j public class RetryActionWithThrParam<P1, P2, P3, R> { // 操作名称 private String actionName; // 重试次数 private int retryTimes; // 执行所需第一参数 private P1 p1; // 执行所需第二参数 private P2 p2; // 执行所需第三参数 private P3 p3; public RetryActionWithThrParam(String actionName, int retryTimes, P1 p1, P2 p2, P3 p3) { this.actionName = actionName; this.retryTimes = retryTimes; this.p1 = p1; this.p2 = p2; this.p3 = p3; } public R action(ThrFunction<P1, P2, P3, R> func) { int times = 0; do { times++; try { return func.apply(p1, p2, p3); } catch (DataAccessException ex) { log.warn("{} arg0[{}] arg1[{}] arg2[{}] in redis happen DataAccessException, times[{}]", actionName, GsonUtils.toJsonString(p1), GsonUtils.toJsonString(p2), GsonUtils.toJsonString(p3), times, ex ); } catch (Exception ex) { log.error("{} arg0[{}] arg1[{}] arg2[{}] in redis fail.", GsonUtils.toJsonString(p1), GsonUtils.toJsonString(p2), GsonUtils.toJsonString(p3), ex); break; } } while (times < retryTimes); return null; } }
JackChan1999/boohee_v5.6
src/main/java/com/meiqia/core/bw.java
<gh_stars>1-10 package com.meiqia.core; import com.meiqia.core.b.c; import com.meiqia.core.bean.MQAgent; import com.meiqia.core.bean.MQConversation; import com.squareup.okhttp.Response; import org.json.JSONObject; class bw implements cw { final /* synthetic */ cv a; final /* synthetic */ bu b; bw(bu buVar, cv cvVar) { this.b = buVar; this.a = cvVar; } public void a(JSONObject jSONObject, Response response) { MQAgent b = c.b(jSONObject.optJSONObject("agent")); MQConversation c = c.c(jSONObject.optJSONObject("conv")); c.setAgent_id(b.getId()); this.a.a(b, c, c.a(jSONObject.optJSONArray("messages"))); } }
gemenerik/gap_sdk
tools/nntool/graph/types/others.py
# Copyright (C) 2020 GreenWaves Technologies, SAS # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. import logging import math from functools import reduce import numpy as np from expressions.symbolic.basic import (Abs, Ceil, Cos, Exp, Log, Max, Min, Neg, Pow, Round, RSqrt, Sin, Sqrt) from graph.dim import Dim from utils.real_transpose import real_transpose from .base import (CanFuseToExpression, ComparableParameters, InsensitiveToQuantization, NoSizeChangeParameters, Parameters, SensitiveToOrder, SingleInputAndOutput, cls_op_name, expression_op, nargs, not_generated) LOG = logging.getLogger("nntool." + __name__) @cls_op_name('transpose') class TransposeParameters(Parameters, SingleInputAndOutput, InsensitiveToQuantization, ComparableParameters): def __init__(self, *args, transpose=None, block_search_up=False, block_search_down=False, **kwargs): super(TransposeParameters, self).__init__(*args, **kwargs) self._transpose = tuple(transpose) self.block_search_up = block_search_up self.block_search_down = block_search_down @property def transpose(self): return self._transpose @transpose.setter def transpose(self, val): self._transpose = val @property def graph_anon_label(self): return ['Transpose', f'{self.transpose}'] @property def graph_label(self): return [f'{self.CLS_OP_NAME}({self.name})', f'{self.transpose}'] def get_parameter_size(self): return 0 def permute(self, val): return [val[i] for i in self.transpose] @property def no_model_code(self): if not self.transpose: return True if not self.in_dims or not self.in_dims[0]: return False shape = self.in_dims[0].shape trans = self.transpose shape_idx = [idx if dim > 1 else None for idx, dim in enumerate(shape)] shape_trans = [shape_idx[idx] for idx in trans if shape_idx[idx] is not None] return shape_trans == sorted(shape_trans) @property def does_nothing(self) -> bool: return self._transpose is None @property def is_not_generated(self): return self.does_nothing def is_same_operation_as(self, G, other): if not isinstance(other, TransposeParameters): return False if self.transpose is None: return other.transpose is None if other.transpose is None: return self.transpose is None return tuple(self.transpose) == tuple(other.transpose) @property def can_equalize(self): return False def real_shape(self): return real_transpose(self.in_dims[0].shape, self.transpose) @property def transpose_dimension(self): if self._transpose is None: return 1 return len(self.transpose) def get_output_size(self, in_dims): out_dim = in_dims[0].clone() if self.transpose: out_dim = out_dim.transpose(self.transpose) return [out_dim] def __str__(self): return "T {} {}".format( self.transpose and ','.join( [str(i) for i in self.transpose]) or "None", self.at_options ) @cls_op_name('copy') class CopyParameters(Parameters, InsensitiveToQuantization): def __init__(self, *args, **kwargs): super(CopyParameters, self).__init__(*args, **kwargs) def get_parameter_size(self): return 0 @property def can_equalize(self): return False def get_output_size(self, in_dims): return [in_dims[0].clone()] def __str__(self): return "" @cls_op_name('expand') class ExpandParameters(Parameters, SensitiveToOrder, InsensitiveToQuantization): def __init__(self, *args, shape=None, **kwargs): super(ExpandParameters, self).__init__(*args, **kwargs) self.shape = shape def get_parameter_size(self): return 0 @property def can_equalize(self): return False def get_output_size(self, in_dims): in_shape = list(in_dims[0].shape) exp_shape = list(self.shape) if len(in_shape) > len(exp_shape): exp_shape = in_shape[:( len(in_shape) - len(exp_shape)):] + exp_shape elif len(exp_shape) > len(in_shape): in_shape = exp_shape[:(len(exp_shape) - len(in_shape)):] + in_shape out_shape = [] for exp_dim, in_dim in zip(exp_shape, in_shape): if in_dim == 1: out_shape.append(exp_dim) elif exp_dim == 1: out_shape.append(in_dim) elif in_dim != exp_dim: raise ValueError( f'{self.name} invalid expand {in_dims[0]} {self.shape}') else: out_shape.append(in_dim) return [Dim.unnamed(out_shape)] def __str__(self): return f"{self.shape}" @cls_op_name('scatternd') class ScatterNdParameters(Parameters, SensitiveToOrder): def __init__(self, *args, indices=None, updates=None, reduction=None, **kwargs): super(ScatterNdParameters, self).__init__(*args, **kwargs) self.indices = indices self.updates = updates self.reduction = reduction def get_parameter_size(self): return 0 @property def can_equalize(self): return False def get_output_size(self, in_dims): return [Dim.unnamed(in_dims[0].shape)] def __str__(self): return "" @cls_op_name('quantize') class QuantizeParameters(Parameters, ComparableParameters): def __init__(self, *args, from_qtype=None, to_qtype=None, inserted_by_quantizer=False, **kwargs): super(QuantizeParameters, self).__init__(*args, **kwargs) self.from_qtype = from_qtype self.to_qtype = to_qtype self.inserted_by_quantizer = inserted_by_quantizer def get_parameter_size(self): return 0 def is_same_operation_as(self, G, other): return (isinstance(other, QuantizeParameters) and self.from_qtype == other.from_qtype and self.to_qtype == other.to_qtype) @property def can_equalize(self): return False def get_output_size(self, in_dims): return [in_dims[0].clone()] def __str__(self): return f"{self.from_qtype} --> {self.to_qtype}" @cls_op_name('reverse') class ReverseParameters(Parameters, InsensitiveToQuantization): def __init__(self, *args, axis=0, **kwargs): super(ReverseParameters, self).__init__(*args, **kwargs) self.axis = axis def get_parameter_size(self): return 0 @property def can_equalize(self): return False def get_output_size(self, in_dims): return [in_dims[0].clone()] def __str__(self): return "A {}".format(self.axis) @cls_op_name('concat') @nargs({'*'}) @not_generated class ConcatParameters(Parameters, SensitiveToOrder): def __init__(self, *args, axis=None, **kwargs): super(ConcatParameters, self).__init__(*args, **kwargs) if axis is None: raise ValueError("axis must be set") self._axis = axis @property def graph_label(self): return [self.name, f'Axis {self.axis}'] @property def graph_anon_label(self): return ['Concat', f'Axis {self.axis}'] @property def axis(self): return self._axis @axis.setter def axis(self, val): self._axis = val @property def does_nothing(self) -> bool: return self.in_dims and len(self.in_dims) == 1 def get_parameter_size(self): return 0 @property def can_equalize(self): return False @property def offsets(self): return reduce( lambda state, in_dim: ( state[0] + [state[1]], state[1] + in_dim.shape[self.axis]), self.in_dims, ([], 0) )[0] def get_output_size(self, in_dims): out_dim = Dim.combine([in_dim for in_dim in in_dims], self.axis) return [out_dim] def __str__(self): return "A {} {}".format( self.axis, self.at_options ) @cls_op_name('split') @not_generated class SplitParameters(Parameters, SensitiveToOrder): def __init__(self, *args, act_slices=None, out_shapes=None, axis=None, **kwargs): super(SplitParameters, self).__init__(*args, **kwargs) self.act_slices = act_slices self.out_shapes = out_shapes self.axis = axis def __call__(self, *args, **kwargs): return super().__call__(*args, num_outputs=len(self.act_slices), **kwargs) @property def does_nothing(self) -> bool: return self.out_dims and len(self.out_dims) == 1 @property def graph_label(self): return [self.name, f'Axis {self.axis}'] @property def graph_anon_label(self): return ['Split', f'Axis {self.axis}'] def numpy_split(self, arr: np.ndarray): slice_specs = [tuple([slice(elem[0], elem[1], elem[2]) for elem in act_slice]) for act_slice in self.act_slices] return [arr[spec] for spec in slice_specs] @staticmethod def get_splits(in_shape, axis, splits=None, num_splits=None): assert splits or num_splits, "no split parameters provided" assert in_shape[axis] is not None, "split on undefined axis" in_idx = 0 act_slices = [] out_shapes = [] if splits: if in_shape[axis] is not None and any(split == -1 for split in splits): rest_sz = sum(split for split in splits if split > 0) splits = (split if split > 0 else in_shape[axis] - rest_sz for split in splits) for sz in splits: act_slices.append([(in_idx, in_idx + sz, 1) if idx == axis else (0, shape, 1) for idx, shape in enumerate(in_shape) if shape is not None]) out_shapes.append([sz if shape is not None and idx == axis else shape for idx, shape in enumerate(in_shape)]) in_idx += sz elif num_splits: assert in_shape[axis] % num_splits == 0, "dimension of split is not divisible by number of splits" sz = in_shape[axis] // num_splits while in_idx < in_shape[axis]: act_slices.append([(in_idx, in_idx + sz, 1) if idx == axis else (0, shape, 1) for idx, shape in enumerate(in_shape) if shape is not None]) out_shapes.append([sz if shape is not None and idx == axis else shape for idx, shape in enumerate(in_shape)]) in_idx += sz count_nones = sum(1 if dim is None else 0 for dim in in_shape[:axis:]) axis -= count_nones return act_slices, out_shapes, axis @property def num_splits(self): return len(self.act_slices) def transpose_params(self, order): self.act_slices = [ [act_slice[idx] for idx in order] for act_slice in self.act_slices ] self.out_shapes = [ [shape[idx] for idx in order] for shape in self.out_shapes ] def get_parameter_size(self): return 0 def get_output_size(self, in_dims): out_size = [Dim.unnamed(shape) for shape in self.out_shapes] return out_size @property def can_equalize(self): return False def __str__(self): return "A {} {}".format( self.axis, self.at_options ) @cls_op_name('gather') class GatherParameters(Parameters, SingleInputAndOutput, SensitiveToOrder, InsensitiveToQuantization): def __init__(self, *args, axis=None, indices=None, **kwargs): super(GatherParameters, self).__init__(*args, **kwargs) self.axis = axis self.indices = np.array(indices) def get_parameter_size(self): return 0 def get_output_size(self, in_dims): in_dim = in_dims[0] new_shape = in_dim.shape[:self.axis:] + \ list(self.indices.shape) + in_dim.shape[self.axis + 1:] return [Dim.unnamed(new_shape)] @property def rank(self): return len(self.in_dims[0].shape) + len(self.indices.shape) - 1 @property def can_equalize(self): return False def __str__(self): return "A %s I %s" % (self.axis, self.indices) @cls_op_name('strided_slice') class StridedSliceParameters(Parameters, SingleInputAndOutput, ComparableParameters, InsensitiveToQuantization): def __init__(self, *args, act_slice=None, out_shape=None, **kwargs): super(StridedSliceParameters, self).__init__(*args, **kwargs) self.act_slice = act_slice self.out_shape = tuple(out_shape) @property def graph_label(self): return [self.name] + ["(%s,%s,%s)" % elem for elem in self.act_slice] @property def graph_anon_label(self): return ['Slice'] + ["(%s,%s,%s)" % elem for elem in self.act_slice] @property def slice_shape(self): return tuple( int(abs(math.ceil((max(sl[1], -1) - max(sl[0], -1))/sl[2]))) for sl in self.act_slice) @property def slices_axes(self): in_shape = self.in_dims[0].shape return tuple(idx for idx, shapes in enumerate(zip(self.slice_shape, in_shape)) if shapes[0] != shapes[1]) @property def changes_shape(self): return self.slice_shape != self.out_shape @property def can_equalize(self): return False def numpy_slice(self, arr: np.ndarray): slice_spec = [slice(elem[0], elem[1], elem[2]) for elem in self.act_slice if len(elem) == 3] return arr[tuple(slice_spec)].reshape(self.out_shape) def only_slices_axis(self, axis): """check if there is a slice on only one axis""" in_shape = self.in_dims[0].shape return all(sl[0] == 0 and sl[1] == in_shape[idx] and sl[2] == 1 for idx, sl in enumerate(self.act_slice) if idx != axis) def is_unit_slice(self, axis): """check if the slice on one axis returns shape of 1""" slce = self.act_slice[axis] if slce[1] > slce[0]: return slce[1] - slce[0] == 1 and slce[2] == 1 else: return slce[0] - slce[1] == 2 and slce[2] == -1 def is_same_operation_as(self, G, other): if not isinstance(other, StridedSliceParameters): return False if tuple(self.out_shape) != tuple(other.out_shape): return False if len(self.act_slice) != len(other.act_slice): return False return all(tuple(elem) == tuple(oelem) for elem, oelem in zip(self.act_slice, other.act_slice)) def only_slices(self, axis): return all(dim == self.act_slice[idx][1] and self.act_slice[idx][0] == 0 and self.act_slice[idx][2] == 1 for idx, dim in enumerate(self.in_dims[0].shape) if axis != idx) @property def does_nothing(self) -> bool: return self.no_model_code and not self.changes_shape @property def no_model_code(self) -> bool: if not self.in_dims: return False return self.slice_shape == tuple(self.in_dims[0].shape) def get_parameter_size(self): return 0 def get_output_size(self, in_dims): return [Dim.unnamed(self.out_shape)] def __str__(self): return ",".join("(%s,%s,%s)" % elem for elem in self.act_slice) @cls_op_name('pad') class PadParameters(Parameters, SingleInputAndOutput): def __init__(self, name, padding=None, pad_vals=None, in_dims_hint=None, out_dims_hint=None): super(PadParameters, self).__init__(name, in_dims_hint=in_dims_hint, out_dims_hint=out_dims_hint) self.padding = padding self.pad_vals = pad_vals @property def graph_label(self): return [self.name, f'Pad {self.padding}'] @property def graph_anon_label(self): return ['Pad', f'{self.padding}'] def get_parameter_size(self): return 0 def get_output_size(self, in_dims): assert len(in_dims) == 1 out_dim = in_dims[0].clone() for idx, vals in enumerate(self.padding): out_dim[idx] += sum(vals) return [out_dim] @property def can_equalize(self): return True def __str__(self): return "PAD {}".format(self.padding) @nargs({2}) class BinaryOpParameters(CanFuseToExpression, Parameters): def __new__(cls, *args, op_type="maximum", **kwargs): if cls is BinaryOpParameters: for subcls in BinaryOpParameters.__subclasses__(): if op_type == subcls.CLS_OP_NAME: return super(BinaryOpParameters, cls).__new__(subcls) raise ValueError(f'binary op {op_type} not found') return super(BinaryOpParameters, cls).__new__(cls, **kwargs) def __init__(self, *args, op_type="maximum", **kwargs): super(BinaryOpParameters, self).__init__(*args, **kwargs) self._op_type = op_type @property def op_type(self): return self._op_type def get_output_size(self, in_dims): assert len(in_dims) == 2 out_dim = in_dims[0].clone() return [out_dim] def get_parameter_size(self): return 0 @property def can_equalize(self): return False def __str__(self): return "{} {}".format( self._op_type, self.at_options ) @cls_op_name('maximum') @expression_op(Max) class MaxOpParameters(BinaryOpParameters, InsensitiveToQuantization): pass @cls_op_name('minimum') @expression_op(Min) class MinOpParameters(BinaryOpParameters, InsensitiveToQuantization): pass @cls_op_name('pow') @expression_op(Pow) class PowOpParameters(BinaryOpParameters): pass class UnaryOpParameters(CanFuseToExpression, Parameters): def __new__(cls, *args, op_type="sqrt", **kwargs): if cls == UnaryOpParameters: for subcls in UnaryOpParameters.__subclasses__(): if op_type == subcls.CLS_OP_NAME: return super(UnaryOpParameters, cls).__new__(subcls) raise ValueError(f'unary op {op_type} not found') return super(UnaryOpParameters, cls).__new__(cls) def __init__(self, *args, op_type=None, **kwargs): super(UnaryOpParameters, self).__init__(*args, **kwargs) self._op_type = op_type @property def op_type(self): return self._op_type def get_output_size(self, in_dims): assert len(in_dims) == 1 out_dim = in_dims[0].clone() return [out_dim] def get_parameter_size(self): return 0 @property def can_equalize(self): return False def __str__(self): return "{} {}".format( self._op_type, self.at_options ) @cls_op_name('round') @expression_op(Round) class RoundOpParameters(UnaryOpParameters): pass @cls_op_name('ceil') @expression_op(Ceil) class CeilOpParameters(UnaryOpParameters): pass @cls_op_name('sqrt') @expression_op(Sqrt) class SqrtOpParameters(UnaryOpParameters): pass @cls_op_name('rsqrt') @expression_op(RSqrt) class RSqrtOpParameters(UnaryOpParameters): pass @cls_op_name('exp') @expression_op(Exp) class ExpOpParameters(UnaryOpParameters): pass @cls_op_name('log') @expression_op(Log) class LogOpParameters(UnaryOpParameters): pass @cls_op_name('sin') @expression_op(Sin) class SinOpParameters(UnaryOpParameters): pass @cls_op_name('cos') @expression_op(Cos) class CosOpParameters(UnaryOpParameters): pass @cls_op_name('abs') @expression_op(Abs) class AbsOpParameters(UnaryOpParameters, InsensitiveToQuantization): pass @cls_op_name('neg') @expression_op(Neg) class NegOpParameters(UnaryOpParameters, InsensitiveToQuantization): pass @cls_op_name('reshape') @not_generated class ReshapeParameters(Parameters, SingleInputAndOutput, InsensitiveToQuantization, ComparableParameters): def __init__(self, *args, old_shape=None, shape=None, **kwargs): super(ReshapeParameters, self).__init__( *args, **kwargs) if not isinstance(shape, Dim): shape = Dim.unnamed(shape) if old_shape is not None and not isinstance(old_shape, Dim): old_shape = Dim.unnamed(old_shape) assert shape.is_ordered and (old_shape is None or old_shape.is_ordered) self._shape = shape self._old_shape = old_shape @property def graph_label(self): return [f'Reshape({self.name})', f'{self.old_shape} to {self.shape}'] @property def graph_anon_label(self): return ['Reshape', f'{self.old_shape} to {self.shape}'] @property def does_nothing(self): return tuple(self.shape.shape) == tuple(self.old_shape.shape) @property def no_model_code(self) -> bool: return True def get_parameter_size(self): return 0 def exp_red_pattern(self): """ If the reshape is an expand or reduce dim i.e. adds or removes 1 size axes then return a pattern with True indicating an added axis, False a removed axis and None an unchanged axis""" if not self.does_nothing: return None res = [] s1 = self._old_shape.shape.copy() s2 = self._shape.shape.copy() while s1 and s2: if not s1: top = s2.pop(0) assert top == 1 res.append(True) elif not s2: top = s1.pop(0) assert top == 1 res.append(False) else: if s1[0] == s2[0]: s1.pop(0) s2.pop(0) res.append(None) elif s1[0] == 1: s1.pop(0) res.append(False) elif s2[0] == 1: s2.pop(0) res.append(True) else: raise ValueError('shape issue in exp_red_pattern') return res def is_same_operation_as(self, G, other): if not isinstance(other, ReshapeParameters): return False if tuple(self.old_shape.shape) != tuple(other.old_shape.shape): return False if tuple(self.shape.shape) != tuple(other.shape.shape): return False return True def get_output_size(self, in_dims): assert len(in_dims) == 1 in_dim = in_dims[0] self.old_shape = in_dim if in_dim.size() != self.shape.size(): raise NotImplementedError("bad reshape %s: in dim %s does not match reshape %s" % (self.name, in_dim, self.shape)) out = self.shape.clone() return [out] @property def shape(self): return self._shape @shape.setter def shape(self, val): assert val.is_ordered self._shape = val @property def old_shape(self): return self._old_shape @old_shape.setter def old_shape(self, val): assert val.is_ordered self._old_shape = val @property def can_equalize(self): return False def __str__(self): return f"{self.old_shape}->{self.shape}" # pylint: disable=abstract-method @cls_op_name('noop') class NoOPParameters(NoSizeChangeParameters, SingleInputAndOutput, InsensitiveToQuantization): def __init__(self, name, desc=""): super(NoOPParameters, self).__init__(name) self._desc = desc def get_parameter_size(self): return 0 @property def can_equalize(self): return False @property def no_model_code(self) -> bool: return True @property def does_nothing(self) -> bool: return True def compute_load(self): return 0 def __str__(self): return "NOOP {}".format( self._desc ) class UnexecutableOpParameters(Parameters): pass @cls_op_name('UNSUPPORTED') class UnconvertedOpParameters(UnexecutableOpParameters): def __init__(self, name, indicated_op_name=None, expected_inputs=None, indicated_outputs=None, info=None, **kwargs): super(UnconvertedOpParameters, self).__init__(name, **kwargs) self.info = info self.expected_inputs = expected_inputs self.indicated_outputs = indicated_outputs self.indicated_op_name = indicated_op_name def get_output_size(self, in_dims): if self.indicated_outputs: return self.indicated_outputs if len(in_dims) == 1: return [in_dims[0]] return [Dim.unknown()] @property def can_equalize(self): return False def get_parameter_size(self): return 0 def __str__(self): return "UNSUPPORTED OP: %s" % self.indicated_op_name @cls_op_name('UNKNOWN') class UnknownOpParameters(UnexecutableOpParameters): def __init__(self, name, info): super(UnknownOpParameters, self).__init__(name) self.info = info def get_output_size(self, in_dims): if len(in_dims) == 1: return [in_dims[0]] return [Dim.unknown()] @property def can_equalize(self): return False def get_parameter_size(self): return 0 def __str__(self): return "Unknown"
skyplaying/ant-simple-pro
vue+typescript/.eslintrc.js
const { defineConfig } = require('eslint-define-config') module.exports = defineConfig({ root: true, env: { node: true, browser: true, es6: true }, parser: 'vue-eslint-parser', extends: [ // 'plugin:vue/vue3-essential', 'plugin:vue/vue3-recommended', 'eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier', 'plugin:prettier/recommended' ], parserOptions: { parser: '@typescript-eslint/parser', ecmaVersion: 2020, sourceType: 'module', ecmaFeatures: { jsx: true, tsx: true } }, globals: { AMap: false, echarts: false }, rules: { /** * 代码错误 */ 'no-console': 0, 'no-debugger': 0, /** * 最佳实践 */ eqeqeq: 2, // 强制使用 === 和 !== 'default-case': 1, // 要求 switch 语句中有 default 分支 'no-else-return': 1, // 禁止 if 语句中 return 语句之后有 else 块 'no-empty-function': 1, // 禁止出现空函数 'no-multi-spaces': 1, // 禁止使用多个空格 radix: 1, // 强制在parseInt()使用基数参数 /** * 变量声明 */ 'init-declarations': ['error', 'always'], // 声明变量必须赋值 /** * 风格指南 */ // 'array-bracket-spacing': ['error', 'always'], // 数组方括号内必须空格 'space-before-function-paren': 0, 'array-bracket-spacing': 0, // 数组方括号内必须空格 'comma-dangle': 2, // 禁止末尾逗号 'eol-last': 2, // 要求文件末尾存在空行 // 对象冒号前禁止空格,冒号后必须空格 'key-spacing': ['error', { beforeColon: false, afterColon: true }], // 关键字(if、else等)前后必须有空格 'keyword-spacing': ['error', { before: true, after: true }], // 禁止出现多行空行 'no-multiple-empty-lines': ['error', { max: 1 }], semi: ['error', 'never'], // 禁止末尾分号 quotes: ['error', 'single'], 'space-infix-ops': 2, // 操作符周围必须有空格 'spaced-comment': ['error', 'always'], // 注释后面必须跟随至少一个空白 'object-curly-spacing': 0, 'no-unused-expressions': 0, /** * ECMAScript6 */ 'arrow-spacing': ['error', { before: true, after: true }], // 强制箭头函数的箭头前后使用空格 'no-var': 2, // 禁止使用 var 声明变量 'object-shorthand': 2, // 要求使用对象方法名和属性名简写 'prefer-arrow-callback': 2, // 要求回调函数使用箭头函数 'prefer-const': 2, // 使用 const 声明那些声明后不再被修改的变量 'prefer-rest-params': 2, // 要求使用剩余参数而不是 arguments /** * typescript * https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/docs/rules */ '@typescript-eslint/member-delimiter-style': [ 2, { multiline: { delimiter: 'none', requireLast: true }, singleline: { delimiter: 'semi', requireLast: false } } ], '@typescript-eslint/ban-ts-ignore': 0, '@typescript-eslint/no-explicit-any': 0, '@typescript-eslint/interface-name-prefix': 0, '@typescript-eslint/explicit-module-boundary-types': 0, '@typescript-eslint/ban-ts-comment': 0, /** * vue */ 'vue/no-v-html': 0, 'vue/valid-v-model': 0, 'vue/no-dupe-keys': 0, 'vue/order-in-components': [ 'error', { order: [ 'el', 'name', 'key', 'parent', 'functional', ['delimiters', 'comments'], ['components', 'directives', 'filters'], 'extends', 'mixins', ['provide', 'inject'], 'ROUTER_GUARDS', 'layout', 'middleware', 'validate', 'scrollToTop', 'transition', 'loading', 'inheritAttrs', 'model', 'emits', ['props', 'propsData'], 'setup', 'asyncData', 'data', 'fetch', 'head', 'computed', 'watch', 'watchQuery', 'LIFECYCLE_HOOKS', 'methods', ['template', 'render'], 'renderError' ] } ] } })
euhat/EuhatExpert
euhat/os/win32/EuhatIcon.cpp
<gh_stars>0 #include <EuhatPreDef.h> #include <Windows.h> #include <common/OpCommon.h> #include "EuhatIcon.h" #include <OpCommonOs.h> #include <EuhatPostDef.h> EuhatIcon::EuhatIcon() { icon_ = NULL; } EuhatIcon::EuhatIcon(int id) { HINSTANCE hInst = GetModuleHandle(0); //icon_ = (HICON)LoadIcon(hInst, MAKEINTRESOURCE(id)); icon_ = (HICON)::LoadImage(hInst, MAKEINTRESOURCE(id), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_CREATEDIBSECTION | LR_DEFAULTCOLOR); } EuhatIcon::EuhatIcon(const wchar_t *fileName) { icon_ = (HICON)::LoadImage(NULL, fileName, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_LOADFROMFILE); } EuhatIcon::EuhatIcon(HICON icon) { icon_ = icon; } EuhatIcon::~EuhatIcon() { DestroyIcon(icon_); } void EuhatIcon::draw(HICON icon, HDC hdc, int x, int y, int width, int height) { /* BITMAP bitmap; ICONINFO iconInfo; GetIconInfo(icon_, &iconInfo); GetObject(iconInfo.hbmColor, sizeof(BITMAP), &bitmap); int widthT = bitmap.bmWidth; int heightT = bitmap.bmHeight; DeleteObject(iconInfo.hbmColor); DeleteObject(iconInfo.hbmMask); */ //DrawIcon(hdc, x, y, icon_); width = 0; height = 0; DrawIconEx(hdc, x, y, icon, width, height, 0, NULL, DI_NORMAL); } void EuhatIcon::draw(HDC hdc, int x, int y, int width, int height) { draw(icon_, hdc, x, y, width, height); } EuhatIconSysPool::EuhatIconSysPool(const char *defaultExt, int maxCount, int useSmall) { defaultExt_ = defaultExt; maxCount_ = maxCount; useSmall_ = useSmall; pickFile("", defaultExt); int flags = useSmall_ ? SHGFI_SMALLICON : SHGFI_LARGEICON; HICON normal = whFolderIcon(flags); HICON selected = whFolderIcon(flags | SHGFI_SELECTED); folderBasket_.normal_.icon_ = normal; folderBasket_.selected_.icon_ = selected; } EuhatIconSysPool::Basket *EuhatIconSysPool::pickFile(const char *filePath, const char *extension) { string ext = strToLower(extension); string path = strToLower(filePath); if (path.size() > 1 && path[1] == ':') { if (ext == ".exe") { } else if (ext == ".lnk") { } } auto it = pool_.find(ext); if (it != pool_.end()) return &it->second; if (maxCount_ > 0) { if (pool_.size() >= (size_t)maxCount_) return pickFile("", defaultExt_.c_str()); } int flags = useSmall_ ? SHGFI_SMALLICON : SHGFI_LARGEICON; HICON normal = whFileIcon(ext.c_str(), flags); HICON selected = whFileIcon(ext.c_str(), flags | SHGFI_SELECTED); Basket &basket = pool_[ext]; basket.normal_.icon_ = normal; basket.selected_.icon_ = selected; return &basket; }
conholo/OpenGLSandbox
Sandbox/src/Layers/410/CloudsUtility/CloudsUI.h
#pragma once #include "Engine.h" #include "Layers/410/CloudsUtility/CloudDataStructures.h" #include "Layers/410/CloudsUtility/CloudsSceneRenderPass.h" struct CloudsUIData { Engine::Ref<BaseShapeWorleySettings> BaseShapeSettings; Engine::Ref<DetailShapeWorleySettings> DetailShapeSettings; Engine::Ref<WorleyPerlinSettings> PerlinSettings; Engine::Ref<CloudSettings> MainCloudSettings; Engine::Ref<CloudAnimationSettings> AnimationSettings; Engine::Ref<CloudsSceneRenderPass> SceneRenderPass; Engine::Ref<CurlSettings> CurlSettings; }; struct UITab { int Index = -1; std::string TabName; }; class CloudsUI { public: CloudsUI(); ~CloudsUI(); void Draw(const Engine::Ref<CloudsUIData>& uiData); const Engine::Ref<TextureDebugDisplaySettings>& GetTextureDisplaySettings() const { return m_MainTextureDebugSettings; } bool GetDisplayAlpha() const { return m_ActiveDebugShapeType == ActiveDebugShapeType::None || m_ActiveDebugShapeType == ActiveDebugShapeType::DetailNoise ? false : m_ShapeTextureDisplaySettings->ShowAlpha; } bool GetShowAllChannels() const { return m_ActiveDebugShapeType == ActiveDebugShapeType::BaseShape ? m_ShapeTextureDisplaySettings->DrawAllChannels : m_DetailTextureDisplaySettings->DrawAllChannels; } bool GetEnableGreyScale() const { return m_ActiveDebugShapeType == ActiveDebugShapeType::BaseShape ? m_ShapeTextureDisplaySettings->EnableGreyScale : m_DetailTextureDisplaySettings->EnableGreyScale; } float GetDepthSlice() const { return m_ActiveDebugShapeType == ActiveDebugShapeType::BaseShape ? m_ShapeTextureDisplaySettings->DepthSlice : m_DetailTextureDisplaySettings->DepthSlice; } glm::vec4 GetChannelWeights() const { return m_ActiveDebugShapeType == ActiveDebugShapeType::BaseShape ? m_ShapeTextureDisplaySettings->ChannelWeights : glm::vec4(m_DetailTextureDisplaySettings->ChannelWeights, 1.0f); } ActiveDebugShapeType GetActiveShapeType() const { return m_ActiveDebugShapeType; } CloudUIType GetActiveUIType() const { return m_ActiveUIType; } private: void DrawMainSettings(const Engine::Ref<CloudsUIData>& uiData); void DrawNoiseEditorSettings(); void DrawCloudSettingsUI(const Engine::Ref<CloudSettings>& cloudSettings, const Engine::Ref<CloudAnimationSettings>& animationSettings, const Engine::Ref<CloudsSceneRenderPass>& sceneRenderPass); void DrawBaseShapeUI(const Engine::Ref<BaseShapeWorleySettings>& baseShapeSettings, const Engine::Ref<WorleyPerlinSettings>& perlinSettings); void DrawDetailShapeUI(const Engine::Ref<DetailShapeWorleySettings>& detailShapeSettings); void DrawPerlinUI(const Engine::Ref<WorleyPerlinSettings>& perlinSettings); void DrawCurlUI(const Engine::Ref<CurlSettings>& curlSettings); void DrawTerrainSettingsUI(const Engine::Ref<CloudsSceneRenderPass>& cloudPass, const Engine::Ref<Engine::Terrain>& terrain, int* terrainLOD, bool* wireFrame); void DrawBaseShapeSelectionUI(); void DrawDetailShapeSelectionUI(); private: const Engine::Ref<WorleyChannelData>& ShapeChannelFromMask(const Engine::Ref<BaseShapeWorleySettings>& baseShapeSettings); const Engine::Ref<WorleyChannelData>& DetailChannelFromMask(const Engine::Ref<DetailShapeWorleySettings>& detailShapeSettings); private: std::vector<UITabTypes> m_AvailableTabTypes{ UITabTypes::MainSettings, UITabTypes::CloudSettings, UITabTypes::NoiseTextureSettings, UITabTypes::TerrainSettings }; UITabTypes m_ActiveTabType = UITabTypes::MainSettings; ActiveDebugShapeType m_ActiveDebugShapeType = ActiveDebugShapeType::BaseShape; WorleyChannelMask m_ActiveShapeMask = WorleyChannelMask::R; WorleyChannelMask m_ActiveDetailMask = WorleyChannelMask::R; CloudUIType m_ActiveUIType = CloudUIType::BaseShape; Engine::Ref<TextureDebugDisplaySettings> m_MainTextureDebugSettings; Engine::Ref<DetailTextureDebugDisplaySettings> m_DetailTextureDisplaySettings; Engine::Ref<ShapeTextureDebugDisplaySettings> m_ShapeTextureDisplaySettings; };
tharindusathis/sourcecodes-of-CodeReadingTheOpenSourcePerspective
ace/tao/tao_idl/be/be_visitor_interface/interface_ss.cpp
<filename>ace/tao/tao_idl/be/be_visitor_interface/interface_ss.cpp<gh_stars>10-100 // // interface_ss.cpp,v 1.70 2001/05/31 04:48:55 othman Exp // // ============================================================================ // // = LIBRARY // TAO IDL // // = FILENAME // interface_ss.cpp // // = DESCRIPTION // Visitor generating code for Interfaces in the server skeletons file. // // = AUTHOR // <NAME> // // ============================================================================ #include "idl.h" #include "idl_extern.h" #include "be.h" #include "be_visitor_interface.h" ACE_RCSID(be_visitor_interface, interface_ss, "interface_ss.cpp,v 1.70 2001/05/31 04:48:55 othman Exp") // ************************************************************ // Interface visitor for server skeletons // ************************************************************ be_visitor_interface_ss::be_visitor_interface_ss (be_visitor_context *ctx) : be_visitor_interface (ctx) { } be_visitor_interface_ss::~be_visitor_interface_ss (void) { } int be_visitor_interface_ss::visit_interface (be_interface *node) { TAO_OutStream *os; // output stream if (node->srv_skel_gen () || node->imported () || node->is_local ()) return 0; os = this->ctx_->stream (); // generate the skeleton class name os->indent (); // start with whatever indentation level we are at if (node->gen_operation_table () == -1) { ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_ss::" "visit_interface - " "codegen for operation table failed\n"), -1); } // Strategized Proxy Broker Implementation be_visitor *visitor = 0; be_visitor_context ctx; // Interceptor classes ctx = *this->ctx_; visitor = 0; ctx.state (TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS); visitor = tao_cg->make_visitor (&ctx); if (!visitor || (node->accept (visitor) == -1)) { delete visitor; ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_cs::" "visit_interface - " "codegen for interceptors classes failed\n"), -1); } delete visitor; visitor = 0; if (be_global->gen_thru_poa_collocation () || be_global->gen_direct_collocation ()) { ctx = (*this->ctx_); ctx.state (TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS); visitor = tao_cg->make_visitor (&ctx); if (!visitor || (node->accept (visitor) == -1)) { delete visitor; ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_cs::" "visit_interface - " "codegen for Base Proxy Broker class failed\n"), -1); } delete visitor; // Proxy Broker Factory Function. *os << be_nl << node->full_base_proxy_broker_name () << " *" << be_nl << node->flat_client_enclosing_scope () << node->base_proxy_broker_name () << "_Factory_function (CORBA::Object_ptr obj)" << be_nl << "{" << be_idt_nl // idt = 1 << "ACE_UNUSED_ARG (obj);" << be_nl << "return ::" << node->full_strategized_proxy_broker_name () << "::" <<"the" << node->strategized_proxy_broker_name () << "();" << be_uidt_nl // idt = 0 << "}" << be_nl << be_nl; // Proxy Broker Function Pointer Initializer. *os << "int" << be_nl << node->flat_client_enclosing_scope () << node->base_proxy_broker_name () << "_Factory_Initializer (long)" << be_nl << "{" << be_idt_nl // idt = 1 << node->flat_client_enclosing_scope () << node->base_proxy_broker_name () << "_Factory_function_pointer = " << be_idt_nl // idt = 2 << node->flat_client_enclosing_scope () << node->base_proxy_broker_name () << "_Factory_function;" << be_uidt_nl // idt = 1 << be_nl << "return 0;" << be_uidt_nl // idt = 0 << "}" << be_nl << be_nl; *os << "static int " << node->flat_client_enclosing_scope () << node->base_proxy_broker_name () << "_Stub_Factory_Initializer_Scarecrow = " << be_idt_nl << node->flat_client_enclosing_scope () << node->base_proxy_broker_name () << "_Factory_Initializer (ACE_reinterpret_cast (long, " << node->flat_client_enclosing_scope () << node->base_proxy_broker_name () << "_Factory_Initializer));" << be_uidt_nl << be_nl; } // Proxy Impl Implementations. if (be_global->gen_thru_poa_collocation ()) { visitor = 0; ctx = *this->ctx_; ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS); visitor = tao_cg->make_visitor (&ctx); if (!visitor || (node->accept (visitor) == -1)) { delete visitor; ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_cs::" "visit_interface - " "codegen for Base Proxy Broker class failed\n"), -1); } delete visitor; } if (be_global->gen_direct_collocation ()) { visitor = 0; ctx = *this->ctx_; ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS); visitor = tao_cg->make_visitor (&ctx); if (!visitor || (node->accept (visitor) == -1)) { delete visitor; ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_cs::" "visit_interface - " "codegen for Base Proxy Broker class failed\n"), -1); } delete visitor; } os->decr_indent (0); // constructor *os << "// skeleton constructor\n"; // find if we are at the top scope or inside some module if (!node->is_nested ()) { // we are outermost. So the POA_ prefix is prepended to our name *os << node->full_skel_name () << "::POA_" << node->local_name () << " (void)\n"; } else { // the POA_ prefix is prepended to our outermost module name *os << node->full_skel_name () << "::" << node->local_name () << " (void)\n"; } // Generate optable *os << "{" << be_idt_nl << "this->optable_ = &tao_" << node->flat_name () << "_optable;" << be_uidt_nl << "}\n\n"; *os << "// copy ctor\n"; // find if we are at the top scope or inside some module if (!node->is_nested ()) { // we are outermost. So the POA_ prefix is prepended to our name *os << node->full_skel_name () << "::POA_" << node->local_name () << " (" << "const POA_" << node->local_name () << "& rhs)"; } else { // the POA_ prefix is prepended to our outermost module name *os << node->full_skel_name () << "::" << node->local_name () << " (const " << node->local_name () << "& rhs)"; } *os << be_idt_nl << ": "; if (node->traverse_inheritance_graph (be_interface::copy_ctor_helper, os) == -1) ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_ss::visit_interface - " " copy ctor generation failed\n"), -1); *os << " TAO_ServantBase (rhs)" << be_uidt_nl << "{}" << be_nl << be_nl; *os << "// skeleton destructor" << be_nl; if (!node->is_nested ()) { // we are outermost. So the POA_ prefix is prepended to our name *os << node->full_skel_name () << "::~POA_" << node->local_name () << " (void)" << be_nl; } else { // the POA_ prefix is prepended to our outermost module name *os << node->full_skel_name () << "::~" << node->local_name () << " (void)" << be_nl; } *os << "{" << be_nl; *os << "}\n\n"; // generate code for elements in the scope (e.g., operations) if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_ss::" "visit_interface - " "codegen for scope failed\n"), -1); } // Generate code for the _is_a skeleton. os->indent (); *os << "void " << node->full_skel_name () << "::_is_a_skel (" << be_idt << be_idt_nl << "TAO_ServerRequest &_tao_server_request, " << be_nl << "void * _tao_object_reference," << be_nl << "void * /* Servant_Upcall */," << be_nl << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl << ")" << be_uidt_nl; *os << "{" << be_idt_nl; *os << "TAO_InputCDR &_tao_in = _tao_server_request.incoming ();" << be_nl; *os << node->full_skel_name () << " *_tao_impl = (" << node->full_skel_name () << " *) _tao_object_reference;" << be_nl; *os << "CORBA::Boolean _tao_retval = 0;" << be_nl; *os << "CORBA::String_var value;" << be_nl; *os << "if (!(_tao_in >> value.out ()))" << be_idt_nl; if (be_global->use_raw_throw ()) *os << "throw CORBA::MARSHAL ();" << be_uidt_nl << be_nl; else *os << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt_nl << be_nl; *os << "_tao_retval = _tao_impl->_is_a (value.in (), ACE_TRY_ENV);" << be_nl; *os << "ACE_CHECK;" << be_nl << be_nl; *os << "_tao_server_request.init_reply ();" << be_nl; *os << "TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();" << be_nl; *os << "if (!(_tao_out << CORBA::Any::from_boolean (_tao_retval)))" << be_idt_nl; if (be_global->use_raw_throw ()) *os << "throw CORBA::MARSHAL ();" << be_uidt << be_uidt_nl; else *os << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt << be_uidt_nl; *os << "}" << be_nl << be_nl; // Generate code for the _non_existent skeleton. *os << "void " << node->full_skel_name () << "::_non_existent_skel (" << be_idt << be_idt_nl << "TAO_ServerRequest &_tao_server_request, " << be_nl << "void * _tao_object_reference," << be_nl << "void * /* Servant_Upcall */," << be_nl << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl << ")" << be_uidt_nl; *os << "{" << be_idt_nl; *os << node->full_skel_name () << " *_tao_impl = (" << node->full_skel_name () << " *) _tao_object_reference;" << be_nl; *os << "CORBA::Boolean _tao_retval = _tao_impl->_non_existent (ACE_TRY_ENV);" << be_nl; *os << "ACE_CHECK;" << be_nl << be_nl; *os << "_tao_server_request.init_reply ();" << be_nl; *os << "TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();" << be_nl; *os << "if (!(_tao_out << CORBA::Any::from_boolean (_tao_retval)))" << be_idt_nl; if (be_global->use_raw_throw ()) *os << "throw CORBA::MARSHAL ();" << be_uidt << be_uidt_nl; else *os << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt << be_uidt_nl; *os << "}\n\n"; // Generate code for the _interface skeleton. *os << "void " << node->full_skel_name () << "::_interface_skel (" << be_idt << be_idt_nl << "TAO_ServerRequest &_tao_server_request, " << be_nl << "void * _tao_object_reference," << be_nl << "void * /* Servant_Upcall */," << be_nl << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl << ")" << be_uidt_nl; *os << "{" << be_idt_nl; *os << node->full_skel_name () << " *_tao_impl = (" << node->full_skel_name () << " *) _tao_object_reference;" << be_nl << "CORBA_InterfaceDef_ptr _tao_retval = 0;" << be_nl << "CORBA::Boolean _tao_result = 0;" << be_nl << be_nl; *os << "TAO_IFR_Client_Adapter *_tao_adapter =" << be_idt_nl << "ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (" << be_idt << be_idt_nl << "TAO_ORB_Core::ifr_client_adapter_name ()" << be_uidt_nl << ");" << be_uidt_nl << be_uidt_nl; *os << "if (_tao_adapter == 0)" << be_idt_nl << "{" << be_idt_nl << "ACE_THROW (CORBA::INTF_REPOS ());" << be_uidt_nl << "}" << be_uidt_nl << be_nl; *os << "ACE_TRY" << be_idt_nl << "{" << be_idt_nl << "_tao_retval = _tao_impl->_get_interface (ACE_TRY_ENV);" << be_nl << "ACE_TRY_CHECK;" << be_nl << be_nl << "_tao_server_request.init_reply ();" << be_nl << be_nl << "TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();" << be_nl << be_nl << "_tao_result =" << be_idt_nl << "_tao_adapter->interfacedef_cdr_insert (" << be_idt << be_idt_nl << "_tao_out," << be_nl << "_tao_retval" << be_uidt_nl << ");" << be_uidt << be_uidt << be_uidt_nl << "}" << be_uidt_nl << "ACE_CATCHALL" << be_idt_nl << "{" << be_idt_nl << "_tao_adapter->dispose (_tao_retval);" << be_uidt_nl << "}" << be_uidt_nl << "ACE_ENDTRY;" << be_nl << be_nl; *os << "if (_tao_result == 0)" << be_idt_nl << "{" << be_idt_nl << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt_nl << "}" << be_uidt << be_uidt_nl; *os << "}\n\n"; // Generate code for the _is_a override. os->indent (); *os << "CORBA::Boolean " << node->full_skel_name () << "::_is_a (" << be_idt << be_idt_nl << "const char* value," << be_nl << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl << "const char *base_id = CORBA::_tc_Object->id (ACE_TRY_ENV);" << be_nl << "ACE_CHECK_RETURN (0);" << be_nl << be_nl << "if (\n" << be_idt; if (node->traverse_inheritance_graph (be_interface::is_a_helper, os) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_ss::" "visit_interface - " "traversal of inhertance graph failed\n"), -1); } os->indent (); *os << "(!ACE_OS::strcmp ((char *)value, base_id)))" << be_idt_nl << "return 1;" << be_uidt_nl << "else" << be_idt_nl << "return 0;" << be_uidt << be_uidt << be_uidt_nl << "}" << be_nl << be_nl; // the downcast method. *os << "void* " << node->full_skel_name () << "::_downcast (" << be_idt << be_idt_nl << "const char* logical_type_id" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl; if (node->traverse_inheritance_graph (be_interface::downcast_helper, os) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_ss::" "visit_interface - " "traversal of inhertance graph failed\n"), -1); } *os << "if (ACE_OS::strcmp (logical_type_id, " << "\"IDL:omg.org/CORBA/Object:1.0\") == 0)" << be_idt_nl << "return ACE_static_cast(PortableServer::Servant, this);" << be_uidt_nl; *os << "return 0;" << be_uidt_nl << "}" << be_nl << be_nl; // Print out dispatch method this->dispatch_method (node); *os << be_nl; *os << "const char* " << node->full_skel_name () << "::_interface_repository_id (void) const" << be_nl; *os << "{" << be_idt_nl; *os << "return \"" << node->repoID () << "\";" << be_uidt_nl; *os << "}" << be_nl << be_nl; this->this_method (node); *os << "CORBA::Object_ptr tmp = CORBA::Object::_nil ();" << be_nl << be_nl << "if (stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ())" << be_idt_nl // idt = 2 << "ACE_NEW_RETURN (tmp, CORBA::Object (stub, 1, this), 0);" << be_uidt_nl // idt = 1 << "else" << be_idt_nl // idt = 2 << "ACE_NEW_RETURN (tmp, CORBA::Object (stub, 0, this), 0);" << be_uidt_nl << be_nl // idt = 1 << "CORBA::Object_var obj = tmp;" << be_nl << be_nl; *os << "(void) safe_stub.release ();" << be_nl << be_nl; *os << "return " << "::" << node->full_name () << "::_unchecked_narrow (obj.in ());" << be_uidt_nl // idt = 0 << "}" << be_nl; // the _create_collocated_objref method. If the idl compiler does // not generate the type of collocated stub but the orb is asking // for it, simply return null so a remote stub will be used. // generate the collocated class impl /* if (be_global->gen_thru_poa_collocation ()) { be_visitor_context ctx (*this->ctx_); ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS); be_visitor *visitor = tao_cg->make_visitor (&ctx); if (!visitor) { ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_ss::" "visit_interface - " "Bad visitor for thru_poa collocated class\n"), -1); } if (node->accept (visitor) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_ss::" "visit_interface - " "codegen for thru_poa collocated class failed\n"), -1); } delete visitor; } if (be_global->gen_direct_collocation ()) { be_visitor_context ctx (*this->ctx_); ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS); be_visitor *visitor = tao_cg->make_visitor (&ctx); if (!visitor) { ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_ss::" "visit_interface - " "Bad visitor for direct collocated class\n"), -1); } if (node->accept (visitor) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_ss::" "visit_interface - " "codegen for direct collocated class failed\n"), -1); } delete visitor; } */ *os << "\n\n"; return 0; } void be_visitor_interface_ss::this_method (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); // the _this () operation *os << node->full_name () << "*" << be_nl << node->full_skel_name () << "::_this (CORBA_Environment &ACE_TRY_ENV)" << be_nl << "{" << be_idt_nl // idt = 1 << "TAO_Stub *stub = this->_create_stub (ACE_TRY_ENV);" << be_nl << "ACE_CHECK_RETURN (0);" << be_nl << be_nl << "TAO_Stub_Auto_Ptr safe_stub (stub);" << be_nl << be_nl; } void be_visitor_interface_ss::dispatch_method (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); // now the dispatch method *os << "void " << node->full_skel_name () << "::_dispatch (TAO_ServerRequest &req, " << "void *servant_upcall, CORBA::Environment &ACE_TRY_ENV)" << be_nl; *os << "{" << be_idt_nl; //BRT *os << "this->synchronous_upcall_dispatch (req," << be_nl << " servant_upcall," << be_nl << " this," << be_nl << " ACE_TRY_ENV);" << be_uidt_nl; // *os << "TAO_Skeleton skel; // pointer to skeleton for operation" << be_nl; // *os << "const char *opname = req.operation (); // retrieve operation name" // << be_nl; // *os << "// find the skeleton corresponding to this opname" << be_nl; // *os << "if (this->_find (opname, skel, req.operation_length ()) == -1)" << be_nl; // *os << "{" << be_idt_nl; // *os << "ACE_ERROR ((LM_ERROR, \"Bad operation <%s>\\n\", opname));" << be_nl; // if (idl_global->use_raw_throw ()) // *os << "throw CORBA_BAD_OPERATION ();"; // else // *os << "ACE_THROW (CORBA_BAD_OPERATION ());"; // *os << be_uidt_nl; // *os << "}" << be_nl; // *os << "else" << be_idt_nl; // *os << "skel (req, this, context, ACE_TRY_ENV);" << be_uidt << be_uidt_nl; *os << "}" << be_nl << be_nl; }
grusso14/eprot
src/it/finsiel/siged/mvc/presentation/actionform/amministrazione/org/aoo/AreaOrganizzativaForm.java
<filename>src/it/finsiel/siged/mvc/presentation/actionform/amministrazione/org/aoo/AreaOrganizzativaForm.java package it.finsiel.siged.mvc.presentation.actionform.amministrazione.org.aoo; import it.finsiel.siged.model.organizzazione.AreaOrganizzativa; import it.finsiel.siged.mvc.business.LookupDelegate; import it.finsiel.siged.mvc.vo.IdentityVO; import it.finsiel.siged.mvc.vo.organizzazione.AreaOrganizzativaVO; import it.finsiel.siged.util.DateUtil; import it.finsiel.siged.util.NumberUtil; import java.util.ArrayList; import java.util.Collection; import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; public final class AreaOrganizzativaForm extends ActionForm { /** * @return Returns the areaorganizzativa. */ public AreaOrganizzativaVO getAreaorganizzativa() { return areaorganizzativa; } /** * @param areaorganizzativa * The areaorganizzativa to set. */ public void setAreaorganizzativa(AreaOrganizzativaVO areaorganizzativa) { this.areaorganizzativa = areaorganizzativa; } static Logger logger = Logger.getLogger(AreaOrganizzativa.class.getName()); private int id; private String codi_aoo; private String description; private String data_istituzione; private String responsabile_nome; private String responsabile_cognome; private String responsabile_email; private String responsabile_telefono; private String data_soppressione; private String telefono; private String fax; private String indi_dug; private String indi_toponimo; private String indi_civico; private String indi_cap; private String indi_comune; private Collection province; private String email; private String dipartimento_codice; private String dipartimento_descrizione; private String tipo_aoo; private int provincia_id; private String codi_documento_doc; private int amministrazione_id; private String desc_amministrazione; private int versione; private Collection areeOrganizzative; private AreaOrganizzativaVO areaorganizzativa; // campi dati posta elettronica normale e certificata private String pec_indirizzo; private String pec_username; private String pec_pwd; private boolean pecAbilitata; private String pec_ssl_port; private String pec_pop3; private String pec_smtp; private String pec_smtp_port; private String pn_indirizzo; private String pn_username; private String pn_pwd; private boolean pn_ssl; private String pn_ssl_port; private String pn_pop3; private String pn_smtp; private int pecTimer; private String dirDocumenti; private int dipendenzaTitolarioUfficio; private int titolarioLivelloMinimo; private boolean modificabileDipendenzaTitolarioUfficio; /** * @param tipo_aoo * The tipo_aoo to set. */ public void setTipo_aoo(String tipo_aoo) { this.tipo_aoo = tipo_aoo; } public void reset(ActionMapping mapping, HttpServletRequest request) { } public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if (request.getParameter("btnSalva") != null) { if (getDescription() == null || "".equals(getDescription().trim())) { errors.add("description", new ActionMessage( "campo.obbligatorio", "Descrizione", "")); } if (getCodi_aoo() == null || "".equals(getCodi_aoo().trim())) { errors.add("description", new ActionMessage( "campo.obbligatorio", "Codice", "")); } if (getIndi_dug() == null) { errors.add("indi_dug", new ActionMessage("campo.obbligatorio", "Data istituzione", "")); } String dataIst = getData_istituzione(); if (dataIst != null && !"".equals(dataIst)) { if (!DateUtil.isData(dataIst)) { // la data di ricezione deve essere nel formato valido: // gg/mm/aaaa errors.add("dataIst", new ActionMessage( "formato.data.errato", "Data istituzione")); } } else { errors.add("description", new ActionMessage( "campo.obbligatorio", "Data istituzione", "")); } if (getIndi_dug() == null || "".equals(getIndi_dug().trim())) { errors.add("Dug", new ActionMessage("campo.obbligatorio", "Dug", "")); } if (getIndi_toponimo() == null || "".equals(getIndi_toponimo().trim())) { errors.add("Toponimo", new ActionMessage("campo.obbligatorio", "Toponimo", "")); } if (getIndi_civico() == null || "".equals(getIndi_civico().trim())) { errors.add("Toponimo", new ActionMessage("campo.obbligatorio", "Civico", "")); } if (getIndi_cap() == null || "".equals(getIndi_cap().trim())) { errors.add("Toponimo", new ActionMessage("campo.obbligatorio", "CAP", "")); } if (getIndi_comune() == null || "".equals(getIndi_comune().trim())) { errors.add("Toponimo", new ActionMessage("campo.obbligatorio", "Comune", "")); } if (getDipartimento_codice() != null && !NumberUtil.isInteger(getDipartimento_codice())) { errors.add("codice DIpartimento", new ActionMessage( "formato.numerico.errato", "Codice dipartimento", "")); } } else if (request.getParameter("btnCancella") != null && (request.getParameter("id") == null)) { errors.add("id", new ActionMessage("campo.obbligatorio", "AreaOrganizzativa", "")); } return errors; } public void inizializzaForm() { setId(0); setDescription(null); setResponsabile_nome(null); setAmministrazione_id(0); setCodi_aoo(null); setCodi_documento_doc(null); setData_istituzione(null); setData_soppressione(null); setDipartimento_codice(null); setDipartimento_descrizione(null); setEmail(null); setFax(null); setIndi_cap(null); setIndi_civico(null); setIndi_comune(null); setIndi_dug(null); setIndi_toponimo(null); setProvincia_id(0); setResponsabile_cognome(null); setResponsabile_email(null); setResponsabile_telefono(null); setTelefono(null); setTipo_aoo("L"); setVersione(0); setPec_indirizzo(null); setPec_pop3(null); setPec_pwd(<PASSWORD>); setPec_smtp(null); setPecAbilitata(false); setPec_ssl_port(null); setPec_username(null); setPn_indirizzo(null); setPn_pop3(null); setPn_pwd(null); setPn_smtp(null); setPn_ssl(false); setPn_ssl_port(null); setPn_username(null); setMsgSuccess(null); setModificabileDipendenzaTitolarioUfficio(true); } /** * @return Returns the profili. */ /** * @return Returns the amministrazione_id. */ public int getAmministrazione_id() { return amministrazione_id; } /** * @param amministrazione_id * The amministrazione_id to set. */ public void setAmministrazione_id(int amministrazione_id) { this.amministrazione_id = amministrazione_id; } /** * @return Returns the codi_documento_doc. */ public String getCodi_documento_doc() { return codi_documento_doc; } /** * @param codi_documento_doc * The codi_documento_doc to set. */ public void setCodi_documento_doc(String codi_documento_doc) { this.codi_documento_doc = codi_documento_doc; } /** * @return Returns the data_istituzione. */ public String getData_istituzione() { return data_istituzione; } /** * @param data_istituzione * The data_istituzione to set. */ public void setData_istituzione(String data_istituzione) { this.data_istituzione = data_istituzione; } /** * @return Returns the data_soppressione. */ public String getData_soppressione() { return data_soppressione; } /** * @param data_soppressione * The data_soppressione to set. */ public void setData_soppressione(String data_soppressione) { this.data_soppressione = data_soppressione; } /** * @return Returns the dipartimento_codice. */ public String getDipartimento_codice() { return dipartimento_codice; } /** * @param dipartimento_codice * The dipartimento_codice to set. */ public void setDipartimento_codice(String dipartimento_codice) { this.dipartimento_codice = dipartimento_codice; } /** * @return Returns the dipartimento_descrizione. */ public String getDipartimento_descrizione() { return dipartimento_descrizione; } /** * @param dipartimento_descrizione * The dipartimento_descrizione to set. */ public void setDipartimento_descrizione(String dipartimento_descrizione) { this.dipartimento_descrizione = dipartimento_descrizione; } /** * @return Returns the email. */ public String getEmail() { return email; } /** * @param email * The email to set. */ public void setEmail(String email) { this.email = email; } /** * @return Returns the fax. */ public String getFax() { return fax; } /** * @param fax * The fax to set. */ public void setFax(String fax) { this.fax = fax; } /** * @return Returns the id. */ public int getId() { return id; } /** * @param id * The id to set. */ public void setId(int id) { this.id = id; } /** * @return Returns the indi_cap. */ public String getIndi_cap() { return indi_cap; } /** * @param indi_cap * The indi_cap to set. */ public void setIndi_cap(String indi_cap) { this.indi_cap = indi_cap; } /** * @return Returns the indi_civico. */ public String getIndi_civico() { return indi_civico; } /** * @param indi_civico * The indi_civico to set. */ public void setIndi_civico(String indi_civico) { this.indi_civico = indi_civico; } /** * @return Returns the indi_comune. */ public String getIndi_comune() { return indi_comune; } /** * @param indi_comune * The indi_comune to set. */ public void setIndi_comune(String indi_comune) { this.indi_comune = indi_comune; } /** * @return Returns the indi_dug. */ public String getIndi_dug() { return indi_dug; } /** * @param indi_dug * The indi_dug to set. */ public void setIndi_dug(String indi_dug) { this.indi_dug = indi_dug; } /** * @return Returns the indi_toponimo. */ public String getIndi_toponimo() { return indi_toponimo; } /** * @param indi_toponimo * The indi_toponimo to set. */ public void setIndi_toponimo(String indi_toponimo) { this.indi_toponimo = indi_toponimo; } /** * @return Returns the provincia_id. */ public int getProvincia_id() { return provincia_id; } /** * @param provincia_id * The provincia_id to set. */ public void setProvincia_id(int provincia_id) { this.provincia_id = provincia_id; } /** * @return Returns the responsabile_cognome. */ public String getResponsabile_cognome() { return responsabile_cognome; } /** * @param responsabile_cognome * The responsabile_cognome to set. */ public void setResponsabile_cognome(String responsabile_cognome) { this.responsabile_cognome = responsabile_cognome; } /** * @return Returns the responsabile_email. */ public String getResponsabile_email() { return responsabile_email; } /** * @param responsabile_email * The responsabile_email to set. */ public void setResponsabile_email(String responsabile_email) { this.responsabile_email = responsabile_email; } /** * @return Returns the responsabile_nome. */ public String getResponsabile_nome() { return responsabile_nome; } /** * @param responsabile_nome * The responsabile_nome to set. */ public void setResponsabile_nome(String responsabile_nome) { this.responsabile_nome = responsabile_nome; } /** * @return Returns the responsabile_telefono. */ public String getResponsabile_telefono() { return responsabile_telefono; } /** * @param responsabile_telefono * The responsabile_telefono to set. */ public void setResponsabile_telefono(String responsabile_telefono) { this.responsabile_telefono = responsabile_telefono; } /** * @return Returns the telefono. */ public String getTelefono() { return telefono; } /** * @param telefono * The telefono to set. */ public void setTelefono(String telefono) { this.telefono = telefono; } /** * @return Returns the tipo_aoo. */ public String getTipo_aoo() { return tipo_aoo; } /** * @return Returns the versione. */ public int getVersione() { return versione; } /** * @param versione * The versione to set. */ public void setVersione(int versione) { this.versione = versione; } /** * @return Returns the areeOrganizzative. */ public Collection getAreeOrganizzative() { return areeOrganizzative; } /** * @param areeOrganizzative * The areeOrganizzative to set. */ public void setAreeOrganizzative(Collection areeOrganizzative) { this.areeOrganizzative = areeOrganizzative; } /** * @return Returns the description. */ public String getDescription() { return description; } /** * @param description * The description to set. */ public void setDescription(String description) { this.description = description; } /** * @return Returns the codice. */ /** * @return Returns the codi_aoo. */ public String getCodi_aoo() { return codi_aoo; } /** * @param codi_aoo * The codi_aoo to set. */ public void setCodi_aoo(String codi_aoo) { this.codi_aoo = codi_aoo; } /** * @return Returns the province. */ public Collection getProvince() { return LookupDelegate.getInstance().getProvince(); } /** * @param province * The province to set. */ public void setProvince(Collection province) { this.province = province; } public String getDesc_amministrazione() { return desc_amministrazione; } public void setDesc_amministrazione(String desc_amministrazione) { this.desc_amministrazione = desc_amministrazione; } public static Logger getLogger() { return logger; } public static void setLogger(Logger logger) { AreaOrganizzativaForm.logger = logger; } public String getPec_indirizzo() { return pec_indirizzo; } public void setPec_indirizzo(String pec_indirizzo) { this.pec_indirizzo = pec_indirizzo; } public String getPec_pop3() { return pec_pop3; } public void setPec_pop3(String pec_pop3) { this.pec_pop3 = pec_pop3; } public String getPec_pwd() { return pec_pwd; } public void setPec_pwd(String pec_pwd) { this.pec_pwd = pec_pwd; } public String getPec_smtp() { return pec_smtp; } public void setPec_smtp(String pec_smtp) { this.pec_smtp = pec_smtp; } public boolean getPecAbilitata() { return pecAbilitata; } public void setPecAbilitata(boolean pec_ssl) { this.pecAbilitata = pec_ssl; } public String getPec_ssl_port() { return pec_ssl_port; } public void setPec_ssl_port(String pec_ssl_port) { this.pec_ssl_port = pec_ssl_port; } public String getPec_username() { return pec_username; } public void setPec_username(String pec_username) { this.pec_username = pec_username; } public String getPn_indirizzo() { return pn_indirizzo; } public void setPn_indirizzo(String pn_indirizzo) { this.pn_indirizzo = pn_indirizzo; } public String getPn_pop3() { return pn_pop3; } public void setPn_pop3(String pn_pop3) { this.pn_pop3 = pn_pop3; } public String getPn_pwd() { return pn_pwd; } public void setPn_pwd(String pn_pwd) { this.pn_pwd = pn_pwd; } public String getPn_smtp() { return pn_smtp; } public void setPn_smtp(String pn_smtp) { this.pn_smtp = pn_smtp; } public boolean getPn_ssl() { return pn_ssl; } public void setPn_ssl(boolean pn_ssl) { this.pn_ssl = pn_ssl; } public String getPn_ssl_port() { return pn_ssl_port; } public void setPn_ssl_port(String pn_ssl_port) { this.pn_ssl_port = pn_ssl_port; } public String getPn_username() { return pn_username; } public void setPn_username(String pn_username) { this.pn_username = pn_username; } public Collection getTipiAoo() { Collection tipiAoo = new ArrayList(); IdentityVO idVO; idVO = new IdentityVO(); idVO.setCodice("L"); idVO.setDescription("AOO Light"); tipiAoo.add(idVO); idVO = new IdentityVO(); idVO.setCodice("F"); idVO.setDescription("AOO Full"); tipiAoo.add(idVO); return tipiAoo; } public String getPec_smtp_port() { return pec_smtp_port; } public void setPec_smtp_port(String pec_smtp_port) { this.pec_smtp_port = pec_smtp_port; } private String msgSuccess; public String getMsgSuccess() { return msgSuccess; } public void setMsgSuccess(String msgSuccess) { this.msgSuccess = msgSuccess; } public int getPecTimer() { return pecTimer; } public void setPecTimer(int pecTimer) { this.pecTimer = pecTimer; } public String getDirDocumenti() { return dirDocumenti; } public void setDirDocumenti(String dirDocumenti) { this.dirDocumenti = dirDocumenti; } public int getDipendenzaTitolarioUfficio() { return dipendenzaTitolarioUfficio; } public void setDipendenzaTitolarioUfficio(int dipendenzaTitolarioUfficio) { this.dipendenzaTitolarioUfficio = dipendenzaTitolarioUfficio; } public int getTitolarioLivelloMinimo() { return titolarioLivelloMinimo; } public void setTitolarioLivelloMinimo(int titolarioLivelloMinimo) { this.titolarioLivelloMinimo = titolarioLivelloMinimo; } public boolean getModificabileDipendenzaTitolarioUfficio() { return modificabileDipendenzaTitolarioUfficio; } public void setModificabileDipendenzaTitolarioUfficio( boolean isModificabileDipendenzaTitolarioUfficio) { this.modificabileDipendenzaTitolarioUfficio = isModificabileDipendenzaTitolarioUfficio; } }
peroxy/starsky
src/main/java/com/starsky/backend/api/team/CreateTeamRequest.java
<gh_stars>1-10 package com.starsky.backend.api.team; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.v3.oas.annotations.media.Schema; import javax.validation.constraints.NotBlank; public class CreateTeamRequest { @NotBlank @Schema(example = "My Police Squad", title = "Team name") private String name; @JsonCreator public CreateTeamRequest(@NotBlank String name) { this.name = name; } public String getName() { return name; } public void setName(@NotBlank String name) { this.name = name; } }
ekanayake95/agora
src/main/java/com/example/domain/Payment.java
package com.example.domain; import io.swagger.annotations.ApiModelProperty; import java.time.LocalDate; import java.util.Date; public class Payment { private static final long serialVersionUID = 1L; @ApiModelProperty(notes = "vehicleID of the vehicle") private String id; @ApiModelProperty(notes = "inquiryId of the Payment") private String inquiryId; @ApiModelProperty(notes = "inquiryPrice of the Payment") private String inquiryPrice; @ApiModelProperty(notes = "AddKm of the Payment") private String addKm; @ApiModelProperty(notes = "kmCharge of the Payment") private String kmCharge; @ApiModelProperty(notes = "AddKm of the Payment") private String addHours; @ApiModelProperty(notes = "kmCharge of the Payment") private String hoursCharge; @ApiModelProperty(notes = "discount of the Payment") private String discount; @ApiModelProperty(notes = "customerCharge of the Payment") private String customerCharge; @ApiModelProperty(notes = "status of the Payment") private String status; @ApiModelProperty(notes = "fuel of the Payment") private String fuel; @ApiModelProperty(notes = "paymentDate of the Payment") private Date paymentDate; @ApiModelProperty(notes = "driverCharge of the Payment") private String driverCharge; @ApiModelProperty(notes = "commissionDis of the Payment") private String commissionDis; @ApiModelProperty(notes = "netProfit of the Payment") private String netProfit; @ApiModelProperty(notes = "netProfit of the Payment") private String LocalDate; public static long getSerialVersionUID() { return serialVersionUID; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getInquiryId() { return inquiryId; } public void setInquiryId(String inquiryId) { this.inquiryId = inquiryId; } public String getInquiryPrice() { return inquiryPrice; } public void setInquiryPrice(String inquiryPrice) { this.inquiryPrice = inquiryPrice; } public String getAddKm() { return addKm; } public void setAddKm(String addKm) { this.addKm = addKm; } public String getKmCharge() { return kmCharge; } public void setKmCharge(String kmCharge) { this.kmCharge = kmCharge; } public String getDiscount() { return discount; } public void setDiscount(String discount) { this.discount = discount; } public String getCustomerCharge() { return customerCharge; } public void setCustomerCharge(String customerCharge) { this.customerCharge = customerCharge; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getFuel() { return fuel; } public void setFuel(String fuel) { this.fuel = fuel; } public Date getPaymentDate() { return paymentDate; } public void setPaymentDate(Date paymentDate) { this.paymentDate = paymentDate; } public String getDriverCharge() { return driverCharge; } public void setDriverCharge(String driverCharge) { this.driverCharge = driverCharge; } public String getCommissionDis() { return commissionDis; } public void setCommissionDis(String commissionDis) { this.commissionDis = commissionDis; } public String getNetProfit() { return netProfit; } public void setNetProfit(String netProfit) { this.netProfit = netProfit; } public String getLocalDate() { return LocalDate; } public void setLocalDate(String localDate) { LocalDate = localDate; } public String getAddHours() { return addHours; } public void setAddHours(String addHours) { this.addHours = addHours; } public String getHoursCharge() { return hoursCharge; } public void setHoursCharge(String hoursCharge) { this.hoursCharge = hoursCharge; } @Override public String toString() { return "Payment{" + "id='" + id + '\'' + ", inquiryId='" + inquiryId + '\'' + ", inquiryPrice='" + inquiryPrice + '\'' + ", addKm='" + addKm + '\'' + ", kmCharge='" + kmCharge + '\'' + ", discount='" + discount + '\'' + ", customerCharge='" + customerCharge + '\'' + ", status='" + status + '\'' + ", fuel='" + fuel + '\'' + ", paymentDate=" + paymentDate + ", driverCharge='" + driverCharge + '\'' + ", commissionDis='" + commissionDis + '\'' + ", netProfit='" + netProfit + '\'' + ", LocalDate=" + LocalDate + '}'; } }
znerd/logdoc
logdoc-core/src/main/java/org/znerd/logdoc/JulLogBridge.java
<gh_stars>1-10 // See the COPYRIGHT file for copyright and license information package org.znerd.logdoc; import java.util.logging.Level; import java.util.logging.Logger; import org.znerd.logdoc.internal.ContextIdSupport; import org.znerd.util.log.LogLevel; public class JulLogBridge extends AbstractLogBridge { private static final JulLogBridge SINGLETON_INSTANCE = new JulLogBridge(); private final ContextIdSupport contextIdSupport = new ContextIdSupport(); private JulLogBridge() { } public static final JulLogBridge getInstance() { return SINGLETON_INSTANCE; } @Override public void putContextId(String newContextId) { contextIdSupport.putContextId(newContextId); } @Override public void unputContextId() { contextIdSupport.unputContextId(); } @Override public String getContextId() { return contextIdSupport.getContextId(); } @Override public boolean shouldLog(String domain, String groupId, String entryId, LogLevel level) { if (!getLevel().isSmallerThanOrEqualTo(level)) { return false; } Logger logger = getLogger(domain, groupId, entryId); Level julLevel = toJulLevel(level); return logger.isLoggable(julLevel); } private Logger getLogger(String domain, String groupId, String entryId) { return Logger.getLogger(domain + '.' + groupId + '.' + entryId); } private Level toJulLevel(LogLevel level) { if (LogLevel.DEBUG.equals(level)) { return Level.FINE; } else if (LogLevel.INFO.equals(level)) { return Level.INFO; } else if (LogLevel.NOTICE.equals(level)) { return Level.INFO; } else if (LogLevel.WARNING.equals(level)) { return Level.WARNING; } else { return Level.SEVERE; } } @Override public void logOneMessage(String fqcn, String domain, String groupId, String entryId, LogLevel level, String message, Throwable exception) { final Logger logger = getLogger(domain, groupId, entryId); final Level julLevel = toJulLevel(level); final String sourceClass = fqcn; final String sourceMethod = null; final String composedMessage = composeMessage(fqcn, domain, groupId, entryId, level, message, exception); logger.logp(julLevel, sourceClass, sourceMethod, composedMessage, exception); } protected String composeMessage(String fqcn, String domain, String groupId, String entryId, LogLevel level, String message, Throwable exception) { String composedMessage = level.name() + " ["; String contextId = getContextId(); if (contextId != null) { composedMessage += contextId; } composedMessage += "] " + domain + '.' + groupId + '.' + entryId + " " + message; return composedMessage; } }
mambaru/wfc
wfc/statistics/api/del_json.hpp
<gh_stars>1-10 // // Author: <NAME> <<EMAIL>>, (C) 2013-2018 // // Copyright: See COPYING file that comes with this distribution // #pragma once #include <wfc/json.hpp> #include <wfc/statistics/api/del.hpp> #include "aggregated_json.hpp" namespace wfc { namespace statistics { namespace request { struct del_json { JSON_NAME(name) typedef wfc::json::object< del, json::member_list< json::member<n_name, del, std::string, &del::name> > > type; typedef type::target target; typedef type::serializer serializer; }; } namespace response { struct del_json { FAS_NAME(status) typedef wfc::json::object< del, fas::type_list_n< wfc::json::member<n_status, del, bool, &del::status> >::type > type; typedef type::target target; typedef type::serializer serializer; }; } }}
wsu-cb/cbwindows
GM/DlgPEditMulti.cpp
// DlgPEditMulti.cpp : implementation file // // Copyright (c) 1994-2020 By <NAME>, All Rights Reserved. // // 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. // #include "stdafx.h" #include "Gm.h" #include "GmHelp.h" #include "DlgPEditMulti.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CPieceEditMultipleDialog dialog CPieceEditMultipleDialog::CPieceEditMultipleDialog(CWnd* pParent /*=NULL*/) : CDialog(CPieceEditMultipleDialog::IDD, pParent) { //{{AFX_DATA_INIT(CPieceEditMultipleDialog) //}}AFX_DATA_INIT m_bSetTopOnlyVisible = FALSE; m_bTopOnlyOwnersToo = FALSE; m_bSetFrontText = FALSE; m_bSetBackText = FALSE; } void CPieceEditMultipleDialog::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CPieceEditMultipleDialog) DDX_Control(pDX, IDC_D_MPEDIT_TOP_VISIBLE_OWNERS_TOO, m_chkTopVisibleOwnersToo); DDX_Control(pDX, IDC_D_MPEDIT_FRONT_LABEL, m_staticFrontLabel); DDX_Control(pDX, IDC_D_MPEDIT_CHG_BACK_TEXT, m_chkSetBackText); DDX_Control(pDX, IDC_D_MPEDIT_CHG_TOP_TEXT, m_chkSetFrontText); DDX_Control(pDX, IDC_D_MPEDIT_BACK_LABEL, m_staticBackLabel); DDX_Control(pDX, IDC_D_MPEDIT_TOP_VISIBLE, m_chkTopVisible); DDX_Control(pDX, IDC_D_MPEDIT_TEXT_BACK, m_editBack); DDX_Control(pDX, IDC_D_MPEDIT_TEXT_FRONT, m_editFront); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CPieceEditMultipleDialog, CDialog) //{{AFX_MSG_MAP(CPieceEditMultipleDialog) ON_BN_CLICKED(IDC_D_MPEDIT_CHG_BACK_TEXT, OnBtnClickChangeBack) ON_BN_CLICKED(IDC_D_MPEDIT_CHG_TOP_TEXT, OnBtnClickChangeFront) ON_BN_CLICKED(IDC_D_MPEDIT_TOP_VISIBLE, OnBtnClickTopVisible) ON_WM_HELPINFO() ON_WM_CONTEXTMENU() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // Html Help control ID Map static DWORD adwHelpMap[] = { IDC_D_MPEDIT_TOP_VISIBLE_OWNERS_TOO, IDH_D_MPEDIT_TOP_VISIBLE_OWNERS_TOO, IDC_D_MPEDIT_CHG_BACK_TEXT, IDH_D_MPEDIT_CHG_BACK_TEXT, IDC_D_MPEDIT_CHG_TOP_TEXT, IDH_D_MPEDIT_CHG_TOP_TEXT, IDC_D_MPEDIT_TOP_VISIBLE, IDH_D_MPEDIT_TOP_VISIBLE, IDC_D_MPEDIT_TEXT_BACK, IDH_D_MPEDIT_TEXT_BACK, IDC_D_MPEDIT_TEXT_FRONT, IDH_D_MPEDIT_TEXT_FRONT, 0,0 }; ///////////////////////////////////////////////////////////////////////////// void CPieceEditMultipleDialog::UpdateTextControls() { if (m_chkSetFrontText.GetCheck()) { m_editFront.EnableWindow(TRUE); m_staticFrontLabel.EnableWindow(TRUE); } else { m_editFront.EnableWindow(FALSE); m_editFront.SetWindowText(""); m_staticFrontLabel.EnableWindow(FALSE); } if (m_chkSetBackText.GetCheck()) { m_editBack.EnableWindow(TRUE); m_staticBackLabel.EnableWindow(TRUE); } else { m_editBack.EnableWindow(FALSE); m_editBack.SetWindowText(""); m_staticBackLabel.EnableWindow(FALSE); } } ///////////////////////////////////////////////////////////////////////////// // CPieceEditMultipleDialog message handlers void CPieceEditMultipleDialog::OnBtnClickTopVisible() { m_chkTopVisibleOwnersToo.EnableWindow(m_chkTopVisible.GetCheck() == 1); } void CPieceEditMultipleDialog::OnBtnClickChangeBack() { UpdateTextControls(); } void CPieceEditMultipleDialog::OnBtnClickChangeFront() { UpdateTextControls(); } BOOL CPieceEditMultipleDialog::OnInitDialog() { CDialog::OnInitDialog(); m_chkTopVisible.SetCheck(2); // Show as indeterminate m_chkTopVisibleOwnersToo.SetCheck(0); m_chkTopVisibleOwnersToo.EnableWindow(FALSE); m_chkSetFrontText.SetCheck(0); m_chkSetBackText.SetCheck(0); UpdateTextControls(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CPieceEditMultipleDialog::OnOK() { m_bSetTopOnlyVisible = m_chkTopVisible.GetCheck() != 2; m_bTopOnlyVisible = m_chkTopVisible.GetCheck() != 0; m_bTopOnlyOwnersToo = m_chkTopVisibleOwnersToo.GetCheck() != 0; m_bSetFrontText = m_chkSetFrontText.GetCheck() != 0; m_editFront.GetWindowText(m_strFront); m_bSetBackText = m_chkSetBackText.GetCheck() != 0; m_editBack.GetWindowText(m_strBack); CDialog::OnOK(); } BOOL CPieceEditMultipleDialog::OnHelpInfo(HELPINFO* pHelpInfo) { return GetApp()->DoHelpTipHelp(pHelpInfo, adwHelpMap); } void CPieceEditMultipleDialog::OnContextMenu(CWnd* pWnd, CPoint point) { GetApp()->DoHelpWhatIsHelp(pWnd, adwHelpMap); }
neal2018/library
test/verify/yukicoder-430.test.cpp
<reponame>neal2018/library<filename>test/verify/yukicoder-430.test.cpp<gh_stars>100-1000 #define PROBLEM "https://yukicoder.me/problems/no/430" #include "../../template/template.cpp" #include "../../structure/trie/trie.cpp" #include "../../string/aho-corasick.cpp" int main() { string S; int M; cin >> S; cin >> M; AhoCorasick< 26, 'A' > aho; for(int i = 0; i < M; i++) { string T; cin >> T; aho.add(T); } aho.build(); cout << aho.move(S).first << endl; }
bububa/openvision
src/face/tracker/tracker.cpp
<filename>src/face/tracker/tracker.cpp<gh_stars>1-10 #include "../tracker.h" #include <queue> IFaceTracker new_face_tracker() { return new ovface::Tracker(); } void destroy_face_tracker(IFaceTracker t) { delete static_cast<ovface::Tracker*>(t); } int track_face(IFaceTracker t, const FaceInfoVector* curr_faces, TrackedFaceInfoVector* faces) { std::vector<ovface::FaceInfo> cfaces; for (int i = 0; i < curr_faces->length; ++i) { cfaces.push_back(static_cast<ovface::FaceInfo>(curr_faces->faces[i])); } std::vector<ovface::TrackedFaceInfo> tfaces; int ret = static_cast<ovface::Tracker*>(t)->Track(cfaces, &tfaces); if (ret != 0) { return ret; } faces->length = tfaces.size(); faces->faces = (TrackedFaceInfo*)malloc(faces->length * sizeof(TrackedFaceInfo)); for (size_t i = 0; i < faces->length; ++i) { faces->faces[i] = tfaces.at(i); } return 0; } namespace ovface { Tracker::Tracker() { } Tracker::~Tracker() { } int Tracker::Track(const std::vector<FaceInfo>& curr_faces, std::vector<TrackedFaceInfo>* faces) { faces->clear(); int num_faces = static_cast<int>(curr_faces.size()); std::deque<TrackedFaceInfo>scored_tracked_faces(pre_tracked_faces_.begin(), pre_tracked_faces_.end()); std::vector<TrackedFaceInfo> curr_tracked_faces; for (int i = 0; i < num_faces; ++i) { auto& face = curr_faces.at(i); for (auto scored_tracked_face : scored_tracked_faces) { ComputeIOU(scored_tracked_face.face_info_.rect, face.rect, &scored_tracked_face.iou_score_); } if (scored_tracked_faces.size() > 0) { std::partial_sort(scored_tracked_faces.begin(), scored_tracked_faces.begin() + 1, scored_tracked_faces.end(), [](const TrackedFaceInfo &a, const TrackedFaceInfo &b) { return a.iou_score_ > b.iou_score_; }); } if (!scored_tracked_faces.empty() && scored_tracked_faces.front().iou_score_ > minScore_) { TrackedFaceInfo matched_face = scored_tracked_faces.front(); scored_tracked_faces.pop_front(); TrackedFaceInfo &tracked_face = matched_face; if (matched_face.iou_score_ < maxScore_) { tracked_face.face_info_.rect.x = (tracked_face.face_info_.rect.x + face.rect.x) / 2; tracked_face.face_info_.rect.y = (tracked_face.face_info_.rect.y + face.rect.y) / 2; tracked_face.face_info_.rect.width = (tracked_face.face_info_.rect.width + face.rect.width) / 2; tracked_face.face_info_.rect.height = (tracked_face.face_info_.rect.height + face.rect.height) / 2; } else { tracked_face.face_info_ = face; } curr_tracked_faces.push_back(tracked_face); } else { TrackedFaceInfo tracked_face; tracked_face.face_info_ = face; curr_tracked_faces.push_back(tracked_face); } } pre_tracked_faces_ = curr_tracked_faces; *faces = curr_tracked_faces; return 0; } }
christianwgd/photos
usersettings/migrations/0012_auto_20200310_1735.py
<reponame>christianwgd/photos # Generated by Django 3.0.3 on 2020-03-10 16:35 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('usersettings', '0011_auto_20200303_1937'), ] operations = [ migrations.AlterField( model_name='usersettings', name='limit', field=models.PositiveSmallIntegerField(default=0, help_text='0 bedeutet keine Einschränkung', verbose_name='Anzahl Fotos ohne Filter begrenzen auf'), ), ]
mpal9000/amaze
lib/controls/index.js
/** * Module dependencies */ 'use strict'; var _Object$assign = require('babel-runtime/core-js/object/assign')['default']; var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; Object.defineProperty(exports, '__esModule', { value: true }); exports['default'] = Controls; var _ramdaSrcPartialRight = require('ramda/src/partialRight'); var _ramdaSrcPartialRight2 = _interopRequireDefault(_ramdaSrcPartialRight); var _memoizee = require('memoizee'); var _memoizee2 = _interopRequireDefault(_memoizee); var _mercury = require('mercury'); var _mercury2 = _interopRequireDefault(_mercury); var _gestures = require('../gestures'); var _logo = require('../logo'); var _logo2 = _interopRequireDefault(_logo); var _botHandle = require('../bot-handle'); var _botHandle2 = _interopRequireDefault(_botHandle); var _button = require('../button'); var _button2 = _interopRequireDefault(_button); var memoize = (0, _ramdaSrcPartialRight2['default'])(_memoizee2['default'], { max: 1 }); /** * Component */ function Controls(_ref) { var undo = _ref.undo; var redo = _ref.redo; return _mercury2['default'].state({ startPauseBtn: (0, _button2['default'])(), resetBtn: (0, _button2['default'])(), undoBtn: (0, _button2['default'])(), redoBtn: (0, _button2['default'])(), botHandle: (0, _botHandle2['default'])(), channels: { undo: undo, redo: redo } }); } /** * Render component. */ var startPauseBtnProps = memoize(function (isReady, isRunning, onStart, onPause, onReset, winners) { var disabled = !isReady; return _Object$assign({ disabled: disabled, className: isRunning ? 'amaze-Button--pause' : 'amaze-Button--start', children: winners ? 'New' : isRunning ? 'Pause' : 'Start' }, !disabled ? { 'ev-event': (0, _gestures.sendTap)(winners ? onReset : isRunning ? onPause : onStart) } : {}); }); var resetBtnProps = memoize(function (isRunning, onReset, winners) { var disabled = isRunning || winners && winners.length; return _Object$assign({ disabled: disabled, children: 'Reset' }, !disabled ? { 'ev-event': (0, _gestures.sendTap)(onReset) } : {}); }); var undoBtnProps = memoize(function (undo, isStarted) { var disabled = isStarted; return _Object$assign({ disabled: disabled, children: 'Undo' }, !disabled ? { 'ev-click': _mercury2['default'].sendClick(undo) } : {}); }); var redoBtnProps = memoize(function (redo, isStarted) { var disabled = isStarted; return _Object$assign({ disabled: disabled, children: 'Redo' }, !disabled ? { 'ev-click': _mercury2['default'].sendClick(redo) } : {}); }); var botHandleProps = memoize(function (botIdentity, addBotRandomly, isStarted) { var disabled = isStarted; return { botIdentity: botIdentity, addBotRandomly: addBotRandomly, disabled: disabled }; }); Controls.render = function render(state, props) { var botIdentity = props.botIdentity; var isReady = props.isReady; var isStarted = props.isStarted; var isRunning = props.isRunning; var onStart = props.onStart; var onPause = props.onPause; var onReset = props.onReset; var winners = props.winners; return (0, _mercury.h)('section.amaze-Controls.u-cf', [_mercury2['default'].partial(_logo2['default'].render), (0, _mercury.h)('.amaze-Controls-buttons.u-cf', [_mercury2['default'].partial(_button2['default'].render, state.startPauseBtn, startPauseBtnProps(isReady, isRunning, onStart, onPause, onReset, winners)), _mercury2['default'].partial(_button2['default'].render, state.resetBtn, resetBtnProps(isRunning, onReset, winners)), _mercury2['default'].partial(_button2['default'].render, state.undoBtn, undoBtnProps(state.channels.undo, isStarted)), _mercury2['default'].partial(_button2['default'].render, state.redoBtn, redoBtnProps(state.channels.redo, isStarted))]), _mercury2['default'].partial(_botHandle2['default'].render, state.botHandle, botHandleProps(botIdentity, props.addBotRandomly, isStarted))]); }; module.exports = exports['default']; //# sourceMappingURL=index.js.map
ibm5155/MT2D
MT2D/_WINDOWS/IO/MT2D_Win_Keyboard.h
#include "../../MT2D_Terminal_Define.h" #if defined(WINDOWS_TARGET) && !defined(SDL_USE) bool MT2D_Win_Keyboard_touched(); int MT2D_Win_Keyboard_keytouched(); #endif
sirinath/Harmony
classlib/modules/auth/src/main/java/common/org/apache/harmony/auth/jgss/kerberos/toolbox/KerberosApplicationRequest.java
<filename>classlib/modules/auth/src/main/java/common/org/apache/harmony/auth/jgss/kerberos/toolbox/KerberosApplicationRequest.java /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.harmony.auth.jgss.kerberos.toolbox; import javax.crypto.SecretKey; import javax.security.auth.kerberos.KerberosTicket; // TODO The Request for encoding includes TGS while decoding includes // SessionKey. Maybe more information, for example, peer Principal is required // in decoding. public class KerberosApplicationRequest { private long seqNum; private boolean[] options; private KerberosTicket tgs; private SecretKey sessionKey; public KerberosApplicationRequest(long seqNum, boolean[] options, KerberosTicket tgs, SecretKey sessionKey) { this.seqNum = seqNum; this.options = options; this.tgs = tgs; this.sessionKey = sessionKey; } public long getSeqNum() { return seqNum; } public boolean[] getOptions() { return options; } public KerberosTicket getTGS() { return tgs; } public SecretKey getSessionKey() { return sessionKey; } }
cstroe/agreementmaker
AgreementMaker-OSGi/Matcher-LinkedOpenData/src/main/java/am/matcher/lod/hierarchy/package-info.java
/** * This package holds the {@link am.app.mappingEngine.hierarchy.HierarchyMatcher} * and all its variations. The HierarchyMatcher is used for matching LOD schemas. */ package am.matcher.lod.hierarchy;
M9k/Progetto-P2
GUI/header/view_file_multimedia.h
<gh_stars>1-10 #ifndef VIEW_FILE_MULTIMEDIA_H #define VIEW_FILE_MULTIMEDIA_H #include "view_file_base.h" #include "../../MODEL/header/file_multimedia.h" #include <QDoubleSpinBox> #include <QLineEdit> class view_file_multimedia : public view_file_base { public: view_file_multimedia(file_base* file, QWidget* parent=nullptr):view_file_base(file, parent) {} virtual ~view_file_multimedia() = 0; protected: virtual void edit() const; virtual void build_field(); private: QLineEdit* bitrate; QDoubleSpinBox* durataSec; }; #endif // VIEW_FILE_MULTIMEDIA_H
chriskim06/go-sdk
cmd/semver/main.go
<gh_stars>100-1000 /* Copyright (c) 2021 - Present. Blend Labs, Inc. All rights reserved Use of this source code is governed by a MIT license that can be found in the LICENSE file. */ package main import ( "fmt" "io/ioutil" "os" "strings" "github.com/blend/go-sdk/semver" ) func usage() { fmt.Fprint(os.Stdout, "version validates and manage versions from a given file\n") fmt.Fprint(os.Stdout, "\ncommands:\n") fmt.Fprint(os.Stdout, "\tvalidate\t\t\t\tvalidate a given version file\n") fmt.Fprint(os.Stdout, "\tincrement major|minor|patch\t\tincrement a given version segment\n") fmt.Fprint(os.Stdout, "\tsatisfies <version constraint>\t\tverify a version satisfies a constraint\n") fmt.Fprint(os.Stdout, "\nusage:\n") fmt.Fprint(os.Stdout, "\tversion [command] [args] -f [filename]\n") } func main() { if len(os.Args) < 3 { usage() os.Exit(1) } command, args := os.Args[1], os.Args[2:] switch command { case "increment": increment(args) os.Exit(0) case "satisfies": satisfies(args) os.Exit(0) case "validate": validate(args) os.Exit(0) default: fmt.Fprintf(os.Stderr, "invalid command: %s\n", command) os.Exit(1) } } func readContents(path string) (contents []byte, err error) { if strings.TrimSpace(path) == "-" { contents, err = ioutil.ReadAll(os.Stdin) } else { contents, err = ioutil.ReadFile(path) } return } func increment(args []string) { if len(args) < 2 { fmt.Fprintf(os.Stderr, "must supply a semver segment and a file\n") os.Exit(1) } segment := args[0] filepath := args[1] contents, err := readContents(filepath) if err != nil { fmt.Fprintf(os.Stderr, "%+v\n", err) os.Exit(1) } version, err := semver.NewVersion(strings.TrimSpace(string(contents))) if err != nil { fmt.Fprintf(os.Stderr, "%+v\n", err) os.Exit(1) } switch strings.ToLower(segment) { case "patch": version.BumpPatch() case "minor": version.BumpMinor() case "major": version.BumpMajor() default: fmt.Fprintf(os.Stderr, "invalid segment: %s\n", segment) fmt.Fprintf(os.Stderr, "should be one of: 'major', 'minor', and 'patch'\n") os.Exit(1) } fmt.Printf("%v\n", version) } func satisfies(args []string) { if len(args) < 2 { fmt.Fprintf(os.Stderr, "must supply a version constraint and a file\n") os.Exit(1) } constraintValue := args[0] filepath := args[1] contents, err := readContents(filepath) if err != nil { fmt.Fprintf(os.Stderr, "%+v\n", err) os.Exit(1) } version, err := semver.NewVersion(strings.TrimSpace(string(contents))) if err != nil { fmt.Fprintf(os.Stderr, "%+v\n", err) os.Exit(1) } constraint, err := semver.NewConstraint(constraintValue) if err != nil { fmt.Fprintf(os.Stderr, "%+v\n", err) os.Exit(1) } if !constraint.Check(version) { fmt.Fprintf(os.Stderr, "`%s` does not satisfy `%s`\n", constraint.String(), version.String()) os.Exit(1) } } func validate(args []string) { if len(args) == 0 { fmt.Fprintf(os.Stderr, "must supply a file\n") os.Exit(1) } filepath := args[0] contents, err := readContents(filepath) if err != nil { fmt.Fprintf(os.Stderr, "%+v\n", err) os.Exit(1) } _, err = semver.NewVersion(strings.TrimSpace(string(contents))) if err != nil { fmt.Fprintf(os.Stderr, "%+v\n", err) os.Exit(1) } }
ivarsrb/landscape-sim
include/lsim/vulkan/object/semaphore.h
// // Created by <NAME> in 2021 // // Abstraction of a Vulkan semaphore object. // Semaphores are used to synchronize operations within or across command // queues. #ifndef LSIM_VULKAN_OBJECT_SEMAPHORE_H_ #define LSIM_VULKAN_OBJECT_SEMAPHORE_H_ #include <vulkan/vulkan.h> namespace lsim::vulkan::object { class Semaphore { public: explicit Semaphore(VkDevice device); ~Semaphore(); Semaphore(Semaphore const &) = delete; Semaphore &operator=(Semaphore const &) = delete; Semaphore(Semaphore &&other) noexcept; Semaphore &operator=(Semaphore &&other) noexcept; // Returns Vulkan object handle [[nodiscard]] VkSemaphore Handle(); private: [[nodiscard]] VkSemaphore Create() const; void Destroy(); // Pointer to resource this object is created with VkDevice const context_device_; VkSemaphore semaphore_ = VK_NULL_HANDLE; }; } // namespace lsim::vulkan::object #endif
vsosrc/jruby
src/org/jruby/ast/java_signature/ReferenceTypeNode.java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.jruby.ast.java_signature; /** * * @author enebo */ public class ReferenceTypeNode extends TypeNode { private String genericString = ""; public ReferenceTypeNode(String name) { super(name); } public void setGenericString(String genericString) { this.genericString = genericString; } @Override public boolean equals(Object other) { if (other == null || !(other instanceof ReferenceTypeNode)) return false; return genericString.equals(((ReferenceTypeNode) other).genericString) && super.equals(other); } @Override public int hashCode() { int hash = 3; hash = 97 * hash + (this.genericString != null ? this.genericString.hashCode() : 0); return hash; } @Override public String getFullyTypedName() { return getName() + genericString; } public void setGenericsTyping(String genericString) { this.genericString = genericString; } }
clejacquet/LOD
QueryLauncher/src/main/java/jp/kde/lod/jacquet/querylauncher/model/QueryStorage.java
package jp.kde.lod.jacquet.querylauncher.model; import com.hp.hpl.jena.query.Query; import java.util.HashMap; import java.util.Map; import java.util.Observable; /** * Created by Clement on 16/04/2015. * Storage class which simply contains some queries */ public class QueryStorage extends Observable { /** * Internal storage of the queries. Each query is identified by a key which correspond to its name */ private Map<String, Query> queries; /** * Construct the query map */ public QueryStorage() { this.queries = new HashMap<String, Query>(); } /** * Add a query if the name didn't exist before, replace it if not * @param queryName name of the query * @param query SPARQL query */ public void putQuery(final String queryName, final Query query) { this.queries.put(queryName, query); super.setChanged(); super.notifyObservers(queryName); } /** * Return the query corresponding to the query name provided * @param queryName name of the desired query * @return the SPARQL query corresponding to */ public Query getQuery(final String queryName) { return this.queries.get(queryName); } }
dhis2/maps-app
src/actions/dataElements.js
<gh_stars>10-100 import * as types from '../constants/actionTypes'; // Load all data element groups export const loadDataElementGroups = () => ({ type: types.DATA_ELEMENT_GROUPS_LOAD, }); // Set all data element groups export const setDataElementGroups = data => ({ type: types.DATA_ELEMENT_GROUPS_SET, payload: data, }); // Load data elements in one group export const loadDataElements = groupId => ({ type: types.DATA_ELEMENTS_LOAD, groupId, }); // Set data elements for one group export const setDataElements = (groupId, payload) => ({ type: types.DATA_ELEMENTS_SET, groupId, payload, }); // Load data element operands in one group export const loadDataElementOperands = groupId => ({ type: types.DATA_ELEMENT_OPERANDS_LOAD, groupId, }); // Set data element operands for one group export const setDataElementOperands = (groupId, payload) => ({ type: types.DATA_ELEMENT_OPERANDS_SET, groupId, payload, });
olgam4/design3
rpiRobot/src/vision/domain/iCameraCalibrationFactory.py
from abc import ABC, abstractmethod from os import path from vision.domain.iCameraCalibration import ICameraCalibration class ICameraCalibrationFactory(ABC): @abstractmethod def load_calibration_from_file(self, calibration_file_path: path, image_width: int, image_height: int) -> ICameraCalibration: pass
X018/CCTOOL
Android/NDK/android-ndk-r16b-mac/toolchains/llvm/prebuilt/darwin-x86_64/prebuilt_include/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
<reponame>X018/CCTOOL //===- llvm/Analysis/ScalarEvolutionExpressions.h - SCEV Exprs --*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the classes used to represent and build scalar expressions. // //===----------------------------------------------------------------------===// #ifndef LLVM_ANALYSIS_SCALAREVOLUTIONEXPRESSIONS_H #define LLVM_ANALYSIS_SCALAREVOLUTIONEXPRESSIONS_H #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/iterator_range.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Support/ErrorHandling.h" namespace llvm { class ConstantInt; class ConstantRange; class DominatorTree; enum SCEVTypes { // These should be ordered in terms of increasing complexity to make the // folders simpler. scConstant, scTruncate, scZeroExtend, scSignExtend, scAddExpr, scMulExpr, scUDivExpr, scAddRecExpr, scUMaxExpr, scSMaxExpr, scUnknown, scCouldNotCompute }; /// This class represents a constant integer value. class SCEVConstant : public SCEV { friend class ScalarEvolution; ConstantInt *V; SCEVConstant(const FoldingSetNodeIDRef ID, ConstantInt *v) : SCEV(ID, scConstant), V(v) {} public: ConstantInt *getValue() const { return V; } const APInt &getAPInt() const { return getValue()->getValue(); } Type *getType() const { return V->getType(); } /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEV *S) { return S->getSCEVType() == scConstant; } }; /// This is the base class for unary cast operator classes. class SCEVCastExpr : public SCEV { protected: const SCEV *Op; Type *Ty; SCEVCastExpr(const FoldingSetNodeIDRef ID, unsigned SCEVTy, const SCEV *op, Type *ty); public: const SCEV *getOperand() const { return Op; } Type *getType() const { return Ty; } /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEV *S) { return S->getSCEVType() == scTruncate || S->getSCEVType() == scZeroExtend || S->getSCEVType() == scSignExtend; } }; /// This class represents a truncation of an integer value to a /// smaller integer value. class SCEVTruncateExpr : public SCEVCastExpr { friend class ScalarEvolution; SCEVTruncateExpr(const FoldingSetNodeIDRef ID, const SCEV *op, Type *ty); public: /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEV *S) { return S->getSCEVType() == scTruncate; } }; /// This class represents a zero extension of a small integer value /// to a larger integer value. class SCEVZeroExtendExpr : public SCEVCastExpr { friend class ScalarEvolution; SCEVZeroExtendExpr(const FoldingSetNodeIDRef ID, const SCEV *op, Type *ty); public: /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEV *S) { return S->getSCEVType() == scZeroExtend; } }; /// This class represents a sign extension of a small integer value /// to a larger integer value. class SCEVSignExtendExpr : public SCEVCastExpr { friend class ScalarEvolution; SCEVSignExtendExpr(const FoldingSetNodeIDRef ID, const SCEV *op, Type *ty); public: /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEV *S) { return S->getSCEVType() == scSignExtend; } }; /// This node is a base class providing common functionality for /// n'ary operators. class SCEVNAryExpr : public SCEV { protected: // Since SCEVs are immutable, ScalarEvolution allocates operand // arrays with its SCEVAllocator, so this class just needs a simple // pointer rather than a more elaborate vector-like data structure. // This also avoids the need for a non-trivial destructor. const SCEV *const *Operands; size_t NumOperands; SCEVNAryExpr(const FoldingSetNodeIDRef ID, enum SCEVTypes T, const SCEV *const *O, size_t N) : SCEV(ID, T), Operands(O), NumOperands(N) {} public: size_t getNumOperands() const { return NumOperands; } const SCEV *getOperand(unsigned i) const { assert(i < NumOperands && "Operand index out of range!"); return Operands[i]; } typedef const SCEV *const *op_iterator; typedef iterator_range<op_iterator> op_range; op_iterator op_begin() const { return Operands; } op_iterator op_end() const { return Operands + NumOperands; } op_range operands() const { return make_range(op_begin(), op_end()); } Type *getType() const { return getOperand(0)->getType(); } NoWrapFlags getNoWrapFlags(NoWrapFlags Mask = NoWrapMask) const { return (NoWrapFlags)(SubclassData & Mask); } bool hasNoUnsignedWrap() const { return getNoWrapFlags(FlagNUW) != FlagAnyWrap; } bool hasNoSignedWrap() const { return getNoWrapFlags(FlagNSW) != FlagAnyWrap; } bool hasNoSelfWrap() const { return getNoWrapFlags(FlagNW) != FlagAnyWrap; } /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEV *S) { return S->getSCEVType() == scAddExpr || S->getSCEVType() == scMulExpr || S->getSCEVType() == scSMaxExpr || S->getSCEVType() == scUMaxExpr || S->getSCEVType() == scAddRecExpr; } }; /// This node is the base class for n'ary commutative operators. class SCEVCommutativeExpr : public SCEVNAryExpr { protected: SCEVCommutativeExpr(const FoldingSetNodeIDRef ID, enum SCEVTypes T, const SCEV *const *O, size_t N) : SCEVNAryExpr(ID, T, O, N) {} public: /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEV *S) { return S->getSCEVType() == scAddExpr || S->getSCEVType() == scMulExpr || S->getSCEVType() == scSMaxExpr || S->getSCEVType() == scUMaxExpr; } /// Set flags for a non-recurrence without clearing previously set flags. void setNoWrapFlags(NoWrapFlags Flags) { SubclassData |= Flags; } }; /// This node represents an addition of some number of SCEVs. class SCEVAddExpr : public SCEVCommutativeExpr { friend class ScalarEvolution; SCEVAddExpr(const FoldingSetNodeIDRef ID, const SCEV *const *O, size_t N) : SCEVCommutativeExpr(ID, scAddExpr, O, N) { } public: Type *getType() const { // Use the type of the last operand, which is likely to be a pointer // type, if there is one. This doesn't usually matter, but it can help // reduce casts when the expressions are expanded. return getOperand(getNumOperands() - 1)->getType(); } /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEV *S) { return S->getSCEVType() == scAddExpr; } }; /// This node represents multiplication of some number of SCEVs. class SCEVMulExpr : public SCEVCommutativeExpr { friend class ScalarEvolution; SCEVMulExpr(const FoldingSetNodeIDRef ID, const SCEV *const *O, size_t N) : SCEVCommutativeExpr(ID, scMulExpr, O, N) { } public: /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEV *S) { return S->getSCEVType() == scMulExpr; } }; /// This class represents a binary unsigned division operation. class SCEVUDivExpr : public SCEV { friend class ScalarEvolution; const SCEV *LHS; const SCEV *RHS; SCEVUDivExpr(const FoldingSetNodeIDRef ID, const SCEV *lhs, const SCEV *rhs) : SCEV(ID, scUDivExpr), LHS(lhs), RHS(rhs) {} public: const SCEV *getLHS() const { return LHS; } const SCEV *getRHS() const { return RHS; } Type *getType() const { // In most cases the types of LHS and RHS will be the same, but in some // crazy cases one or the other may be a pointer. ScalarEvolution doesn't // depend on the type for correctness, but handling types carefully can // avoid extra casts in the SCEVExpander. The LHS is more likely to be // a pointer type than the RHS, so use the RHS' type here. return getRHS()->getType(); } /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEV *S) { return S->getSCEVType() == scUDivExpr; } }; /// This node represents a polynomial recurrence on the trip count /// of the specified loop. This is the primary focus of the /// ScalarEvolution framework; all the other SCEV subclasses are /// mostly just supporting infrastructure to allow SCEVAddRecExpr /// expressions to be created and analyzed. /// /// All operands of an AddRec are required to be loop invariant. /// class SCEVAddRecExpr : public SCEVNAryExpr { friend class ScalarEvolution; const Loop *L; SCEVAddRecExpr(const FoldingSetNodeIDRef ID, const SCEV *const *O, size_t N, const Loop *l) : SCEVNAryExpr(ID, scAddRecExpr, O, N), L(l) {} public: const SCEV *getStart() const { return Operands[0]; } const Loop *getLoop() const { return L; } /// Constructs and returns the recurrence indicating how much this /// expression steps by. If this is a polynomial of degree N, it /// returns a chrec of degree N-1. We cannot determine whether /// the step recurrence has self-wraparound. const SCEV *getStepRecurrence(ScalarEvolution &SE) const { if (isAffine()) return getOperand(1); return SE.getAddRecExpr(SmallVector<const SCEV *, 3>(op_begin()+1, op_end()), getLoop(), FlagAnyWrap); } /// Return true if this represents an expression A + B*x where A /// and B are loop invariant values. bool isAffine() const { // We know that the start value is invariant. This expression is thus // affine iff the step is also invariant. return getNumOperands() == 2; } /// Return true if this represents an expression A + B*x + C*x^2 /// where A, B and C are loop invariant values. This corresponds /// to an addrec of the form {L,+,M,+,N} bool isQuadratic() const { return getNumOperands() == 3; } /// Set flags for a recurrence without clearing any previously set flags. /// For AddRec, either NUW or NSW implies NW. Keep track of this fact here /// to make it easier to propagate flags. void setNoWrapFlags(NoWrapFlags Flags) { if (Flags & (FlagNUW | FlagNSW)) Flags = ScalarEvolution::setFlags(Flags, FlagNW); SubclassData |= Flags; } /// Return the value of this chain of recurrences at the specified /// iteration number. const SCEV *evaluateAtIteration(const SCEV *It, ScalarEvolution &SE) const; /// Return the number of iterations of this loop that produce /// values in the specified constant range. Another way of /// looking at this is that it returns the first iteration number /// where the value is not in the condition, thus computing the /// exit count. If the iteration count can't be computed, an /// instance of SCEVCouldNotCompute is returned. const SCEV *getNumIterationsInRange(const ConstantRange &Range, ScalarEvolution &SE) const; /// Return an expression representing the value of this expression /// one iteration of the loop ahead. const SCEVAddRecExpr *getPostIncExpr(ScalarEvolution &SE) const { return cast<SCEVAddRecExpr>(SE.getAddExpr(this, getStepRecurrence(SE))); } /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEV *S) { return S->getSCEVType() == scAddRecExpr; } }; /// This class represents a signed maximum selection. class SCEVSMaxExpr : public SCEVCommutativeExpr { friend class ScalarEvolution; SCEVSMaxExpr(const FoldingSetNodeIDRef ID, const SCEV *const *O, size_t N) : SCEVCommutativeExpr(ID, scSMaxExpr, O, N) { // Max never overflows. setNoWrapFlags((NoWrapFlags)(FlagNUW | FlagNSW)); } public: /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEV *S) { return S->getSCEVType() == scSMaxExpr; } }; /// This class represents an unsigned maximum selection. class SCEVUMaxExpr : public SCEVCommutativeExpr { friend class ScalarEvolution; SCEVUMaxExpr(const FoldingSetNodeIDRef ID, const SCEV *const *O, size_t N) : SCEVCommutativeExpr(ID, scUMaxExpr, O, N) { // Max never overflows. setNoWrapFlags((NoWrapFlags)(FlagNUW | FlagNSW)); } public: /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEV *S) { return S->getSCEVType() == scUMaxExpr; } }; /// This means that we are dealing with an entirely unknown SCEV /// value, and only represent it as its LLVM Value. This is the /// "bottom" value for the analysis. class SCEVUnknown final : public SCEV, private CallbackVH { friend class ScalarEvolution; // Implement CallbackVH. void deleted() override; void allUsesReplacedWith(Value *New) override; /// The parent ScalarEvolution value. This is used to update the /// parent's maps when the value associated with a SCEVUnknown is /// deleted or RAUW'd. ScalarEvolution *SE; /// The next pointer in the linked list of all SCEVUnknown /// instances owned by a ScalarEvolution. SCEVUnknown *Next; SCEVUnknown(const FoldingSetNodeIDRef ID, Value *V, ScalarEvolution *se, SCEVUnknown *next) : SCEV(ID, scUnknown), CallbackVH(V), SE(se), Next(next) {} public: Value *getValue() const { return getValPtr(); } /// @{ /// Test whether this is a special constant representing a type /// size, alignment, or field offset in a target-independent /// manner, and hasn't happened to have been folded with other /// operations into something unrecognizable. This is mainly only /// useful for pretty-printing and other situations where it isn't /// absolutely required for these to succeed. bool isSizeOf(Type *&AllocTy) const; bool isAlignOf(Type *&AllocTy) const; bool isOffsetOf(Type *&STy, Constant *&FieldNo) const; /// @} Type *getType() const { return getValPtr()->getType(); } /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SCEV *S) { return S->getSCEVType() == scUnknown; } }; /// This class defines a simple visitor class that may be used for /// various SCEV analysis purposes. template<typename SC, typename RetVal=void> struct SCEVVisitor { RetVal visit(const SCEV *S) { switch (S->getSCEVType()) { case scConstant: return ((SC*)this)->visitConstant((const SCEVConstant*)S); case scTruncate: return ((SC*)this)->visitTruncateExpr((const SCEVTruncateExpr*)S); case scZeroExtend: return ((SC*)this)->visitZeroExtendExpr((const SCEVZeroExtendExpr*)S); case scSignExtend: return ((SC*)this)->visitSignExtendExpr((const SCEVSignExtendExpr*)S); case scAddExpr: return ((SC*)this)->visitAddExpr((const SCEVAddExpr*)S); case scMulExpr: return ((SC*)this)->visitMulExpr((const SCEVMulExpr*)S); case scUDivExpr: return ((SC*)this)->visitUDivExpr((const SCEVUDivExpr*)S); case scAddRecExpr: return ((SC*)this)->visitAddRecExpr((const SCEVAddRecExpr*)S); case scSMaxExpr: return ((SC*)this)->visitSMaxExpr((const SCEVSMaxExpr*)S); case scUMaxExpr: return ((SC*)this)->visitUMaxExpr((const SCEVUMaxExpr*)S); case scUnknown: return ((SC*)this)->visitUnknown((const SCEVUnknown*)S); case scCouldNotCompute: return ((SC*)this)->visitCouldNotCompute((const SCEVCouldNotCompute*)S); default: llvm_unreachable("Unknown SCEV type!"); } } RetVal visitCouldNotCompute(const SCEVCouldNotCompute *S) { llvm_unreachable("Invalid use of SCEVCouldNotCompute!"); } }; /// Visit all nodes in the expression tree using worklist traversal. /// /// Visitor implements: /// // return true to follow this node. /// bool follow(const SCEV *S); /// // return true to terminate the search. /// bool isDone(); template<typename SV> class SCEVTraversal { SV &Visitor; SmallVector<const SCEV *, 8> Worklist; SmallPtrSet<const SCEV *, 8> Visited; void push(const SCEV *S) { if (Visited.insert(S).second && Visitor.follow(S)) Worklist.push_back(S); } public: SCEVTraversal(SV& V): Visitor(V) {} void visitAll(const SCEV *Root) { push(Root); while (!Worklist.empty() && !Visitor.isDone()) { const SCEV *S = Worklist.pop_back_val(); switch (S->getSCEVType()) { case scConstant: case scUnknown: break; case scTruncate: case scZeroExtend: case scSignExtend: push(cast<SCEVCastExpr>(S)->getOperand()); break; case scAddExpr: case scMulExpr: case scSMaxExpr: case scUMaxExpr: case scAddRecExpr: for (const auto *Op : cast<SCEVNAryExpr>(S)->operands()) push(Op); break; case scUDivExpr: { const SCEVUDivExpr *UDiv = cast<SCEVUDivExpr>(S); push(UDiv->getLHS()); push(UDiv->getRHS()); break; } case scCouldNotCompute: llvm_unreachable("Attempt to use a SCEVCouldNotCompute object!"); default: llvm_unreachable("Unknown SCEV kind!"); } } } }; /// Use SCEVTraversal to visit all nodes in the given expression tree. template<typename SV> void visitAll(const SCEV *Root, SV& Visitor) { SCEVTraversal<SV> T(Visitor); T.visitAll(Root); } /// Return true if any node in \p Root satisfies the predicate \p Pred. template <typename PredTy> bool SCEVExprContains(const SCEV *Root, PredTy Pred) { struct FindClosure { bool Found = false; PredTy Pred; FindClosure(PredTy Pred) : Pred(Pred) {} bool follow(const SCEV *S) { if (!Pred(S)) return true; Found = true; return false; } bool isDone() const { return Found; } }; FindClosure FC(Pred); visitAll(Root, FC); return FC.Found; } /// This visitor recursively visits a SCEV expression and re-writes it. /// The result from each visit is cached, so it will return the same /// SCEV for the same input. template<typename SC> class SCEVRewriteVisitor : public SCEVVisitor<SC, const SCEV *> { protected: ScalarEvolution &SE; // Memoize the result of each visit so that we only compute once for // the same input SCEV. This is to avoid redundant computations when // a SCEV is referenced by multiple SCEVs. Without memoization, this // visit algorithm would have exponential time complexity in the worst // case, causing the compiler to hang on certain tests. DenseMap<const SCEV *, const SCEV *> RewriteResults; public: SCEVRewriteVisitor(ScalarEvolution &SE) : SE(SE) {} const SCEV *visit(const SCEV *S) { auto It = RewriteResults.find(S); if (It != RewriteResults.end()) return It->second; auto* Visited = SCEVVisitor<SC, const SCEV *>::visit(S); auto Result = RewriteResults.try_emplace(S, Visited); assert(Result.second && "Should insert a new entry"); return Result.first->second; } const SCEV *visitConstant(const SCEVConstant *Constant) { return Constant; } const SCEV *visitTruncateExpr(const SCEVTruncateExpr *Expr) { const SCEV *Operand = ((SC*)this)->visit(Expr->getOperand()); return SE.getTruncateExpr(Operand, Expr->getType()); } const SCEV *visitZeroExtendExpr(const SCEVZeroExtendExpr *Expr) { const SCEV *Operand = ((SC*)this)->visit(Expr->getOperand()); return SE.getZeroExtendExpr(Operand, Expr->getType()); } const SCEV *visitSignExtendExpr(const SCEVSignExtendExpr *Expr) { const SCEV *Operand = ((SC*)this)->visit(Expr->getOperand()); return SE.getSignExtendExpr(Operand, Expr->getType()); } const SCEV *visitAddExpr(const SCEVAddExpr *Expr) { SmallVector<const SCEV *, 2> Operands; for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) Operands.push_back(((SC*)this)->visit(Expr->getOperand(i))); return SE.getAddExpr(Operands); } const SCEV *visitMulExpr(const SCEVMulExpr *Expr) { SmallVector<const SCEV *, 2> Operands; for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) Operands.push_back(((SC*)this)->visit(Expr->getOperand(i))); return SE.getMulExpr(Operands); } const SCEV *visitUDivExpr(const SCEVUDivExpr *Expr) { return SE.getUDivExpr(((SC*)this)->visit(Expr->getLHS()), ((SC*)this)->visit(Expr->getRHS())); } const SCEV *visitAddRecExpr(const SCEVAddRecExpr *Expr) { SmallVector<const SCEV *, 2> Operands; for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) Operands.push_back(((SC*)this)->visit(Expr->getOperand(i))); return SE.getAddRecExpr(Operands, Expr->getLoop(), Expr->getNoWrapFlags()); } const SCEV *visitSMaxExpr(const SCEVSMaxExpr *Expr) { SmallVector<const SCEV *, 2> Operands; for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) Operands.push_back(((SC*)this)->visit(Expr->getOperand(i))); return SE.getSMaxExpr(Operands); } const SCEV *visitUMaxExpr(const SCEVUMaxExpr *Expr) { SmallVector<const SCEV *, 2> Operands; for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) Operands.push_back(((SC*)this)->visit(Expr->getOperand(i))); return SE.getUMaxExpr(Operands); } const SCEV *visitUnknown(const SCEVUnknown *Expr) { return Expr; } const SCEV *visitCouldNotCompute(const SCEVCouldNotCompute *Expr) { return Expr; } }; typedef DenseMap<const Value*, Value*> ValueToValueMap; /// The SCEVParameterRewriter takes a scalar evolution expression and updates /// the SCEVUnknown components following the Map (Value -> Value). class SCEVParameterRewriter : public SCEVRewriteVisitor<SCEVParameterRewriter> { public: static const SCEV *rewrite(const SCEV *Scev, ScalarEvolution &SE, ValueToValueMap &Map, bool InterpretConsts = false) { SCEVParameterRewriter Rewriter(SE, Map, InterpretConsts); return Rewriter.visit(Scev); } SCEVParameterRewriter(ScalarEvolution &SE, ValueToValueMap &M, bool C) : SCEVRewriteVisitor(SE), Map(M), InterpretConsts(C) {} const SCEV *visitUnknown(const SCEVUnknown *Expr) { Value *V = Expr->getValue(); if (Map.count(V)) { Value *NV = Map[V]; if (InterpretConsts && isa<ConstantInt>(NV)) return SE.getConstant(cast<ConstantInt>(NV)); return SE.getUnknown(NV); } return Expr; } private: ValueToValueMap &Map; bool InterpretConsts; }; typedef DenseMap<const Loop*, const SCEV*> LoopToScevMapT; /// The SCEVLoopAddRecRewriter takes a scalar evolution expression and applies /// the Map (Loop -> SCEV) to all AddRecExprs. class SCEVLoopAddRecRewriter : public SCEVRewriteVisitor<SCEVLoopAddRecRewriter> { public: static const SCEV *rewrite(const SCEV *Scev, LoopToScevMapT &Map, ScalarEvolution &SE) { SCEVLoopAddRecRewriter Rewriter(SE, Map); return Rewriter.visit(Scev); } SCEVLoopAddRecRewriter(ScalarEvolution &SE, LoopToScevMapT &M) : SCEVRewriteVisitor(SE), Map(M) {} const SCEV *visitAddRecExpr(const SCEVAddRecExpr *Expr) { SmallVector<const SCEV *, 2> Operands; for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) Operands.push_back(visit(Expr->getOperand(i))); const Loop *L = Expr->getLoop(); const SCEV *Res = SE.getAddRecExpr(Operands, L, Expr->getNoWrapFlags()); if (0 == Map.count(L)) return Res; const SCEVAddRecExpr *Rec = cast<SCEVAddRecExpr>(Res); return Rec->evaluateAtIteration(Map[L], SE); } private: LoopToScevMapT &Map; }; } #endif
yxyuhz/dev
basic/java-example/src/test/java/com/sciatta/java/example/object/method/MethodTests.java
<reponame>yxyuhz/dev<filename>basic/java-example/src/test/java/com/sciatta/java/example/object/method/MethodTests.java package com.sciatta.java.example.object.method; import com.sciatta.java.example.object.method.cls.Animal; import com.sciatta.java.example.object.method.cls.Cat; import com.sciatta.java.example.object.method.cls.Dog; import com.sciatta.java.example.object.method.ife.Car; import com.sciatta.java.example.object.method.ife.NewCar; import com.sciatta.java.example.object.method.ife.Run; import com.sciatta.java.example.object.method.ife.RunCar; import org.junit.Test; /** * Created by yangxiaoyu on 2019/1/30<br> * All Rights Reserved(C) 2017 - 2019 SCIATTA<br><p/> * MethodTests */ public class MethodTests { @Test public void testClass() { Cat cat = new Cat(); cat.drink(); // 继承实例方法 Cat.eat(); // 继承静态方法 System.out.println(); Animal dog = new Dog(); dog.drink(); // override dog.eat(); // 静态方法不支持多态 Animal.eat(); // hide Dog.eat(); // hide System.out.println(); Animal tomato = new Cat(); // 需要转型为Cat,才能调用其public的echo方法,因为Animal的echo方法是protected ((Cat) tomato).echo(); System.out.println(); } @Test public void testInterface() { Run car = new Car(); car.run(); // 实例方法优先于接口的default方法(本质是覆盖) car.echo(); System.out.println(); Run newCar = new NewCar(); newCar.run(); // 当多个父类型有同一个祖先时,被覆盖的默认方法忽略(本质是覆盖) System.out.println(); Run runCar = new RunCar(); runCar.run(); // 当多个父类型的默认方法冲突,要明确使用哪一个父接口的默认方法(Supertype.super.method()) System.out.println(); Run.help(); // 接口中的静态方法不能被继承 // error 不可以在子类中使用 // NewRun.help(); // error 不可以在实例中使用 // car.help(); } }
jia57196/code41
project/c++/mri/src/dataservice/include/xtreme/dataservice/test_misch.h
/**************************************************************** * test_misch.h * * Created on: June 25, 2013 * * Author: lim55392 * * Copyright (2013) JDS Uniphase. All rights reserved * ****************************************************************/ #ifndef XTREME_DATASERVICE_TEST_TEST_MISCH_H_ #define XTREME_DATASERVICE_TEST_TEST_MISCH_H_ #include <cstring> #include <string> #include <vector> #include <iostream> // NOLINT // miscellaneous utility void AssertOn(bool logic, std::string ErrorText); char getch(); class CmdParam { public: void init(int argc, char* argv[]) { for (int idx = 1; idx < argc; ++idx) parameterList_.push_back(std::string(argv[idx])); } int find(std::string tofind) { for (uint32_t idx = 0; idx < parameterList_.size(); ++idx) { if (parameterList_[idx].compare(0, tofind.length(), tofind) == 0) return idx; } return -1; } uint32_t gettotalparam() { uint32_t count = parameterList_.size(); return count; } std::string operator[](int idx) { const char* rfstr = parameterList_[idx].c_str(); char* index = strchr(rfstr, '='); if (index != NULL) { int rdx = index - rfstr + 1; return parameterList_[idx].c_str() + rdx; } return ""; } void printall() { for (uint32_t idx = 0; idx < parameterList_.size(); ++idx) std::cout << parameterList_[idx] << std::endl; } private: std::vector<std::string> parameterList_; }; #endif // XTREME_DATASERVICE_TEST_TEST_MISCH_H_
emersion/chromiumos-platform2
shill/mock_dbus_properties_proxy.h
<reponame>emersion/chromiumos-platform2 // Copyright 2018 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SHILL_MOCK_DBUS_PROPERTIES_PROXY_H_ #define SHILL_MOCK_DBUS_PROPERTIES_PROXY_H_ #include <string> #include <base/macros.h> #include <gmock/gmock.h> #include "shill/dbus_properties_proxy_interface.h" namespace shill { class MockDBusPropertiesProxy : public DBusPropertiesProxyInterface { public: MockDBusPropertiesProxy(); ~MockDBusPropertiesProxy() override; MOCK_METHOD1(GetAll, KeyValueStore(const std::string& interface_name)); MOCK_METHOD2(Get, brillo::Any(const std::string& interface_name, const std::string& property)); MOCK_METHOD1(set_properties_changed_callback, void(const PropertiesChangedCallback& callback)); MOCK_METHOD1(set_modem_manager_properties_changed_callback, void(const ModemManagerPropertiesChangedCallback& callback)); private: DISALLOW_COPY_AND_ASSIGN(MockDBusPropertiesProxy); }; } // namespace shill #endif // SHILL_MOCK_DBUS_PROPERTIES_PROXY_H_
Oyiersan/p3c
p3c-pmd/src/main/java/com/xenoamess/p3c/pmd/lang/java/util/PojoUtils.java
/* * Copyright 1999-2017 Alibaba Group. * * 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.xenoamess.p3c.pmd.lang.java.util; import com.xenoamess.p3c.pmd.lang.java.util.namelist.NameListConfig; import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration; import java.util.List; /** * POJO Utils * * @author zenghou.fw * @date 2016/11/25 */ public class PojoUtils { private static List<String> getPojoSuffixSet() { return NameListConfig.getNameListService().getNameList("PojoMustOverrideToStringRule", "POJO_SUFFIX_SET"); } private PojoUtils() { } public static boolean isPojo(String klass) { if (klass == null) { return false; } for (String suffix : getPojoSuffixSet()) { if (klass.endsWith(suffix)) { return true; } } return false; } public static boolean isPojo(ASTClassOrInterfaceDeclaration node) { return node != null && isPojo(node.getImage()); } }
alcyada/mintscan-binance-dex-frontend
src/containers/Asset/index.js
export {default} from "./Asset";
yohcop/google-depan
DepanViewDoc/prod/src/com/google/devtools/depan/eclipse/cm/ColorMapDefGistNcar.java
<reponame>yohcop/google-depan // This file is automatically generated by a script (generateColorMaps.py). // Do not modify it, or changes will be lost when the script is run again. /* * This file was generated using data provided by the python library matplotlib * which is Copyright (c) 2002-2004 <NAME>; All Rights Reserved * * For the rest of the code source, the following copyright and license * applies. * * Copyright 2008 The Depan Project 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 com.google.devtools.depan.eclipse.cm; public final class ColorMapDefGistNcar { private ColorMapDefGistNcar() { } public static final float[][][] CM = { { // red {0.0f, 0.0f, 0.0f}, {0.0050505050458f, 0.0f, 0.0f}, {0.0101010100916f, 0.0f, 0.0f}, {0.0151515156031f, 0.0f, 0.0f}, {0.0202020201832f, 0.0f, 0.0f}, {0.0252525247633f, 0.0f, 0.0f}, {0.0303030312061f, 0.0f, 0.0f}, {0.0353535339236f, 0.0f, 0.0f}, {0.0404040403664f, 0.0f, 0.0f}, {0.0454545468092f, 0.0f, 0.0f}, {0.0505050495267f, 0.0f, 0.0f}, {0.0555555559695f, 0.0f, 0.0f}, {0.0606060624123f, 0.0f, 0.0f}, {0.0656565651298f, 0.0f, 0.0f}, {0.0707070678473f, 0.0f, 0.0f}, {0.0757575780153f, 0.0f, 0.0f}, {0.0808080807328f, 0.0f, 0.0f}, {0.0858585834503f, 0.0f, 0.0f}, {0.0909090936184f, 0.0f, 0.0f}, {0.0959595963359f, 0.0f, 0.0f}, {0.101010099053f, 0.0f, 0.0f}, {0.106060609221f, 0.0f, 0.0f}, {0.111111111939f, 0.0f, 0.0f}, {0.116161614656f, 0.0f, 0.0f}, {0.121212124825f, 0.0f, 0.0f}, {0.126262620091f, 0.0f, 0.0f}, {0.13131313026f, 0.0f, 0.0f}, {0.136363640428f, 0.0f, 0.0f}, {0.141414135695f, 0.0f, 0.0f}, {0.146464645863f, 0.0f, 0.0f}, {0.151515156031f, 0.0f, 0.0f}, {0.156565651298f, 0.0f, 0.0f}, {0.161616161466f, 0.0f, 0.0f}, {0.166666671634f, 0.0f, 0.0f}, {0.171717166901f, 0.0f, 0.0f}, {0.176767677069f, 0.0f, 0.0f}, {0.181818187237f, 0.0f, 0.0f}, {0.186868682504f, 0.0f, 0.0f}, {0.191919192672f, 0.0f, 0.0f}, {0.19696970284f, 0.0f, 0.0f}, {0.202020198107f, 0.0f, 0.0f}, {0.207070708275f, 0.0f, 0.0f}, {0.212121218443f, 0.0f, 0.0f}, {0.21717171371f, 0.0f, 0.0f}, {0.222222223878f, 0.0f, 0.0f}, {0.227272734046f, 0.0f, 0.0f}, {0.232323229313f, 0.0f, 0.0f}, {0.237373739481f, 0.0f, 0.0f}, {0.242424249649f, 0.0f, 0.0f}, {0.247474744916f, 0.0f, 0.0f}, {0.252525240183f, 0.0f, 0.0f}, {0.257575750351f, 0.0f, 0.0f}, {0.262626260519f, 0.0f, 0.0f}, {0.267676770687f, 0.0f, 0.0f}, {0.272727280855f, 0.0f, 0.0f}, {0.277777791023f, 0.0f, 0.0f}, {0.282828271389f, 0.0f, 0.0f}, {0.287878781557f, 0.0f, 0.0f}, {0.292929291725f, 0.0f, 0.0f}, {0.297979801893f, 0.0f, 0.0f}, {0.303030312061f, 0.0f, 0.0f}, {0.308080822229f, 0.0f, 0.0f}, {0.313131302595f, 0.0f, 0.0f}, {0.318181812763f, 0.00392156885937f, 0.00392156885937f}, {0.323232322931f, 0.0431372560561f, 0.0431372560561f}, {0.328282833099f, 0.0823529437184f, 0.0823529437184f}, {0.333333343267f, 0.117647059262f, 0.117647059262f}, {0.338383823633f, 0.156862750649f, 0.156862750649f}, {0.343434333801f, 0.196078434587f, 0.196078434587f}, {0.348484843969f, 0.23137255013f, 0.23137255013f}, {0.353535354137f, 0.270588248968f, 0.270588248968f}, {0.358585864305f, 0.309803932905f, 0.309803932905f}, {0.363636374474f, 0.349019616842f, 0.349019616842f}, {0.368686854839f, 0.384313732386f, 0.384313732386f}, {0.373737365007f, 0.403921574354f, 0.403921574354f}, {0.378787875175f, 0.415686279535f, 0.415686279535f}, {0.383838385344f, 0.423529416323f, 0.423529416323f}, {0.388888895512f, 0.43137255311f, 0.43137255311f}, {0.39393940568f, 0.443137258291f, 0.443137258291f}, {0.398989886045f, 0.450980395079f, 0.450980395079f}, {0.404040396214f, 0.458823531866f, 0.458823531866f}, {0.409090906382f, 0.470588237047f, 0.470588237047f}, {0.41414141655f, 0.478431373835f, 0.478431373835f}, {0.419191926718f, 0.490196079016f, 0.490196079016f}, {0.424242436886f, 0.501960813999f, 0.501960813999f}, {0.429292917252f, 0.525490224361f, 0.525490224361f}, {0.43434342742f, 0.549019634724f, 0.549019634724f}, {0.439393937588f, 0.572549045086f, 0.572549045086f}, {0.444444447756f, 0.600000023842f, 0.600000023842f}, {0.449494957924f, 0.623529434204f, 0.623529434204f}, {0.454545468092f, 0.647058844566f, 0.647058844566f}, {0.459595948458f, 0.670588254929f, 0.670588254929f}, {0.464646458626f, 0.694117665291f, 0.694117665291f}, {0.469696968794f, 0.721568644047f, 0.721568644047f}, {0.474747478962f, 0.745098054409f, 0.745098054409f}, {0.47979798913f, 0.768627464771f, 0.768627464771f}, {0.484848499298f, 0.792156875134f, 0.792156875134f}, {0.489898979664f, 0.815686285496f, 0.815686285496f}, {0.494949489832f, 0.839215695858f, 0.839215695858f}, {0.5f, 0.86274510622f, 0.86274510622f}, {0.505050480366f, 0.886274516582f, 0.886274516582f}, {0.510101020336f, 0.909803926945f, 0.909803926945f}, {0.515151500702f, 0.933333337307f, 0.933333337307f}, {0.520202040672f, 0.956862747669f, 0.956862747669f}, {0.525252521038f, 0.980392158031f, 0.980392158031f}, {0.530303001404f, 1.0f, 1.0f}, {0.535353541374f, 1.0f, 1.0f}, {0.54040402174f, 1.0f, 1.0f}, {0.54545456171f, 1.0f, 1.0f}, {0.550505042076f, 1.0f, 1.0f}, {0.555555582047f, 1.0f, 1.0f}, {0.560606062412f, 1.0f, 1.0f}, {0.565656542778f, 1.0f, 1.0f}, {0.570707082748f, 1.0f, 1.0f}, {0.575757563114f, 1.0f, 1.0f}, {0.580808103085f, 1.0f, 1.0f}, {0.58585858345f, 1.0f, 1.0f}, {0.590909063816f, 1.0f, 1.0f}, {0.595959603786f, 1.0f, 1.0f}, {0.601010084152f, 1.0f, 1.0f}, {0.606060624123f, 1.0f, 1.0f}, {0.611111104488f, 1.0f, 1.0f}, {0.616161644459f, 1.0f, 1.0f}, {0.621212124825f, 1.0f, 1.0f}, {0.62626260519f, 1.0f, 1.0f}, {0.631313145161f, 1.0f, 1.0f}, {0.636363625526f, 1.0f, 1.0f}, {0.641414165497f, 1.0f, 1.0f}, {0.646464645863f, 1.0f, 1.0f}, {0.651515126228f, 1.0f, 1.0f}, {0.656565666199f, 1.0f, 1.0f}, {0.661616146564f, 1.0f, 1.0f}, {0.666666686535f, 1.0f, 1.0f}, {0.671717166901f, 1.0f, 1.0f}, {0.676767647266f, 1.0f, 1.0f}, {0.681818187237f, 1.0f, 1.0f}, {0.686868667603f, 1.0f, 1.0f}, {0.691919207573f, 1.0f, 1.0f}, {0.696969687939f, 1.0f, 1.0f}, {0.702020227909f, 1.0f, 1.0f}, {0.707070708275f, 1.0f, 1.0f}, {0.712121188641f, 1.0f, 1.0f}, {0.717171728611f, 1.0f, 1.0f}, {0.722222208977f, 1.0f, 1.0f}, {0.727272748947f, 1.0f, 1.0f}, {0.732323229313f, 1.0f, 1.0f}, {0.737373709679f, 1.0f, 1.0f}, {0.742424249649f, 1.0f, 1.0f}, {0.747474730015f, 1.0f, 1.0f}, {0.752525269985f, 1.0f, 1.0f}, {0.757575750351f, 1.0f, 1.0f}, {0.762626290321f, 1.0f, 1.0f}, {0.767676770687f, 1.0f, 1.0f}, {0.772727251053f, 1.0f, 1.0f}, {0.777777791023f, 1.0f, 1.0f}, {0.782828271389f, 1.0f, 1.0f}, {0.787878811359f, 1.0f, 1.0f}, {0.792929291725f, 1.0f, 1.0f}, {0.797979772091f, 0.964705884457f, 0.964705884457f}, {0.803030312061f, 0.92549020052f, 0.92549020052f}, {0.808080792427f, 0.890196084976f, 0.890196084976f}, {0.813131332397f, 0.850980401039f, 0.850980401039f}, {0.818181812763f, 0.815686285496f, 0.815686285496f}, {0.823232352734f, 0.776470601559f, 0.776470601559f}, {0.828282833099f, 0.741176486015f, 0.741176486015f}, {0.833333313465f, 0.701960802078f, 0.701960802078f}, {0.838383853436f, 0.666666686535f, 0.666666686535f}, {0.843434333801f, 0.627451002598f, 0.627451002598f}, {0.848484873772f, 0.61960786581f, 0.61960786581f}, {0.853535354137f, 0.65098041296f, 0.65098041296f}, {0.858585834503f, 0.68235296011f, 0.68235296011f}, {0.863636374474f, 0.713725507259f, 0.713725507259f}, {0.868686854839f, 0.745098054409f, 0.745098054409f}, {0.87373739481f, 0.772549033165f, 0.772549033165f}, {0.878787875175f, 0.803921580315f, 0.803921580315f}, {0.883838355541f, 0.835294127464f, 0.835294127464f}, {0.888888895512f, 0.866666674614f, 0.866666674614f}, {0.893939375877f, 0.898039221764f, 0.898039221764f}, {0.898989915848f, 0.929411768913f, 0.929411768913f}, {0.904040396214f, 0.933333337307f, 0.933333337307f}, {0.909090936184f, 0.937254905701f, 0.937254905701f}, {0.91414141655f, 0.937254905701f, 0.937254905701f}, {0.919191896915f, 0.941176474094f, 0.941176474094f}, {0.924242436886f, 0.945098042488f, 0.945098042488f}, {0.929292917252f, 0.945098042488f, 0.945098042488f}, {0.934343457222f, 0.949019610882f, 0.949019610882f}, {0.939393937588f, 0.952941179276f, 0.952941179276f}, {0.944444417953f, 0.952941179276f, 0.952941179276f}, {0.949494957924f, 0.956862747669f, 0.956862747669f}, {0.95454543829f, 0.960784316063f, 0.960784316063f}, {0.95959597826f, 0.964705884457f, 0.964705884457f}, {0.964646458626f, 0.96862745285f, 0.96862745285f}, {0.969696998596f, 0.972549021244f, 0.972549021244f}, {0.974747478962f, 0.976470589638f, 0.976470589638f}, {0.979797959328f, 0.980392158031f, 0.980392158031f}, {0.984848499298f, 0.984313726425f, 0.984313726425f}, {0.989898979664f, 0.988235294819f, 0.988235294819f}, {0.994949519634f, 0.992156863213f, 0.992156863213f}, {1.0f, 0.996078431606f, 0.996078431606f}}, { // green {0.0f, 0.0f, 0.0f}, {0.0050505050458f, 0.0352941192687f, 0.0352941192687f}, {0.0101010100916f, 0.074509806931f, 0.074509806931f}, {0.0151515156031f, 0.109803922474f, 0.109803922474f}, {0.0202020201832f, 0.149019613862f, 0.149019613862f}, {0.0252525247633f, 0.184313729405f, 0.184313729405f}, {0.0303030312061f, 0.223529413342f, 0.223529413342f}, {0.0353535339236f, 0.258823543787f, 0.258823543787f}, {0.0404040403664f, 0.298039227724f, 0.298039227724f}, {0.0454545468092f, 0.333333343267f, 0.333333343267f}, {0.0505050495267f, 0.372549027205f, 0.372549027205f}, {0.0555555559695f, 0.368627458811f, 0.368627458811f}, {0.0606060624123f, 0.333333343267f, 0.333333343267f}, {0.0656565651298f, 0.29411765933f, 0.29411765933f}, {0.0707070678473f, 0.258823543787f, 0.258823543787f}, {0.0757575780153f, 0.219607844949f, 0.219607844949f}, {0.0808080807328f, 0.184313729405f, 0.184313729405f}, {0.0858585834503f, 0.145098045468f, 0.145098045468f}, {0.0909090936184f, 0.109803922474f, 0.109803922474f}, {0.0959595963359f, 0.0705882385373f, 0.0705882385373f}, {0.101010099053f, 0.0352941192687f, 0.0352941192687f}, {0.106060609221f, 0.0f, 0.0f}, {0.111111111939f, 0.074509806931f, 0.074509806931f}, {0.116161614656f, 0.145098045468f, 0.145098045468f}, {0.121212124825f, 0.215686276555f, 0.215686276555f}, {0.126262620091f, 0.286274522543f, 0.286274522543f}, {0.13131313026f, 0.360784322023f, 0.360784322023f}, {0.136363640428f, 0.43137255311f, 0.43137255311f}, {0.141414135695f, 0.501960813999f, 0.501960813999f}, {0.146464645863f, 0.572549045086f, 0.572549045086f}, {0.151515156031f, 0.647058844566f, 0.647058844566f}, {0.156565651298f, 0.717647075653f, 0.717647075653f}, {0.161616161466f, 0.760784327984f, 0.760784327984f}, {0.166666671634f, 0.784313738346f, 0.784313738346f}, {0.171717166901f, 0.807843148708f, 0.807843148708f}, {0.176767677069f, 0.831372559071f, 0.831372559071f}, {0.181818187237f, 0.854901969433f, 0.854901969433f}, {0.186868682504f, 0.882352948189f, 0.882352948189f}, {0.191919192672f, 0.905882358551f, 0.905882358551f}, {0.19696970284f, 0.929411768913f, 0.929411768913f}, {0.202020198107f, 0.952941179276f, 0.952941179276f}, {0.207070708275f, 0.976470589638f, 0.976470589638f}, {0.212121218443f, 0.996078431606f, 0.996078431606f}, {0.21717171371f, 0.996078431606f, 0.996078431606f}, {0.222222223878f, 0.992156863213f, 0.992156863213f}, {0.227272734046f, 0.992156863213f, 0.992156863213f}, {0.232323229313f, 0.992156863213f, 0.992156863213f}, {0.237373739481f, 0.988235294819f, 0.988235294819f}, {0.242424249649f, 0.988235294819f, 0.988235294819f}, {0.247474744916f, 0.984313726425f, 0.984313726425f}, {0.252525240183f, 0.984313726425f, 0.984313726425f}, {0.257575750351f, 0.980392158031f, 0.980392158031f}, {0.262626260519f, 0.980392158031f, 0.980392158031f}, {0.267676770687f, 0.980392158031f, 0.980392158031f}, {0.272727280855f, 0.980392158031f, 0.980392158031f}, {0.277777791023f, 0.984313726425f, 0.984313726425f}, {0.282828271389f, 0.984313726425f, 0.984313726425f}, {0.287878781557f, 0.988235294819f, 0.988235294819f}, {0.292929291725f, 0.988235294819f, 0.988235294819f}, {0.297979801893f, 0.992156863213f, 0.992156863213f}, {0.303030312061f, 0.992156863213f, 0.992156863213f}, {0.308080822229f, 0.996078431606f, 0.996078431606f}, {0.313131302595f, 0.996078431606f, 0.996078431606f}, {0.318181812763f, 0.996078431606f, 0.996078431606f}, {0.323232322931f, 0.976470589638f, 0.976470589638f}, {0.328282833099f, 0.956862747669f, 0.956862747669f}, {0.333333343267f, 0.937254905701f, 0.937254905701f}, {0.338383823633f, 0.921568632126f, 0.921568632126f}, {0.343434333801f, 0.901960790157f, 0.901960790157f}, {0.348484843969f, 0.882352948189f, 0.882352948189f}, {0.353535354137f, 0.86274510622f, 0.86274510622f}, {0.358585864305f, 0.847058832645f, 0.847058832645f}, {0.363636374474f, 0.827450990677f, 0.827450990677f}, {0.368686854839f, 0.807843148708f, 0.807843148708f}, {0.373737365007f, 0.815686285496f, 0.815686285496f}, {0.378787875175f, 0.835294127464f, 0.835294127464f}, {0.383838385344f, 0.850980401039f, 0.850980401039f}, {0.388888895512f, 0.870588243008f, 0.870588243008f}, {0.39393940568f, 0.890196084976f, 0.890196084976f}, {0.398989886045f, 0.909803926945f, 0.909803926945f}, {0.404040396214f, 0.92549020052f, 0.92549020052f}, {0.409090906382f, 0.945098042488f, 0.945098042488f}, {0.41414141655f, 0.964705884457f, 0.964705884457f}, {0.419191926718f, 0.984313726425f, 0.984313726425f}, {0.424242436886f, 1.0f, 1.0f}, {0.429292917252f, 1.0f, 1.0f}, {0.43434342742f, 1.0f, 1.0f}, {0.439393937588f, 1.0f, 1.0f}, {0.444444447756f, 1.0f, 1.0f}, {0.449494957924f, 1.0f, 1.0f}, {0.454545468092f, 1.0f, 1.0f}, {0.459595948458f, 1.0f, 1.0f}, {0.464646458626f, 1.0f, 1.0f}, {0.469696968794f, 1.0f, 1.0f}, {0.474747478962f, 1.0f, 1.0f}, {0.47979798913f, 1.0f, 1.0f}, {0.484848499298f, 1.0f, 1.0f}, {0.489898979664f, 1.0f, 1.0f}, {0.494949489832f, 1.0f, 1.0f}, {0.5f, 1.0f, 1.0f}, {0.505050480366f, 1.0f, 1.0f}, {0.510101020336f, 1.0f, 1.0f}, {0.515151500702f, 1.0f, 1.0f}, {0.520202040672f, 1.0f, 1.0f}, {0.525252521038f, 1.0f, 1.0f}, {0.530303001404f, 0.992156863213f, 0.992156863213f}, {0.535353541374f, 0.980392158031f, 0.980392158031f}, {0.54040402174f, 0.964705884457f, 0.964705884457f}, {0.54545456171f, 0.949019610882f, 0.949019610882f}, {0.550505042076f, 0.933333337307f, 0.933333337307f}, {0.555555582047f, 0.917647063732f, 0.917647063732f}, {0.560606062412f, 0.905882358551f, 0.905882358551f}, {0.565656542778f, 0.890196084976f, 0.890196084976f}, {0.570707082748f, 0.874509811401f, 0.874509811401f}, {0.575757563114f, 0.858823537827f, 0.858823537827f}, {0.580808103085f, 0.843137264252f, 0.843137264252f}, {0.58585858345f, 0.831372559071f, 0.831372559071f}, {0.590909063816f, 0.819607853889f, 0.819607853889f}, {0.595959603786f, 0.811764717102f, 0.811764717102f}, {0.601010084152f, 0.800000011921f, 0.800000011921f}, {0.606060624123f, 0.78823530674f, 0.78823530674f}, {0.611111104488f, 0.776470601559f, 0.776470601559f}, {0.616161644459f, 0.764705896378f, 0.764705896378f}, {0.621212124825f, 0.752941191196f, 0.752941191196f}, {0.62626260519f, 0.741176486015f, 0.741176486015f}, {0.631313145161f, 0.729411780834f, 0.729411780834f}, {0.636363625526f, 0.709803938866f, 0.709803938866f}, {0.641414165497f, 0.666666686535f, 0.666666686535f}, {0.646464645863f, 0.623529434204f, 0.623529434204f}, {0.651515126228f, 0.580392181873f, 0.580392181873f}, {0.656565666199f, 0.537254929543f, 0.537254929543f}, {0.661616146564f, 0.494117647409f, 0.494117647409f}, {0.666666686535f, 0.450980395079f, 0.450980395079f}, {0.671717166901f, 0.403921574354f, 0.403921574354f}, {0.676767647266f, 0.360784322023f, 0.360784322023f}, {0.681818187237f, 0.317647069693f, 0.317647069693f}, {0.686868667603f, 0.274509817362f, 0.274509817362f}, {0.691919207573f, 0.247058823705f, 0.247058823705f}, {0.696969687939f, 0.219607844949f, 0.219607844949f}, {0.702020227909f, 0.196078434587f, 0.196078434587f}, {0.707070708275f, 0.168627455831f, 0.168627455831f}, {0.712121188641f, 0.145098045468f, 0.145098045468f}, {0.717171728611f, 0.117647059262f, 0.117647059262f}, {0.722222208977f, 0.0901960805058f, 0.0901960805058f}, {0.727272748947f, 0.0666666701436f, 0.0666666701436f}, {0.732323229313f, 0.0392156876624f, 0.0392156876624f}, {0.737373709679f, 0.0156862754375f, 0.0156862754375f}, {0.742424249649f, 0.0f, 0.0f}, {0.747474730015f, 0.0f, 0.0f}, {0.752525269985f, 0.0f, 0.0f}, {0.757575750351f, 0.0f, 0.0f}, {0.762626290321f, 0.0f, 0.0f}, {0.767676770687f, 0.0f, 0.0f}, {0.772727251053f, 0.0f, 0.0f}, {0.777777791023f, 0.0f, 0.0f}, {0.782828271389f, 0.0f, 0.0f}, {0.787878811359f, 0.0f, 0.0f}, {0.792929291725f, 0.0f, 0.0f}, {0.797979772091f, 0.0156862754375f, 0.0156862754375f}, {0.803030312061f, 0.0313725508749f, 0.0313725508749f}, {0.808080792427f, 0.0509803928435f, 0.0509803928435f}, {0.813131332397f, 0.0666666701436f, 0.0666666701436f}, {0.818181812763f, 0.0862745121121f, 0.0862745121121f}, {0.823232352734f, 0.105882354081f, 0.105882354081f}, {0.828282833099f, 0.121568627656f, 0.121568627656f}, {0.833333313465f, 0.141176477075f, 0.141176477075f}, {0.838383853436f, 0.156862750649f, 0.156862750649f}, {0.843434333801f, 0.176470592618f, 0.176470592618f}, {0.848484873772f, 0.20000000298f, 0.20000000298f}, {0.853535354137f, 0.23137255013f, 0.23137255013f}, {0.858585834503f, 0.258823543787f, 0.258823543787f}, {0.863636374474f, 0.290196090937f, 0.290196090937f}, {0.868686854839f, 0.321568638086f, 0.321568638086f}, {0.87373739481f, 0.352941185236f, 0.352941185236f}, {0.878787875175f, 0.384313732386f, 0.384313732386f}, {0.883838355541f, 0.415686279535f, 0.415686279535f}, {0.888888895512f, 0.443137258291f, 0.443137258291f}, {0.893939375877f, 0.474509805441f, 0.474509805441f}, {0.898989915848f, 0.505882382393f, 0.505882382393f}, {0.904040396214f, 0.529411792755f, 0.529411792755f}, {0.909090936184f, 0.552941203117f, 0.552941203117f}, {0.91414141655f, 0.572549045086f, 0.572549045086f}, {0.919191896915f, 0.596078455448f, 0.596078455448f}, {0.924242436886f, 0.61960786581f, 0.61960786581f}, {0.929292917252f, 0.643137276173f, 0.643137276173f}, {0.934343457222f, 0.662745118141f, 0.662745118141f}, {0.939393937588f, 0.686274528503f, 0.686274528503f}, {0.944444417953f, 0.709803938866f, 0.709803938866f}, {0.949494957924f, 0.729411780834f, 0.729411780834f}, {0.95454543829f, 0.752941191196f, 0.752941191196f}, {0.95959597826f, 0.780392169952f, 0.780392169952f}, {0.964646458626f, 0.803921580315f, 0.803921580315f}, {0.969696998596f, 0.827450990677f, 0.827450990677f}, {0.974747478962f, 0.850980401039f, 0.850980401039f}, {0.979797959328f, 0.874509811401f, 0.874509811401f}, {0.984848499298f, 0.901960790157f, 0.901960790157f}, {0.989898979664f, 0.92549020052f, 0.92549020052f}, {0.994949519634f, 0.949019610882f, 0.949019610882f}, {1.0f, 0.972549021244f, 0.972549021244f}}, { // blue {0.0f, 0.501960813999f, 0.501960813999f}, {0.0050505050458f, 0.450980395079f, 0.450980395079f}, {0.0101010100916f, 0.403921574354f, 0.403921574354f}, {0.0151515156031f, 0.35686275363f, 0.35686275363f}, {0.0202020201832f, 0.309803932905f, 0.309803932905f}, {0.0252525247633f, 0.258823543787f, 0.258823543787f}, {0.0303030312061f, 0.211764708161f, 0.211764708161f}, {0.0353535339236f, 0.164705887437f, 0.164705887437f}, {0.0404040403664f, 0.117647059262f, 0.117647059262f}, {0.0454545468092f, 0.0705882385373f, 0.0705882385373f}, {0.0505050495267f, 0.0196078438312f, 0.0196078438312f}, {0.0555555559695f, 0.0470588244498f, 0.0470588244498f}, {0.0606060624123f, 0.145098045468f, 0.145098045468f}, {0.0656565651298f, 0.239215686917f, 0.239215686917f}, {0.0707070678473f, 0.333333343267f, 0.333333343267f}, {0.0757575780153f, 0.43137255311f, 0.43137255311f}, {0.0808080807328f, 0.525490224361f, 0.525490224361f}, {0.0858585834503f, 0.61960786581f, 0.61960786581f}, {0.0909090936184f, 0.717647075653f, 0.717647075653f}, {0.0959595963359f, 0.811764717102f, 0.811764717102f}, {0.101010099053f, 0.905882358551f, 0.905882358551f}, {0.106060609221f, 1.0f, 1.0f}, {0.111111111939f, 1.0f, 1.0f}, {0.116161614656f, 1.0f, 1.0f}, {0.121212124825f, 1.0f, 1.0f}, {0.126262620091f, 1.0f, 1.0f}, {0.13131313026f, 1.0f, 1.0f}, {0.136363640428f, 1.0f, 1.0f}, {0.141414135695f, 1.0f, 1.0f}, {0.146464645863f, 1.0f, 1.0f}, {0.151515156031f, 1.0f, 1.0f}, {0.156565651298f, 1.0f, 1.0f}, {0.161616161466f, 1.0f, 1.0f}, {0.166666671634f, 1.0f, 1.0f}, {0.171717166901f, 1.0f, 1.0f}, {0.176767677069f, 1.0f, 1.0f}, {0.181818187237f, 1.0f, 1.0f}, {0.186868682504f, 1.0f, 1.0f}, {0.191919192672f, 1.0f, 1.0f}, {0.19696970284f, 1.0f, 1.0f}, {0.202020198107f, 1.0f, 1.0f}, {0.207070708275f, 1.0f, 1.0f}, {0.212121218443f, 0.992156863213f, 0.992156863213f}, {0.21717171371f, 0.956862747669f, 0.956862747669f}, {0.222222223878f, 0.917647063732f, 0.917647063732f}, {0.227272734046f, 0.882352948189f, 0.882352948189f}, {0.232323229313f, 0.843137264252f, 0.843137264252f}, {0.237373739481f, 0.803921580315f, 0.803921580315f}, {0.242424249649f, 0.768627464771f, 0.768627464771f}, {0.247474744916f, 0.729411780834f, 0.729411780834f}, {0.252525240183f, 0.690196096897f, 0.690196096897f}, {0.257575750351f, 0.654901981354f, 0.654901981354f}, {0.262626260519f, 0.615686297417f, 0.615686297417f}, {0.267676770687f, 0.564705908298f, 0.564705908298f}, {0.272727280855f, 0.509803950787f, 0.509803950787f}, {0.277777791023f, 0.450980395079f, 0.450980395079f}, {0.282828271389f, 0.392156869173f, 0.392156869173f}, {0.287878781557f, 0.333333343267f, 0.333333343267f}, {0.292929291725f, 0.278431385756f, 0.278431385756f}, {0.297979801893f, 0.219607844949f, 0.219607844949f}, {0.303030312061f, 0.160784319043f, 0.160784319043f}, {0.308080822229f, 0.105882354081f, 0.105882354081f}, {0.313131302595f, 0.0470588244498f, 0.0470588244498f}, {0.318181812763f, 0.0f, 0.0f}, {0.323232322931f, 0.0f, 0.0f}, {0.328282833099f, 0.0f, 0.0f}, {0.333333343267f, 0.0f, 0.0f}, {0.338383823633f, 0.0f, 0.0f}, {0.343434333801f, 0.0f, 0.0f}, {0.348484843969f, 0.0f, 0.0f}, {0.353535354137f, 0.0f, 0.0f}, {0.358585864305f, 0.0f, 0.0f}, {0.363636374474f, 0.0f, 0.0f}, {0.368686854839f, 0.0f, 0.0f}, {0.373737365007f, 0.0f, 0.0f}, {0.378787875175f, 0.0f, 0.0f}, {0.383838385344f, 0.0f, 0.0f}, {0.388888895512f, 0.0f, 0.0f}, {0.39393940568f, 0.0f, 0.0f}, {0.398989886045f, 0.0f, 0.0f}, {0.404040396214f, 0.0f, 0.0f}, {0.409090906382f, 0.0f, 0.0f}, {0.41414141655f, 0.0f, 0.0f}, {0.419191926718f, 0.0f, 0.0f}, {0.424242436886f, 0.00392156885937f, 0.00392156885937f}, {0.429292917252f, 0.0274509806186f, 0.0274509806186f}, {0.43434342742f, 0.0509803928435f, 0.0509803928435f}, {0.439393937588f, 0.074509806931f, 0.074509806931f}, {0.444444447756f, 0.0941176488996f, 0.0941176488996f}, {0.449494957924f, 0.117647059262f, 0.117647059262f}, {0.454545468092f, 0.141176477075f, 0.141176477075f}, {0.459595948458f, 0.164705887437f, 0.164705887437f}, {0.464646458626f, 0.188235297799f, 0.188235297799f}, {0.469696968794f, 0.211764708161f, 0.211764708161f}, {0.474747478962f, 0.235294118524f, 0.235294118524f}, {0.47979798913f, 0.223529413342f, 0.223529413342f}, {0.484848499298f, 0.20000000298f, 0.20000000298f}, {0.489898979664f, 0.176470592618f, 0.176470592618f}, {0.494949489832f, 0.152941182256f, 0.152941182256f}, {0.5f, 0.129411771894f, 0.129411771894f}, {0.505050480366f, 0.109803922474f, 0.109803922474f}, {0.510101020336f, 0.0862745121121f, 0.0862745121121f}, {0.515151500702f, 0.0627451017499f, 0.0627451017499f}, {0.520202040672f, 0.0392156876624f, 0.0392156876624f}, {0.525252521038f, 0.0156862754375f, 0.0156862754375f}, {0.530303001404f, 0.0f, 0.0f}, {0.535353541374f, 0.0f, 0.0f}, {0.54040402174f, 0.0f, 0.0f}, {0.54545456171f, 0.0f, 0.0f}, {0.550505042076f, 0.0f, 0.0f}, {0.555555582047f, 0.0f, 0.0f}, {0.560606062412f, 0.0f, 0.0f}, {0.565656542778f, 0.0f, 0.0f}, {0.570707082748f, 0.0f, 0.0f}, {0.575757563114f, 0.0f, 0.0f}, {0.580808103085f, 0.0f, 0.0f}, {0.58585858345f, 0.00392156885937f, 0.00392156885937f}, {0.590909063816f, 0.00784313771874f, 0.00784313771874f}, {0.595959603786f, 0.0117647061124f, 0.0117647061124f}, {0.601010084152f, 0.0196078438312f, 0.0196078438312f}, {0.606060624123f, 0.0235294122249f, 0.0235294122249f}, {0.611111104488f, 0.0313725508749f, 0.0313725508749f}, {0.616161644459f, 0.0352941192687f, 0.0352941192687f}, {0.621212124825f, 0.0431372560561f, 0.0431372560561f}, {0.62626260519f, 0.0470588244498f, 0.0470588244498f}, {0.631313145161f, 0.0549019612372f, 0.0549019612372f}, {0.636363625526f, 0.0549019612372f, 0.0549019612372f}, {0.641414165497f, 0.0509803928435f, 0.0509803928435f}, {0.646464645863f, 0.0431372560561f, 0.0431372560561f}, {0.651515126228f, 0.0392156876624f, 0.0392156876624f}, {0.656565666199f, 0.0313725508749f, 0.0313725508749f}, {0.661616146564f, 0.0274509806186f, 0.0274509806186f}, {0.666666686535f, 0.0196078438312f, 0.0196078438312f}, {0.671717166901f, 0.0156862754375f, 0.0156862754375f}, {0.676767647266f, 0.0117647061124f, 0.0117647061124f}, {0.681818187237f, 0.00392156885937f, 0.00392156885937f}, {0.686868667603f, 0.0f, 0.0f}, {0.691919207573f, 0.0f, 0.0f}, {0.696969687939f, 0.0f, 0.0f}, {0.702020227909f, 0.0f, 0.0f}, {0.707070708275f, 0.0f, 0.0f}, {0.712121188641f, 0.0f, 0.0f}, {0.717171728611f, 0.0f, 0.0f}, {0.722222208977f, 0.0f, 0.0f}, {0.727272748947f, 0.0f, 0.0f}, {0.732323229313f, 0.0f, 0.0f}, {0.737373709679f, 0.0f, 0.0f}, {0.742424249649f, 0.0313725508749f, 0.0313725508749f}, {0.747474730015f, 0.129411771894f, 0.129411771894f}, {0.752525269985f, 0.223529413342f, 0.223529413342f}, {0.757575750351f, 0.321568638086f, 0.321568638086f}, {0.762626290321f, 0.415686279535f, 0.415686279535f}, {0.767676770687f, 0.509803950787f, 0.509803950787f}, {0.772727251053f, 0.607843160629f, 0.607843160629f}, {0.777777791023f, 0.701960802078f, 0.701960802078f}, {0.782828271389f, 0.796078443527f, 0.796078443527f}, {0.787878811359f, 0.89411765337f, 0.89411765337f}, {0.792929291725f, 0.988235294819f, 0.988235294819f}, {0.797979772091f, 1.0f, 1.0f}, {0.803030312061f, 1.0f, 1.0f}, {0.808080792427f, 1.0f, 1.0f}, {0.813131332397f, 1.0f, 1.0f}, {0.818181812763f, 1.0f, 1.0f}, {0.823232352734f, 1.0f, 1.0f}, {0.828282833099f, 1.0f, 1.0f}, {0.833333313465f, 1.0f, 1.0f}, {0.838383853436f, 1.0f, 1.0f}, {0.843434333801f, 1.0f, 1.0f}, {0.848484873772f, 0.996078431606f, 0.996078431606f}, {0.853535354137f, 0.988235294819f, 0.988235294819f}, {0.858585834503f, 0.984313726425f, 0.984313726425f}, {0.863636374474f, 0.976470589638f, 0.976470589638f}, {0.868686854839f, 0.96862745285f, 0.96862745285f}, {0.87373739481f, 0.964705884457f, 0.964705884457f}, {0.878787875175f, 0.956862747669f, 0.956862747669f}, {0.883838355541f, 0.949019610882f, 0.949019610882f}, {0.888888895512f, 0.945098042488f, 0.945098042488f}, {0.893939375877f, 0.937254905701f, 0.937254905701f}, {0.898989915848f, 0.933333337307f, 0.933333337307f}, {0.904040396214f, 0.933333337307f, 0.933333337307f}, {0.909090936184f, 0.937254905701f, 0.937254905701f}, {0.91414141655f, 0.937254905701f, 0.937254905701f}, {0.919191896915f, 0.941176474094f, 0.941176474094f}, {0.924242436886f, 0.945098042488f, 0.945098042488f}, {0.929292917252f, 0.945098042488f, 0.945098042488f}, {0.934343457222f, 0.949019610882f, 0.949019610882f}, {0.939393937588f, 0.952941179276f, 0.952941179276f}, {0.944444417953f, 0.952941179276f, 0.952941179276f}, {0.949494957924f, 0.956862747669f, 0.956862747669f}, {0.95454543829f, 0.960784316063f, 0.960784316063f}, {0.95959597826f, 0.964705884457f, 0.964705884457f}, {0.964646458626f, 0.96862745285f, 0.96862745285f}, {0.969696998596f, 0.972549021244f, 0.972549021244f}, {0.974747478962f, 0.976470589638f, 0.976470589638f}, {0.979797959328f, 0.980392158031f, 0.980392158031f}, {0.984848499298f, 0.984313726425f, 0.984313726425f}, {0.989898979664f, 0.988235294819f, 0.988235294819f}, {0.994949519634f, 0.992156863213f, 0.992156863213f}, {1.0f, 0.996078431606f, 0.996078431606f}}, { // alpha {0.0f, 1.0f, 1.0f}, {1.0f, 1.0f, 1.0f}} }; }
j-dags/Algos
AlgoExpert/Medium/reconstructBST.js
<filename>AlgoExpert/Medium/reconstructBST.js // This is an input class. Do not edit. class BST { constructor(value, left = null, right = null) { this.value = value this.left = left this.right = right } } function reconstructBst(values) { if (values.length < 1) return null // Split up node values array into current node, left (smaller) nodes, and right (larger or equal) nodes const nextValue = values.shift() const leftValues = values.filter((node) => node < nextValue) const rightValues = values.filter((node) => node >= nextValue) // Create tree for current node and recursively create child nodes const tree = new BST(nextValue) tree.left = reconstructBst(leftValues) tree.right = reconstructBst(rightValues) return tree } // TIME: O(n) - have to iterate through values array // SPACE: O(n) - tree scales with values array
sitien173/cnpm-SpringMVC-SpringSecurity
src/main/java/com/vegetarian/api/admin/AdminProductManager.java
<filename>src/main/java/com/vegetarian/api/admin/AdminProductManager.java package com.vegetarian.api.admin; import com.google.gson.Gson; import com.vegetarian.service.ProductService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/admin/api/product") public class AdminProductManager { @Autowired private ProductService productService; @RequestMapping(value = "/{cateId}", method = RequestMethod.GET, produces = "text/plain;charset=UTF-8") public String getAllProductByCategory(@PathVariable("cateId") int cateId){ return new Gson().toJson(productService.getAllProduct(cateId)); } @DeleteMapping("/delete/{id}") public ResponseEntity<?> delete(@PathVariable("id") int id, Model model){ if(productService.delete(id)){ model.addAttribute("info","delete success"); return ResponseEntity.ok().build(); } return ResponseEntity.badRequest().build(); } @GetMapping("/total") public int getTotal(){ return productService.totalProduct(); } }
FinnStutzenstein/openslides-backend
tests/system/action/motion_block/test_delete.py
<reponame>FinnStutzenstein/openslides-backend<filename>tests/system/action/motion_block/test_delete.py from openslides_backend.permissions.permissions import Permissions from tests.system.action.base import BaseActionTestCase class MotionBlockActionTest(BaseActionTestCase): def test_delete_correct(self) -> None: self.set_models({"meeting/11": {}, "motion_block/111": {"meeting_id": 11}}) response = self.request("motion_block.delete", {"id": 111}) self.assert_status_code(response, 200) self.assert_model_deleted("motion_block/111") def test_delete_wrong_id(self) -> None: self.set_models({"meeting/11": {}, "motion_block/112": {"meeting_id": 11}}) response = self.request("motion_block.delete", {"id": 111}) self.assert_status_code(response, 400) self.assert_model_exists("motion_block/112") def test_delete_correct_cascading(self) -> None: self.set_models( { "meeting/12": {}, "motion_block/111": { "list_of_speakers_id": 222, "agenda_item_id": 333, "meeting_id": 12, }, "list_of_speakers/222": { "closed": False, "content_object_id": "motion_block/111", "meeting_id": 12, }, "agenda_item/333": { "comment": "test_comment_ewoirzewoirioewr", "content_object_id": "motion_block/111", "meeting_id": 12, }, } ) response = self.request("motion_block.delete", {"id": 111}) self.assert_status_code(response, 200) self.assert_model_deleted("motion_block/111") self.assert_model_deleted("agenda_item/333") self.assert_model_deleted("list_of_speakers/222") def test_delete_no_permissions(self) -> None: self.base_permission_test( {"motion_block/111": {"meeting_id": 1}}, "motion_block.delete", {"id": 111}, ) def test_delete_permissions(self) -> None: self.base_permission_test( {"motion_block/111": {"meeting_id": 1}}, "motion_block.delete", {"id": 111}, Permissions.Motion.CAN_MANAGE, )
ScalablyTyped/SlinkyTyped
a/aws-sdk/src/main/scala/typingsSlinky/awsSdk/route53Mod/GetHealthCheckRequest.scala
<filename>a/aws-sdk/src/main/scala/typingsSlinky/awsSdk/route53Mod/GetHealthCheckRequest.scala package typingsSlinky.awsSdk.route53Mod import org.scalablytyped.runtime.StObject import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} @js.native trait GetHealthCheckRequest extends StObject { /** * The identifier that Amazon Route 53 assigned to the health check when you created it. When you add or update a resource record set, you use this value to specify which health check to use. The value can be up to 64 characters long. */ var HealthCheckId: typingsSlinky.awsSdk.route53Mod.HealthCheckId = js.native } object GetHealthCheckRequest { @scala.inline def apply(HealthCheckId: HealthCheckId): GetHealthCheckRequest = { val __obj = js.Dynamic.literal(HealthCheckId = HealthCheckId.asInstanceOf[js.Any]) __obj.asInstanceOf[GetHealthCheckRequest] } @scala.inline implicit class GetHealthCheckRequestMutableBuilder[Self <: GetHealthCheckRequest] (val x: Self) extends AnyVal { @scala.inline def setHealthCheckId(value: HealthCheckId): Self = StObject.set(x, "HealthCheckId", value.asInstanceOf[js.Any]) } }
hunshikan/universe_push
demo/AndroidPushDemo/PushdemoInternal/src/main/java/com/comsince/github/utils/PreferenceUtil.java
package com.comsince.github.utils; import android.content.Context; import android.content.SharedPreferences; public class PreferenceUtil { private static SharedPreferences getSharePerferenceByName(Context context, String name){ //http://zmywly8866.github.io/2015/09/09/sharedpreferences-in-multiprocess.html //多进程数据不共享,建议升级pushSDK3.5.0以上版本 SharedPreferences sharedPreferences = context.getSharedPreferences(name,Context.MODE_PRIVATE); return sharedPreferences; } /** * 保存String类型的数据 * @param context * @param preferenceName * @param key * @param value * * */ public static void putStringByKey(Context context,String preferenceName,String key,String value){ SharedPreferences sharedPreferences = getSharePerferenceByName(context, preferenceName); sharedPreferences.edit().putString(key,value).apply(); } public static void putToken(Context context,String token){ putStringByKey(context,"push","push-token",token); } public static String getStringBykey(Context context,String preferenceName,String key){ return getSharePerferenceByName(context,preferenceName).getString(key,""); } public static String getToken(Context context){ return getStringBykey(context,"push","push-token"); } }
cossbow/jackal
event/roster.go
<gh_stars>0 // Copyright 2020 The jackal 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 event const ( // RosterRequested event is posted whenever a user requests the roster. RosterRequested = "roster.requested" // RosterItemUpdated event is posted whenever a roster item subscription is updated. RosterItemUpdated = "roster.item.updated" ) // RosterEventInfo contains all information associated to a roster event. type RosterEventInfo struct { // Username is the name of the roster owner. Username string // JID is the event contact JID. JID string // Subscription is the roster event subscription value. Subscription string }
skullbaselab/aa-afterdark
TrelloClone-master/skeleton/app/models/item.rb
# == Schema Information # # Table name: items # # id :integer not null, primary key # title :string(255) not null # card_id :integer not null # done :boolean default(FALSE) # created_at :datetime # updated_at :datetime # class Item < ActiveRecord::Base validates :title, :card, presence: true belongs_to :card end
bitmovin/bitmovin-api-sdk-go
model/filter.go
package model import ( "bytes" "encoding/json" "github.com/bitmovin/bitmovin-api-sdk-go/bitutils" "io" "io/ioutil" ) // Filter model type Filter interface { // FilterType returns the discriminator type of the polymorphic model FilterType() FilterType } // BaseFilter is the fallback type for the polymorphic model Filter. type BaseFilter struct { // Id of the resource (required) Id *string `json:"id"` // Name of the resource. Can be freely chosen by the user. Name *string `json:"name,omitempty"` // Description of the resource. Can be freely chosen by the user. Description *string `json:"description,omitempty"` // Creation timestamp, returned as UTC expressed in ISO 8601 format: YYYY-MM-DDThh:mm:ssZ CreatedAt *DateTime `json:"createdAt,omitempty"` // Modified timestamp, returned as UTC expressed in ISO 8601 format: YYYY-MM-DDThh:mm:ssZ ModifiedAt *DateTime `json:"modifiedAt,omitempty"` // User-specific meta data. This can hold anything. CustomData *map[string]interface{} `json:"customData,omitempty"` Type FilterType `json:"type"` } func (m BaseFilter) FilterType() FilterType { return m.Type } // UnmarshalFilterSlice unmarshals polymorphic slices of Filter func UnmarshalFilterSlice(reader io.Reader, consumer bitutils.Consumer) ([]Filter, error) { var elements []json.RawMessage if err := consumer.Consume(reader, &elements); err != nil { return nil, err } var result []Filter for _, element := range elements { obj, err := unmarshalFilter(element, consumer) if err != nil { return nil, err } result = append(result, obj) } return result, nil } // UnmarshalFilter unmarshals polymorphic Filter func UnmarshalFilter(reader io.Reader, consumer bitutils.Consumer) (Filter, error) { // we need to read this twice, so first into a buffer data, err := ioutil.ReadAll(reader) if err != nil { return nil, err } return unmarshalFilter(data, consumer) } func unmarshalFilter(data []byte, consumer bitutils.Consumer) (Filter, error) { buf := bytes.NewBuffer(data) buf2 := bytes.NewBuffer(data) // the first time this is read is to fetch the value of the type property. var baseType BaseFilter if err := consumer.Consume(buf, &baseType); err != nil { return nil, err } // The value of type is used to determine which type to create and unmarshal the data into switch baseType.FilterType() { case "CROP": var result CropFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil case "CONFORM": var result ConformFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil case "WATERMARK": var result WatermarkFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil case "ENHANCED_WATERMARK": var result EnhancedWatermarkFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil case "ROTATE": var result RotateFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil case "DEINTERLACE": var result DeinterlaceFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil case "ENHANCED_DEINTERLACE": var result EnhancedDeinterlaceFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil case "AUDIO_MIX": var result AudioMixFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil case "DENOISE_HQDN3D": var result DenoiseHqdn3dFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil case "TEXT": var result TextFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil case "UNSHARP": var result UnsharpFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil case "SCALE": var result ScaleFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil case "INTERLACE": var result InterlaceFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil case "AUDIO_VOLUME": var result AudioVolumeFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil case "EBU_R128_SINGLE_PASS": var result EbuR128SinglePassFilter if err := consumer.Consume(buf2, &result); err != nil { return nil, err } return result, nil default: return baseType, nil } }
pedropbazzo/bootcamp
gonative/modulo1/src/config/ReactotronConfig.js
<reponame>pedropbazzo/bootcamp<filename>gonative/modulo1/src/config/ReactotronConfig.js import Reactotron from 'reactotron-react-native'; // Reactotron.configure({ host: '192.168.1.14'}) quando estiver debbungando pelo dispositivo fisico if (__DEV__) { const tron = Reactotron.configure() // controls connection & communication settings .useReactNative() // add all built-in react native plugins .connect(); // let's connect! // criando uma variavel tron na variavel global console console.tron = tron; tron.clear(); // limpar histórico toda vez q a aplicação sobe novamente }
willfrey/ray
python/ray/tests/kuberay/utils.py
"""Utilities for e2e tests of KubeRay/Ray integration. For consistency, all K8s interactions use kubectl through subprocess calls. """ import atexit import contextlib import logging import pathlib import subprocess import tempfile import time from typing import Any, Dict, Generator, List, Optional import yaml import ray from ray.job_submission import JobStatus, JobSubmissionClient logger = logging.getLogger(__name__) SCRIPTS_DIR = pathlib.Path(__file__).resolve().parent / "scripts" def wait_for_crd(crd_name: str, tries=60, backoff_s=5): """CRD creation can take a bit of time after the client request. This function waits until the crd with the provided name is registered. """ for i in range(tries): get_crd_output = subprocess.check_output(["kubectl", "get", "crd"]).decode() if crd_name in get_crd_output: logger.info(f"Confirmed existence of CRD {crd_name}.") return elif i < tries - 1: logger.info(f"Still waiting to register CRD {crd_name}") time.sleep(backoff_s) else: raise Exception(f"Failed to register CRD {crd_name}") def wait_for_pods(goal_num_pods: int, namespace: str, tries=60, backoff_s=5) -> None: """Wait for the number of pods in the `namespace` to be exactly `num_pods`. Raise an exception after exceeding `tries` attempts with `backoff_s` second waits. """ for i in range(tries): cur_num_pods = _get_num_pods(namespace) if cur_num_pods == goal_num_pods: logger.info(f"Confirmed {goal_num_pods} pod(s) in namespace {namespace}.") return elif i < tries - 1: logger.info( f"The number of pods in namespace {namespace} is {cur_num_pods}." f" Waiting until the number of pods is {goal_num_pods}." ) time.sleep(backoff_s) else: raise Exception( f"Failed to scale to {goal_num_pods} pod(s) in namespace {namespace}." ) def _get_num_pods(namespace: str) -> int: return len(get_pod_names(namespace)) def get_pod_names(namespace: str) -> List[str]: """Get the list of pod names in the namespace.""" get_pods_output = ( subprocess.check_output( [ "kubectl", "-n", namespace, "get", "pods", "-o", "custom-columns=POD:metadata.name", "--no-headers", ] ) .decode() .strip() ) # If there aren't any pods, the output is any empty string. if not get_pods_output: return [] else: return get_pods_output.split("\n") def wait_for_pod_to_start( pod_name_filter: str, namespace: str, tries=60, backoff_s=5 ) -> None: """Waits for a pod to have Running status.phase. More precisely, waits until there is a pod with name containing `pod_name_filter` and the pod has Running status.phase.""" for i in range(tries): pod = get_pod(pod_name_filter=pod_name_filter, namespace=namespace) if not pod: # We didn't get a matching pod. continue pod_status = ( subprocess.check_output( [ "kubectl", "-n", namespace, "get", "pod", pod, "-o", "custom-columns=POD:status.phase", "--no-headers", ] ) .decode() .strip() ) # "not found" is part of the kubectl output if the pod's not there. if "not found" in pod_status: raise Exception(f"Pod {pod} not found.") elif pod_status == "Running": logger.info(f"Confirmed pod {pod} is Running.") return elif i < tries - 1: logger.info( f"Pod {pod} has status {pod_status}. Waiting for the pod to enter " "Running status." ) time.sleep(backoff_s) else: raise Exception(f"Timed out waiting for pod {pod} to enter Running status.") def wait_for_ray_health( pod_name_filter: str, namespace: str, tries=60, backoff_s=5, ray_container="ray-head", ) -> None: """Waits until a Ray pod passes `ray health-check`. More precisely, waits until a Ray pod whose name includes the string `pod_name_filter` passes `ray health-check`. (Ensures Ray has completely started in the pod.) Use case: Wait until there is a Ray head pod with Ray running on it. """ for i in range(tries): try: pod = get_pod(pod_name_filter=pod_name_filter, namespace="default") assert pod, f"Couldn't find a pod matching {pod_name_filter}." # `ray health-check` yields 0 exit status iff it succeeds kubectl_exec( ["ray", "health-check"], pod, namespace, container=ray_container ) logger.info(f"ray health check passes for pod {pod}") return except subprocess.CalledProcessError as e: logger.info(f"Failed ray health check for pod {pod}.") if i < tries - 1: logger.info("Trying again.") time.sleep(backoff_s) else: logger.info("Giving up.") raise e from None def get_pod(pod_name_filter: str, namespace: str) -> Optional[str]: """Gets pods in the `namespace`. Returns the first pod that has `pod_name_filter` as a substring of its name. Returns None if there are no matches. """ pod_names = get_pod_names(namespace) matches = [pod_name for pod_name in pod_names if pod_name_filter in pod_name] if not matches: logger.warning(f"No match for `{pod_name_filter}` in namespace `{namespace}`.") return None return matches[0] def kubectl_exec( command: List[str], pod: str, namespace: str, container: Optional[str] = None, ) -> str: """kubectl exec the `command` in the given `pod` in the given `namespace`. If a `container` is specified, will specify that container for kubectl. Prints and return kubectl's output as a string. """ container_option = ["-c", container] if container else [] kubectl_exec_command = ( ["kubectl", "exec", "-it", pod] + container_option + ["--"] + command ) out = subprocess.check_output(kubectl_exec_command).decode().strip() # Print for debugging convenience. print(out) return out def kubectl_exec_python_script( script_name: str, pod: str, namespace: str, container: Optional[str] = None, ) -> str: """ Runs a python script in a container via `kubectl exec`. Scripts live in `tests/kuberay/scripts`. Prints and return kubectl's output as a string. """ script_path = SCRIPTS_DIR / script_name with open(script_path) as script_file: script_string = script_file.read() return kubectl_exec(["python", "-c", script_string], pod, namespace, container) def get_raycluster(raycluster: str, namespace: str) -> Dict[str, Any]: """Gets the Ray CR with name `raycluster` in namespace `namespace`. Returns the CR as a nested Dict. """ get_raycluster_output = ( subprocess.check_output( ["kubectl", "-n", namespace, "get", "raycluster", raycluster, "-o", "yaml"] ) .decode() .strip() ) return yaml.safe_load(get_raycluster_output) def _get_service_port(service: str, namespace: str, target_port: int) -> int: """Given a K8s service and a port targetted by the service, returns the corresponding port exposed by the service. Args: service: Name of a K8s service. namespace: Namespace to which the service belongs. target_port: Port targeted by the service. Returns: service_port: The port exposed by the service. """ service_str = ( subprocess.check_output( ["kubectl", "-n", namespace, "get", "service", service, "-o", "yaml"] ) .decode() .strip() ) service_dict = yaml.safe_load(service_str) service_ports: List = service_dict["spec"]["ports"] matching_ports = [ port for port in service_ports if port["targetPort"] == target_port ] assert matching_ports service_port = matching_ports[0]["port"] return service_port @contextlib.contextmanager def _kubectl_port_forward( service: str, namespace: str, target_port: int, local_port: Optional[int] = None ) -> Generator[int, None, None]: """Context manager which creates a kubectl port-forward process targeting a K8s service. Terminates the port-forwarding process upon exit. Args: service: Name of a K8s service. namespace: Namespace to which the service belongs. target_port: The port targeted by the service. local_port: Forward from this port. Optional. By default, uses the port exposed by the service. Yields: The local port. The service can then be accessed at 127.0.0.1:<local_port>. """ # First, figure out which port the service exposes for the given target port. service_port = _get_service_port(service, namespace, target_port) if not local_port: local_port = service_port process = subprocess.Popen( [ "kubectl", "-n", namespace, "port-forward", f"service/{service}", f"{local_port}:{service_port}", ] ) def terminate_process(): process.terminate() # Wait 10 seconds for the process to terminate. # This cleans up the zombie entry from the process table. # 10 seconds is a deliberately excessive amount of time to wait. process.wait(timeout=10) # Ensure clean-up in case of interrupt. atexit.register(terminate_process) # terminate_process is ok to execute multiple times. try: yield local_port finally: terminate_process() @contextlib.contextmanager def ray_client_port_forward( head_service: str, k8s_namespace: str = "default", ray_namespace: Optional[str] = None, ray_client_port: int = 10001, ): """Context manager which manages a Ray client connection using kubectl port-forward. Args: head_service: The name of the Ray head K8s service. k8s_namespace: K8s namespace the Ray cluster belongs to. ray_namespace: The Ray namespace to connect to. ray_client_port: The port on which the Ray head is running the Ray client server. """ with _kubectl_port_forward( service=head_service, namespace=k8s_namespace, target_port=ray_client_port ) as local_port: with ray.init(f"ray://127.0.0.1:{local_port}", namespace=ray_namespace): yield def ray_job_submit( script_name: str, head_service: str, k8s_namespace: str = "default", ray_dashboard_port: int = 8265, ) -> str: """Submits a Python script via the Ray Job Submission API, using the Python SDK. Waits for successful completion of the job and returns the job logs as a string. Uses `kubectl port-forward` to access the Ray head's dashboard port. Scripts live in `tests/kuberay/scripts`. This directory is used as the working dir for the job. Args: script_name: The name of the script to submit. head_service: The name of the Ray head K8s service. k8s_namespace: K8s namespace the Ray cluster belongs to. ray_dashboard_port: The port on which the Ray head is running the Ray dashboard. """ with _kubectl_port_forward( service=head_service, namespace=k8s_namespace, target_port=ray_dashboard_port ) as local_port: # It takes a bit of time to establish the connection. # Try a few times to instantiate the JobSubmissionClient, as the client's # instantiation does not retry on connection errors. for trie in range(1, 7): time.sleep(5) try: client = JobSubmissionClient(f"http://127.0.0.1:{local_port}") except ConnectionError as e: if trie < 6: logger.info("Job client connection failed. Retrying in 5 seconds.") else: raise e from None job_id = client.submit_job( entrypoint=f"python {script_name}", runtime_env={ "working_dir": SCRIPTS_DIR, # Throw in some extra data for fun, to validate runtime envs. "pip": ["pytest==6.0.0"], "env_vars": {"key_foo": "value_bar"}, }, ) # Wait for the job to complete successfully. # This logic is copied from the Job Submission docs. start = time.time() timeout = 60 while time.time() - start <= timeout: status = client.get_job_status(job_id) print(f"status: {status}") if status in {JobStatus.SUCCEEDED, JobStatus.STOPPED, JobStatus.FAILED}: break time.sleep(5) assert status == JobStatus.SUCCEEDED return client.get_job_logs(job_id) def kubectl_patch( kind: str, name: str, namespace: str, patch: Dict[str, Any], patch_type: str = "strategic", ): """Wrapper for kubectl patch. Args: kind: Kind of the K8s resource (e.g. pod) name: Name of the K8s resource. namespace: Namespace of the K8s resource. patch: The patch to apply, as a dict. patch_type: json, merge, or strategic """ with tempfile.NamedTemporaryFile("w") as patch_file: yaml.dump(patch, patch_file) patch_file.flush() subprocess.check_call( [ "kubectl", "-n", f"{namespace}", "patch", f"{kind}", f"{name}", "--patch-file", f"{patch_file.name}", "--type", f"{patch_type}", ] ) def kubectl_delete(kind: str, name: str, namespace: str, wait: bool = True): """Wrapper for kubectl delete. Args: kind: Kind of the K8s resource (e.g. pod) name: Name of the K8s resource. namespace: Namespace of the K8s resource. """ wait_str = "true" if wait else "false" subprocess.check_output( [ "kubectl", "-n", f"{namespace}", "delete", f"{kind}", f"{name}", f"--wait={wait_str}", ] )
hjarvard/DragonFlyBSD
sys/vfs/hammer2/hammer2_vfsops.c
<reponame>hjarvard/DragonFlyBSD /* * Copyright (c) 2011-2018 The DragonFly Project. All rights reserved. * * This code is derived from software contributed to The DragonFly Project * by <NAME> <<EMAIL>> * by <NAME> (GSOC 2013 - mentored by <NAME>, compression) * * 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 DragonFly Project 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 HOLDERS 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. */ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> #include <sys/nlookup.h> #include <sys/vnode.h> #include <sys/mount.h> #include <sys/fcntl.h> #include <sys/vfsops.h> #include <sys/sysctl.h> #include <sys/socket.h> #include <sys/objcache.h> #include <sys/proc.h> #include <sys/lock.h> #include <sys/file.h> #include "hammer2.h" TAILQ_HEAD(hammer2_mntlist, hammer2_dev); static struct hammer2_mntlist hammer2_mntlist; struct hammer2_pfslist hammer2_pfslist; struct hammer2_pfslist hammer2_spmplist; struct lock hammer2_mntlk; int hammer2_supported_version = HAMMER2_VOL_VERSION_DEFAULT; int hammer2_debug; int hammer2_aux_flags; int hammer2_xop_nthreads; int hammer2_xop_sgroups; int hammer2_xop_xgroups; int hammer2_xop_xbase; int hammer2_xop_mod; long hammer2_debug_inode; int hammer2_cluster_meta_read = 1; /* physical read-ahead */ int hammer2_cluster_data_read = 4; /* physical read-ahead */ int hammer2_cluster_write = 0; /* physical write clustering */ int hammer2_dedup_enable = 1; int hammer2_always_compress = 0; /* always try to compress */ int hammer2_flush_pipe = 100; int hammer2_dio_count; int hammer2_dio_limit = 256; int hammer2_bulkfree_tps = 5000; int hammer2_spread_workers; long hammer2_chain_allocs; long hammer2_limit_dirty_chains; long hammer2_limit_dirty_inodes; long hammer2_count_modified_chains; long hammer2_iod_file_read; long hammer2_iod_meta_read; long hammer2_iod_indr_read; long hammer2_iod_fmap_read; long hammer2_iod_volu_read; long hammer2_iod_file_write; long hammer2_iod_file_wembed; long hammer2_iod_file_wzero; long hammer2_iod_file_wdedup; long hammer2_iod_meta_write; long hammer2_iod_indr_write; long hammer2_iod_fmap_write; long hammer2_iod_volu_write; static long hammer2_iod_inode_creates; static long hammer2_iod_inode_deletes; long hammer2_process_icrc32; long hammer2_process_xxhash64; MALLOC_DECLARE(M_HAMMER2_CBUFFER); MALLOC_DEFINE(M_HAMMER2_CBUFFER, "HAMMER2-compbuffer", "Buffer used for compression."); MALLOC_DECLARE(M_HAMMER2_DEBUFFER); MALLOC_DEFINE(M_HAMMER2_DEBUFFER, "HAMMER2-decompbuffer", "Buffer used for decompression."); SYSCTL_NODE(_vfs, OID_AUTO, hammer2, CTLFLAG_RW, 0, "HAMMER2 filesystem"); SYSCTL_INT(_vfs_hammer2, OID_AUTO, supported_version, CTLFLAG_RD, &hammer2_supported_version, 0, ""); SYSCTL_INT(_vfs_hammer2, OID_AUTO, aux_flags, CTLFLAG_RW, &hammer2_aux_flags, 0, ""); SYSCTL_INT(_vfs_hammer2, OID_AUTO, debug, CTLFLAG_RW, &hammer2_debug, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, debug_inode, CTLFLAG_RW, &hammer2_debug_inode, 0, ""); SYSCTL_INT(_vfs_hammer2, OID_AUTO, spread_workers, CTLFLAG_RW, &hammer2_spread_workers, 0, ""); SYSCTL_INT(_vfs_hammer2, OID_AUTO, cluster_meta_read, CTLFLAG_RW, &hammer2_cluster_meta_read, 0, ""); SYSCTL_INT(_vfs_hammer2, OID_AUTO, cluster_data_read, CTLFLAG_RW, &hammer2_cluster_data_read, 0, ""); SYSCTL_INT(_vfs_hammer2, OID_AUTO, cluster_write, CTLFLAG_RW, &hammer2_cluster_write, 0, ""); SYSCTL_INT(_vfs_hammer2, OID_AUTO, dedup_enable, CTLFLAG_RW, &hammer2_dedup_enable, 0, ""); SYSCTL_INT(_vfs_hammer2, OID_AUTO, always_compress, CTLFLAG_RW, &hammer2_always_compress, 0, ""); SYSCTL_INT(_vfs_hammer2, OID_AUTO, flush_pipe, CTLFLAG_RW, &hammer2_flush_pipe, 0, ""); SYSCTL_INT(_vfs_hammer2, OID_AUTO, bulkfree_tps, CTLFLAG_RW, &hammer2_bulkfree_tps, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, chain_allocs, CTLFLAG_RW, &hammer2_chain_allocs, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, limit_dirty_chains, CTLFLAG_RW, &hammer2_limit_dirty_chains, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, limit_dirty_inodes, CTLFLAG_RW, &hammer2_limit_dirty_inodes, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, count_modified_chains, CTLFLAG_RW, &hammer2_count_modified_chains, 0, ""); SYSCTL_INT(_vfs_hammer2, OID_AUTO, dio_count, CTLFLAG_RD, &hammer2_dio_count, 0, ""); SYSCTL_INT(_vfs_hammer2, OID_AUTO, dio_limit, CTLFLAG_RW, &hammer2_dio_limit, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_file_read, CTLFLAG_RW, &hammer2_iod_file_read, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_meta_read, CTLFLAG_RW, &hammer2_iod_meta_read, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_indr_read, CTLFLAG_RW, &hammer2_iod_indr_read, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_fmap_read, CTLFLAG_RW, &hammer2_iod_fmap_read, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_volu_read, CTLFLAG_RW, &hammer2_iod_volu_read, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_file_write, CTLFLAG_RW, &hammer2_iod_file_write, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_file_wembed, CTLFLAG_RW, &hammer2_iod_file_wembed, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_file_wzero, CTLFLAG_RW, &hammer2_iod_file_wzero, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_file_wdedup, CTLFLAG_RW, &hammer2_iod_file_wdedup, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_meta_write, CTLFLAG_RW, &hammer2_iod_meta_write, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_indr_write, CTLFLAG_RW, &hammer2_iod_indr_write, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_fmap_write, CTLFLAG_RW, &hammer2_iod_fmap_write, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_volu_write, CTLFLAG_RW, &hammer2_iod_volu_write, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_inode_creates, CTLFLAG_RW, &hammer2_iod_inode_creates, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_inode_deletes, CTLFLAG_RW, &hammer2_iod_inode_deletes, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, process_icrc32, CTLFLAG_RW, &hammer2_process_icrc32, 0, ""); SYSCTL_LONG(_vfs_hammer2, OID_AUTO, process_xxhash64, CTLFLAG_RW, &hammer2_process_xxhash64, 0, ""); static int hammer2_vfs_init(struct vfsconf *conf); static int hammer2_vfs_uninit(struct vfsconf *vfsp); static int hammer2_vfs_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred); static int hammer2_remount(hammer2_dev_t *, struct mount *, char *, struct ucred *); static int hammer2_recovery(hammer2_dev_t *hmp); static int hammer2_vfs_unmount(struct mount *mp, int mntflags); static int hammer2_vfs_root(struct mount *mp, struct vnode **vpp); static int hammer2_vfs_statfs(struct mount *mp, struct statfs *sbp, struct ucred *cred); static int hammer2_vfs_statvfs(struct mount *mp, struct statvfs *sbp, struct ucred *cred); static int hammer2_vfs_fhtovp(struct mount *mp, struct vnode *rootvp, struct fid *fhp, struct vnode **vpp); static int hammer2_vfs_vptofh(struct vnode *vp, struct fid *fhp); static int hammer2_vfs_checkexp(struct mount *mp, struct sockaddr *nam, int *exflagsp, struct ucred **credanonp); static int hammer2_vfs_modifying(struct mount *mp); static void hammer2_update_pmps(hammer2_dev_t *hmp); static void hammer2_mount_helper(struct mount *mp, hammer2_pfs_t *pmp); static void hammer2_unmount_helper(struct mount *mp, hammer2_pfs_t *pmp, hammer2_dev_t *hmp); static int hammer2_fixup_pfses(hammer2_dev_t *hmp); /* * HAMMER2 vfs operations. */ static struct vfsops hammer2_vfsops = { .vfs_flags = 0, .vfs_init = hammer2_vfs_init, .vfs_uninit = hammer2_vfs_uninit, .vfs_sync = hammer2_vfs_sync, .vfs_mount = hammer2_vfs_mount, .vfs_unmount = hammer2_vfs_unmount, .vfs_root = hammer2_vfs_root, .vfs_statfs = hammer2_vfs_statfs, .vfs_statvfs = hammer2_vfs_statvfs, .vfs_vget = hammer2_vfs_vget, .vfs_vptofh = hammer2_vfs_vptofh, .vfs_fhtovp = hammer2_vfs_fhtovp, .vfs_checkexp = hammer2_vfs_checkexp, .vfs_modifying = hammer2_vfs_modifying }; MALLOC_DEFINE(M_HAMMER2, "HAMMER2-mount", ""); VFS_SET(hammer2_vfsops, hammer2, VFCF_MPSAFE); MODULE_VERSION(hammer2, 1); static int hammer2_vfs_init(struct vfsconf *conf) { static struct objcache_malloc_args margs_read; static struct objcache_malloc_args margs_write; static struct objcache_malloc_args margs_vop; int error; int mod; error = 0; kmalloc_raise_limit(M_HAMMER2, 0); /* unlimited */ /* * hammer2_xop_nthreads must be a multiple of ncpus, * minimum 2 * ncpus. */ mod = ncpus; hammer2_xop_mod = mod; hammer2_xop_nthreads = mod * 2; while (hammer2_xop_nthreads / mod < HAMMER2_XOPGROUPS_MIN || hammer2_xop_nthreads < HAMMER2_XOPTHREADS_MIN) { hammer2_xop_nthreads += mod; } hammer2_xop_sgroups = hammer2_xop_nthreads / mod / 2; hammer2_xop_xgroups = hammer2_xop_nthreads / mod - hammer2_xop_sgroups; hammer2_xop_xbase = hammer2_xop_sgroups * mod; /* * A large DIO cache is needed to retain dedup enablement masks. * The bulkfree code clears related masks as part of the disk block * recycling algorithm, preventing it from being used for a later * dedup. * * NOTE: A large buffer cache can actually interfere with dedup * operation because we dedup based on media physical buffers * and not logical buffers. Try to make the DIO case large * enough to avoid this problem, but also cap it. */ hammer2_dio_limit = nbuf * 2; if (hammer2_dio_limit > 100000) hammer2_dio_limit = 100000; if (HAMMER2_BLOCKREF_BYTES != sizeof(struct hammer2_blockref)) error = EINVAL; if (HAMMER2_INODE_BYTES != sizeof(struct hammer2_inode_data)) error = EINVAL; if (HAMMER2_VOLUME_BYTES != sizeof(struct hammer2_volume_data)) error = EINVAL; if (error) kprintf("HAMMER2 structure size mismatch; cannot continue.\n"); margs_read.objsize = 65536; margs_read.mtype = M_HAMMER2_DEBUFFER; margs_write.objsize = 32768; margs_write.mtype = M_HAMMER2_CBUFFER; margs_vop.objsize = sizeof(hammer2_xop_t); margs_vop.mtype = M_HAMMER2; /* * Note thaht for the XOPS cache we want backing store allocations * to use M_ZERO. This is not allowed in objcache_get() (to avoid * confusion), so use the backing store function that does it. This * means that initial XOPS objects are zerod but REUSED objects are * not. So we are responsible for cleaning the object up sufficiently * for our needs before objcache_put()ing it back (typically just the * FIFO indices). */ cache_buffer_read = objcache_create(margs_read.mtype->ks_shortdesc, 0, 1, NULL, NULL, NULL, objcache_malloc_alloc, objcache_malloc_free, &margs_read); cache_buffer_write = objcache_create(margs_write.mtype->ks_shortdesc, 0, 1, NULL, NULL, NULL, objcache_malloc_alloc, objcache_malloc_free, &margs_write); cache_xops = objcache_create(margs_vop.mtype->ks_shortdesc, 0, 1, NULL, NULL, NULL, objcache_malloc_alloc_zero, objcache_malloc_free, &margs_vop); lockinit(&hammer2_mntlk, "mntlk", 0, 0); TAILQ_INIT(&hammer2_mntlist); TAILQ_INIT(&hammer2_pfslist); TAILQ_INIT(&hammer2_spmplist); hammer2_limit_dirty_chains = maxvnodes / 10; if (hammer2_limit_dirty_chains > HAMMER2_LIMIT_DIRTY_CHAINS) hammer2_limit_dirty_chains = HAMMER2_LIMIT_DIRTY_CHAINS; if (hammer2_limit_dirty_chains < 1000) hammer2_limit_dirty_chains = 1000; hammer2_limit_dirty_inodes = maxvnodes / 25; if (hammer2_limit_dirty_inodes < 100) hammer2_limit_dirty_inodes = 100; if (hammer2_limit_dirty_inodes > HAMMER2_LIMIT_DIRTY_INODES) hammer2_limit_dirty_inodes = HAMMER2_LIMIT_DIRTY_INODES; return (error); } static int hammer2_vfs_uninit(struct vfsconf *vfsp __unused) { objcache_destroy(cache_buffer_read); objcache_destroy(cache_buffer_write); objcache_destroy(cache_xops); return 0; } /* * Core PFS allocator. Used to allocate or reference the pmp structure * for PFS cluster mounts and the spmp structure for media (hmp) structures. * The pmp can be passed in or loaded by this function using the chain and * inode data. * * pmp->modify_tid tracks new modify_tid transaction ids for front-end * transactions. Note that synchronization does not use this field. * (typically frontend operations and synchronization cannot run on the * same PFS node at the same time). * * XXX check locking */ hammer2_pfs_t * hammer2_pfsalloc(hammer2_chain_t *chain, const hammer2_inode_data_t *ripdata, hammer2_tid_t modify_tid, hammer2_dev_t *force_local) { hammer2_pfs_t *pmp; hammer2_inode_t *iroot; int count; int i; int j; pmp = NULL; /* * Locate or create the PFS based on the cluster id. If ripdata * is NULL this is a spmp which is unique and is always allocated. * * If the device is mounted in local mode all PFSs are considered * independent and not part of any cluster (for debugging only). */ if (ripdata) { TAILQ_FOREACH(pmp, &hammer2_pfslist, mntentry) { if (force_local != pmp->force_local) continue; if (force_local == NULL && bcmp(&pmp->pfs_clid, &ripdata->meta.pfs_clid, sizeof(pmp->pfs_clid)) == 0) { break; } else if (force_local && pmp->pfs_names[0] && strcmp(pmp->pfs_names[0], ripdata->filename) == 0) { break; } } } if (pmp == NULL) { pmp = kmalloc(sizeof(*pmp), M_HAMMER2, M_WAITOK | M_ZERO); pmp->force_local = force_local; hammer2_trans_manage_init(pmp); kmalloc_create_obj(&pmp->minode, "HAMMER2-inodes", sizeof(struct hammer2_inode)); lockinit(&pmp->lock, "pfslk", 0, 0); spin_init(&pmp->inum_spin, "hm2pfsalloc_inum"); spin_init(&pmp->xop_spin, "h2xop"); spin_init(&pmp->lru_spin, "h2lru"); RB_INIT(&pmp->inum_tree); TAILQ_INIT(&pmp->syncq); TAILQ_INIT(&pmp->depq); TAILQ_INIT(&pmp->lru_list); spin_init(&pmp->list_spin, "h2pfsalloc_list"); /* * Save the last media transaction id for the flusher. Set * initial */ if (ripdata) { pmp->pfs_clid = ripdata->meta.pfs_clid; TAILQ_INSERT_TAIL(&hammer2_pfslist, pmp, mntentry); } else { pmp->flags |= HAMMER2_PMPF_SPMP; TAILQ_INSERT_TAIL(&hammer2_spmplist, pmp, mntentry); } /* * The synchronization thread may start too early, make * sure it stays frozen until we are ready to let it go. * XXX */ /* pmp->primary_thr.flags = HAMMER2_THREAD_FROZEN | HAMMER2_THREAD_REMASTER; */ } /* * Create the PFS's root inode and any missing XOP helper threads. */ if ((iroot = pmp->iroot) == NULL) { iroot = hammer2_inode_get(pmp, NULL, 1, -1); if (ripdata) iroot->meta = ripdata->meta; pmp->iroot = iroot; hammer2_inode_ref(iroot); hammer2_inode_unlock(iroot); } /* * Stop here if no chain is passed in. */ if (chain == NULL) goto done; /* * When a chain is passed in we must add it to the PFS's root * inode, update pmp->pfs_types[], and update the syncronization * threads. * * When forcing local mode, mark the PFS as a MASTER regardless. * * At the moment empty spots can develop due to removals or failures. * Ultimately we want to re-fill these spots but doing so might * confused running code. XXX */ hammer2_inode_ref(iroot); hammer2_mtx_ex(&iroot->lock); j = iroot->cluster.nchains; if (j == HAMMER2_MAXCLUSTER) { kprintf("hammer2_pfsalloc: cluster full!\n"); /* XXX fatal error? */ } else { KKASSERT(chain->pmp == NULL); chain->pmp = pmp; hammer2_chain_ref(chain); iroot->cluster.array[j].chain = chain; if (force_local) pmp->pfs_types[j] = HAMMER2_PFSTYPE_MASTER; else pmp->pfs_types[j] = ripdata->meta.pfs_type; pmp->pfs_names[j] = kstrdup(ripdata->filename, M_HAMMER2); pmp->pfs_hmps[j] = chain->hmp; hammer2_spin_ex(&pmp->inum_spin); pmp->pfs_iroot_blocksets[j] = chain->data->ipdata.u.blockset; hammer2_spin_unex(&pmp->inum_spin); /* * If the PFS is already mounted we must account * for the mount_count here. */ if (pmp->mp) ++chain->hmp->mount_count; /* * May have to fixup dirty chain tracking. Previous * pmp was NULL so nothing to undo. */ if (chain->flags & HAMMER2_CHAIN_MODIFIED) hammer2_pfs_memory_inc(pmp); ++j; } iroot->cluster.nchains = j; /* * Update nmasters from any PFS inode which is part of the cluster. * It is possible that this will result in a value which is too * high. MASTER PFSs are authoritative for pfs_nmasters and will * override this value later on. * * (This informs us of masters that might not currently be * discoverable by this mount). */ if (ripdata && pmp->pfs_nmasters < ripdata->meta.pfs_nmasters) { pmp->pfs_nmasters = ripdata->meta.pfs_nmasters; } /* * Count visible masters. Masters are usually added with * ripdata->meta.pfs_nmasters set to 1. This detects when there * are more (XXX and must update the master inodes). */ count = 0; for (i = 0; i < iroot->cluster.nchains; ++i) { if (pmp->pfs_types[i] == HAMMER2_PFSTYPE_MASTER) ++count; } if (pmp->pfs_nmasters < count) pmp->pfs_nmasters = count; /* * Create missing synchronization and support threads. * * Single-node masters (including snapshots) have nothing to * synchronize and do not require this thread. * * Multi-node masters or any number of soft masters, slaves, copy, * or other PFS types need the thread. * * Each thread is responsible for its particular cluster index. * We use independent threads so stalls or mismatches related to * any given target do not affect other targets. */ for (i = 0; i < iroot->cluster.nchains; ++i) { /* * Single-node masters (including snapshots) have nothing * to synchronize and will make direct xops support calls, * thus they do not require this thread. * * Note that there can be thousands of snapshots. We do not * want to create thousands of threads. */ if (pmp->pfs_nmasters <= 1 && pmp->pfs_types[i] == HAMMER2_PFSTYPE_MASTER) { continue; } /* * Sync support thread */ if (pmp->sync_thrs[i].td == NULL) { hammer2_thr_create(&pmp->sync_thrs[i], pmp, NULL, "h2nod", i, -1, hammer2_primary_sync_thread); } } /* * Create missing Xop threads * * NOTE: We create helper threads for all mounted PFSs or any * PFSs with 2+ nodes (so the sync thread can update them, * even if not mounted). */ if (pmp->mp || iroot->cluster.nchains >= 2) hammer2_xop_helper_create(pmp); hammer2_mtx_unlock(&iroot->lock); hammer2_inode_drop(iroot); done: return pmp; } /* * Deallocate an element of a probed PFS. If destroying and this is a * MASTER, adjust nmasters. * * This function does not physically destroy the PFS element in its device * under the super-root (see hammer2_ioctl_pfs_delete()). */ void hammer2_pfsdealloc(hammer2_pfs_t *pmp, int clindex, int destroying) { hammer2_inode_t *iroot; hammer2_chain_t *chain; int j; /* * Cleanup our reference on iroot. iroot is (should) not be needed * by the flush code. */ iroot = pmp->iroot; if (iroot) { /* * Stop synchronizing * * XXX flush after acquiring the iroot lock. * XXX clean out the cluster index from all inode structures. */ hammer2_thr_delete(&pmp->sync_thrs[clindex]); /* * Remove the cluster index from the group. If destroying * the PFS and this is a master, adjust pfs_nmasters. */ hammer2_mtx_ex(&iroot->lock); chain = iroot->cluster.array[clindex].chain; iroot->cluster.array[clindex].chain = NULL; switch(pmp->pfs_types[clindex]) { case HAMMER2_PFSTYPE_MASTER: if (destroying && pmp->pfs_nmasters > 0) --pmp->pfs_nmasters; /* XXX adjust ripdata->meta.pfs_nmasters */ break; default: break; } pmp->pfs_types[clindex] = HAMMER2_PFSTYPE_NONE; hammer2_mtx_unlock(&iroot->lock); /* * Release the chain. */ if (chain) { atomic_set_int(&chain->flags, HAMMER2_CHAIN_RELEASE); hammer2_chain_drop(chain); } /* * Terminate all XOP threads for the cluster index. */ if (pmp->xop_groups) { for (j = 0; j < hammer2_xop_nthreads; ++j) { hammer2_thr_delete( &pmp->xop_groups[j].thrs[clindex]); } } } } /* * Destroy a PFS, typically only occurs after the last mount on a device * has gone away. */ static void hammer2_pfsfree(hammer2_pfs_t *pmp) { hammer2_inode_t *iroot; hammer2_chain_t *chain; int chains_still_present = 0; int i; int j; /* * Cleanup our reference on iroot. iroot is (should) not be needed * by the flush code. */ if (pmp->flags & HAMMER2_PMPF_SPMP) TAILQ_REMOVE(&hammer2_spmplist, pmp, mntentry); else TAILQ_REMOVE(&hammer2_pfslist, pmp, mntentry); /* * Cleanup chains remaining on LRU list. */ hammer2_spin_ex(&pmp->lru_spin); while ((chain = TAILQ_FIRST(&pmp->lru_list)) != NULL) { KKASSERT(chain->flags & HAMMER2_CHAIN_ONLRU); atomic_add_int(&pmp->lru_count, -1); atomic_clear_int(&chain->flags, HAMMER2_CHAIN_ONLRU); TAILQ_REMOVE(&pmp->lru_list, chain, lru_node); hammer2_chain_ref(chain); hammer2_spin_unex(&pmp->lru_spin); atomic_set_int(&chain->flags, HAMMER2_CHAIN_RELEASE); hammer2_chain_drop(chain); hammer2_spin_ex(&pmp->lru_spin); } hammer2_spin_unex(&pmp->lru_spin); /* * Clean up iroot */ iroot = pmp->iroot; if (iroot) { for (i = 0; i < iroot->cluster.nchains; ++i) { hammer2_thr_delete(&pmp->sync_thrs[i]); if (pmp->xop_groups) { for (j = 0; j < hammer2_xop_nthreads; ++j) hammer2_thr_delete( &pmp->xop_groups[j].thrs[i]); } chain = iroot->cluster.array[i].chain; if (chain && !RB_EMPTY(&chain->core.rbtree)) { kprintf("hammer2: Warning pmp %p still " "has active chains\n", pmp); chains_still_present = 1; } } KASSERT(iroot->refs == 1, ("PMP->IROOT %p REFS WRONG %d", iroot, iroot->refs)); /* ref for iroot */ hammer2_inode_drop(iroot); pmp->iroot = NULL; } /* * Free remaining pmp resources */ if (chains_still_present) { kprintf("hammer2: cannot free pmp %p, still in use\n", pmp); } else { kmalloc_destroy_obj(&pmp->minode); kfree(pmp, M_HAMMER2); } } /* * Remove all references to hmp from the pfs list. Any PFS which becomes * empty is terminated and freed. * * XXX inefficient. */ static void hammer2_pfsfree_scan(hammer2_dev_t *hmp, int which) { hammer2_pfs_t *pmp; hammer2_inode_t *iroot; hammer2_chain_t *rchain; int i; int j; struct hammer2_pfslist *wlist; if (which == 0) wlist = &hammer2_pfslist; else wlist = &hammer2_spmplist; again: TAILQ_FOREACH(pmp, wlist, mntentry) { if ((iroot = pmp->iroot) == NULL) continue; /* * Determine if this PFS is affected. If it is we must * freeze all management threads and lock its iroot. * * Freezing a management thread forces it idle, operations * in-progress will be aborted and it will have to start * over again when unfrozen, or exit if told to exit. */ for (i = 0; i < HAMMER2_MAXCLUSTER; ++i) { if (pmp->pfs_hmps[i] == hmp) break; } if (i == HAMMER2_MAXCLUSTER) continue; hammer2_vfs_sync_pmp(pmp, MNT_WAIT); /* * Make sure all synchronization threads are locked * down. */ for (i = 0; i < HAMMER2_MAXCLUSTER; ++i) { if (pmp->pfs_hmps[i] == NULL) continue; hammer2_thr_freeze_async(&pmp->sync_thrs[i]); if (pmp->xop_groups) { for (j = 0; j < hammer2_xop_nthreads; ++j) { hammer2_thr_freeze_async( &pmp->xop_groups[j].thrs[i]); } } } for (i = 0; i < HAMMER2_MAXCLUSTER; ++i) { if (pmp->pfs_hmps[i] == NULL) continue; hammer2_thr_freeze(&pmp->sync_thrs[i]); if (pmp->xop_groups) { for (j = 0; j < hammer2_xop_nthreads; ++j) { hammer2_thr_freeze( &pmp->xop_groups[j].thrs[i]); } } } /* * Lock the inode and clean out matching chains. * Note that we cannot use hammer2_inode_lock_*() * here because that would attempt to validate the * cluster that we are in the middle of ripping * apart. * * WARNING! We are working directly on the inodes * embedded cluster. */ hammer2_mtx_ex(&iroot->lock); /* * Remove the chain from matching elements of the PFS. */ for (i = 0; i < HAMMER2_MAXCLUSTER; ++i) { if (pmp->pfs_hmps[i] != hmp) continue; hammer2_thr_delete(&pmp->sync_thrs[i]); if (pmp->xop_groups) { for (j = 0; j < hammer2_xop_nthreads; ++j) { hammer2_thr_delete( &pmp->xop_groups[j].thrs[i]); } } rchain = iroot->cluster.array[i].chain; iroot->cluster.array[i].chain = NULL; pmp->pfs_types[i] = 0; if (pmp->pfs_names[i]) { kfree(pmp->pfs_names[i], M_HAMMER2); pmp->pfs_names[i] = NULL; } if (rchain) { hammer2_chain_drop(rchain); /* focus hint */ if (iroot->cluster.focus == rchain) iroot->cluster.focus = NULL; } pmp->pfs_hmps[i] = NULL; } hammer2_mtx_unlock(&iroot->lock); /* * Cleanup trailing chains. Gaps may remain. */ for (i = HAMMER2_MAXCLUSTER - 1; i >= 0; --i) { if (pmp->pfs_hmps[i]) break; } iroot->cluster.nchains = i + 1; /* * If the PMP has no elements remaining we can destroy it. * (this will transition management threads from frozen->exit). */ if (iroot->cluster.nchains == 0) { /* * If this was the hmp's spmp, we need to clean * a little more stuff out. */ if (hmp->spmp == pmp) { hmp->spmp = NULL; hmp->vchain.pmp = NULL; hmp->fchain.pmp = NULL; } /* * Free the pmp and restart the loop */ KKASSERT(TAILQ_EMPTY(&pmp->syncq)); KKASSERT(TAILQ_EMPTY(&pmp->depq)); hammer2_pfsfree(pmp); goto again; } /* * If elements still remain we need to set the REMASTER * flag and unfreeze it. */ for (i = 0; i < HAMMER2_MAXCLUSTER; ++i) { if (pmp->pfs_hmps[i] == NULL) continue; hammer2_thr_remaster(&pmp->sync_thrs[i]); hammer2_thr_unfreeze(&pmp->sync_thrs[i]); if (pmp->xop_groups) { for (j = 0; j < hammer2_xop_nthreads; ++j) { hammer2_thr_remaster( &pmp->xop_groups[j].thrs[i]); hammer2_thr_unfreeze( &pmp->xop_groups[j].thrs[i]); } } } } } /* * Mount or remount HAMMER2 fileystem from physical media * * mountroot * mp mount point structure * path NULL * data <unused> * cred <unused> * * mount * mp mount point structure * path path to mount point * data pointer to argument structure in user space * volume volume path (device@LABEL form) * hflags user mount flags * cred user credentials * * RETURNS: 0 Success * !0 error number */ static int hammer2_vfs_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred) { struct hammer2_mount_info info; hammer2_pfs_t *pmp; hammer2_pfs_t *spmp; hammer2_dev_t *hmp, *hmp_tmp; hammer2_dev_t *force_local; hammer2_key_t key_next; hammer2_key_t key_dummy; hammer2_key_t lhc; hammer2_chain_t *parent; hammer2_chain_t *chain; const hammer2_inode_data_t *ripdata; hammer2_blockref_t bref; hammer2_devvp_list_t devvpl; hammer2_devvp_t *e, *e_tmp; struct file *fp; char devstr[MNAMELEN]; size_t size; size_t done; char *dev; char *label; int ronly = ((mp->mnt_flag & MNT_RDONLY) != 0); int error; int i; hmp = NULL; pmp = NULL; dev = NULL; label = NULL; bzero(&info, sizeof(info)); if (path) { /* * Non-root mount or updating a mount */ error = copyin(data, &info, sizeof(info)); if (error) return (error); } if (mp->mnt_flag & MNT_UPDATE) { /* * Update mount. Note that pmp->iroot->cluster is * an inode-embedded cluster and thus cannot be * directly locked. * * XXX HAMMER2 needs to implement NFS export via * mountctl. */ hammer2_cluster_t *cluster; pmp = MPTOPMP(mp); pmp->hflags = info.hflags; cluster = &pmp->iroot->cluster; for (i = 0; i < cluster->nchains; ++i) { if (cluster->array[i].chain == NULL) continue; hmp = cluster->array[i].chain->hmp; error = hammer2_remount(hmp, mp, path, cred); if (error) break; } return error; } if (path == NULL) { /* * Root mount */ info.cluster_fd = -1; ksnprintf(devstr, sizeof(devstr), "%s", mp->mnt_stat.f_mntfromname); done = strlen(devstr) + 1; kprintf("hammer2_mount: root devstr=\"%s\"\n", devstr); } else { error = copyinstr(info.volume, devstr, MNAMELEN - 1, &done); if (error) return (error); kprintf("hammer2_mount: devstr=\"%s\"\n", devstr); } /* * Extract device and label, automatically mount @BOOT, @ROOT, or @DATA * if no label specified, based on the partition id. Error out if no * label or device (with partition id) is specified. This is strictly * a convenience to match the default label created by newfs_hammer2, * our preference is that a label always be specified. * * NOTE: We allow 'mount @LABEL <blah>'... that is, a mount command * that does not specify a device, as long as some H2 label * has already been mounted from that device. This makes * mounting snapshots a lot easier. */ dev = devstr; label = strchr(devstr, '@'); if (label && ((label + 1) - dev) > done) { kprintf("hammer2_mount: bad label %s/%zd\n", devstr, done); return (EINVAL); } if (label == NULL || label[1] == 0) { char slice; if (label == NULL) label = devstr + strlen(devstr); else *label = '\0'; /* clean up trailing @ */ slice = label[-1]; switch(slice) { case 'a': label = "BOOT"; break; case 'd': label = "ROOT"; break; default: label = "DATA"; break; } } else { *label = '\0'; label++; } kprintf("hammer2_mount: dev=\"%s\" label=\"%s\" rdonly=%d\n", dev, label, ronly); /* * Initialize all device vnodes. */ TAILQ_INIT(&devvpl); error = hammer2_init_devvp(dev, path == NULL, &devvpl); if (error) { kprintf("hammer2: failed to initialize devvp in %s\n", dev); hammer2_cleanup_devvp(&devvpl); return error; } /* * Determine if the device has already been mounted. After this * check hmp will be non-NULL if we are doing the second or more * hammer2 mounts from the same device. */ lockmgr(&hammer2_mntlk, LK_EXCLUSIVE); if (!TAILQ_EMPTY(&devvpl)) { /* * Match the device. Due to the way devfs works, * we may not be able to directly match the vnode pointer, * so also check to see if the underlying device matches. */ TAILQ_FOREACH(hmp_tmp, &hammer2_mntlist, mntentry) { TAILQ_FOREACH(e_tmp, &hmp_tmp->devvpl, entry) { int devvp_found = 0; TAILQ_FOREACH(e, &devvpl, entry) { KKASSERT(e->devvp); if (e_tmp->devvp == e->devvp) devvp_found = 1; if (e_tmp->devvp->v_rdev && e_tmp->devvp->v_rdev == e->devvp->v_rdev) devvp_found = 1; } if (!devvp_found) goto next_hmp; } hmp = hmp_tmp; kprintf("hammer2_mount: hmp=%p matched\n", hmp); break; next_hmp: continue; } /* * If no match this may be a fresh H2 mount, make sure * the device is not mounted on anything else. */ if (hmp == NULL) { TAILQ_FOREACH(e, &devvpl, entry) { struct vnode *devvp = e->devvp; KKASSERT(devvp); error = vfs_mountedon(devvp); if (error) { kprintf("hammer2_mount: %s mounted %d\n", e->path, error); hammer2_cleanup_devvp(&devvpl); lockmgr(&hammer2_mntlk, LK_RELEASE); return error; } } } } else { /* * Match the label to a pmp already probed. */ TAILQ_FOREACH(pmp, &hammer2_pfslist, mntentry) { for (i = 0; i < HAMMER2_MAXCLUSTER; ++i) { if (pmp->pfs_names[i] && strcmp(pmp->pfs_names[i], label) == 0) { hmp = pmp->pfs_hmps[i]; break; } } if (hmp) break; } if (hmp == NULL) { kprintf("hammer2_mount: PFS label \"%s\" not found\n", label); hammer2_cleanup_devvp(&devvpl); lockmgr(&hammer2_mntlk, LK_RELEASE); return ENOENT; } } /* * Open the device if this isn't a secondary mount and construct * the H2 device mount (hmp). */ if (hmp == NULL) { hammer2_chain_t *schain; hammer2_xop_head_t xop; /* * Now open the device */ KKASSERT(!TAILQ_EMPTY(&devvpl)); if (error == 0) { error = hammer2_open_devvp(&devvpl, ronly); if (error) { hammer2_close_devvp(&devvpl, ronly); hammer2_cleanup_devvp(&devvpl); lockmgr(&hammer2_mntlk, LK_RELEASE); return error; } } /* * Construct volumes and link with device vnodes. */ hmp = kmalloc(sizeof(*hmp), M_HAMMER2, M_WAITOK | M_ZERO); hmp->devvp = NULL; error = hammer2_init_volumes(mp, &devvpl, hmp->volumes, &hmp->voldata, &hmp->volhdrno, &hmp->devvp); if (error) { hammer2_close_devvp(&devvpl, ronly); hammer2_cleanup_devvp(&devvpl); lockmgr(&hammer2_mntlk, LK_RELEASE); kfree(hmp, M_HAMMER2); return error; } if (!hmp->devvp) { kprintf("hammer2: failed to initialize root volume\n"); hammer2_unmount_helper(mp, NULL, hmp); lockmgr(&hammer2_mntlk, LK_RELEASE); hammer2_vfs_unmount(mp, MNT_FORCE); return EINVAL; } ksnprintf(hmp->devrepname, sizeof(hmp->devrepname), "%s", dev); hmp->ronly = ronly; hmp->hflags = info.hflags & HMNT2_DEVFLAGS; kmalloc_create_obj(&hmp->mchain, "HAMMER2-chains", sizeof(struct hammer2_chain)); kmalloc_create_obj(&hmp->mio, "HAMMER2-dio", sizeof(struct hammer2_io)); kmalloc_create(&hmp->mmsg, "HAMMER2-msg"); TAILQ_INSERT_TAIL(&hammer2_mntlist, hmp, mntentry); RB_INIT(&hmp->iotree); spin_init(&hmp->io_spin, "h2mount_io"); spin_init(&hmp->list_spin, "h2mount_list"); lockinit(&hmp->vollk, "h2vol", 0, 0); lockinit(&hmp->bulklk, "h2bulk", 0, 0); lockinit(&hmp->bflock, "h2bflk", 0, 0); /* * vchain setup. vchain.data is embedded. * vchain.refs is initialized and will never drop to 0. * * NOTE! voldata is not yet loaded. */ hmp->vchain.hmp = hmp; hmp->vchain.refs = 1; hmp->vchain.data = (void *)&hmp->voldata; hmp->vchain.bref.type = HAMMER2_BREF_TYPE_VOLUME; hmp->vchain.bref.data_off = 0 | HAMMER2_PBUFRADIX; hmp->vchain.bref.mirror_tid = hmp->voldata.mirror_tid; hammer2_chain_core_init(&hmp->vchain); /* * fchain setup. fchain.data is embedded. * fchain.refs is initialized and will never drop to 0. * * The data is not used but needs to be initialized to * pass assertion muster. We use this chain primarily * as a placeholder for the freemap's top-level radix tree * so it does not interfere with the volume's topology * radix tree. */ hmp->fchain.hmp = hmp; hmp->fchain.refs = 1; hmp->fchain.data = (void *)&hmp->voldata.freemap_blockset; hmp->fchain.bref.type = HAMMER2_BREF_TYPE_FREEMAP; hmp->fchain.bref.data_off = 0 | HAMMER2_PBUFRADIX; hmp->fchain.bref.mirror_tid = hmp->voldata.freemap_tid; hmp->fchain.bref.methods = HAMMER2_ENC_CHECK(HAMMER2_CHECK_FREEMAP) | HAMMER2_ENC_COMP(HAMMER2_COMP_NONE); hammer2_chain_core_init(&hmp->fchain); /* * Initialize volume header related fields. */ KKASSERT(hmp->voldata.magic == HAMMER2_VOLUME_ID_HBO || hmp->voldata.magic == HAMMER2_VOLUME_ID_ABO); hmp->volsync = hmp->voldata; hmp->free_reserved = hmp->voldata.allocator_size / 20; /* * Must use hmp instead of volume header for these two * in order to handle volume versions transparently. */ if (hmp->voldata.version >= HAMMER2_VOL_VERSION_MULTI_VOLUMES) { hmp->nvolumes = hmp->voldata.nvolumes; hmp->total_size = hmp->voldata.total_size; } else { hmp->nvolumes = 1; hmp->total_size = hmp->voldata.volu_size; } KKASSERT(hmp->nvolumes > 0); /* * Move devvpl entries to hmp. */ TAILQ_INIT(&hmp->devvpl); while ((e = TAILQ_FIRST(&devvpl)) != NULL) { TAILQ_REMOVE(&devvpl, e, entry); TAILQ_INSERT_TAIL(&hmp->devvpl, e, entry); } KKASSERT(TAILQ_EMPTY(&devvpl)); KKASSERT(!TAILQ_EMPTY(&hmp->devvpl)); /* * Really important to get these right or the flush and * teardown code will get confused. */ hmp->spmp = hammer2_pfsalloc(NULL, NULL, 0, NULL); spmp = hmp->spmp; spmp->pfs_hmps[0] = hmp; /* * Dummy-up vchain and fchain's modify_tid. mirror_tid * is inherited from the volume header. */ hmp->vchain.bref.mirror_tid = hmp->voldata.mirror_tid; hmp->vchain.bref.modify_tid = hmp->vchain.bref.mirror_tid; hmp->vchain.pmp = spmp; hmp->fchain.bref.mirror_tid = hmp->voldata.freemap_tid; hmp->fchain.bref.modify_tid = hmp->fchain.bref.mirror_tid; hmp->fchain.pmp = spmp; /* * First locate the super-root inode, which is key 0 * relative to the volume header's blockset. * * Then locate the root inode by scanning the directory keyspace * represented by the label. */ parent = hammer2_chain_lookup_init(&hmp->vchain, 0); schain = hammer2_chain_lookup(&parent, &key_dummy, HAMMER2_SROOT_KEY, HAMMER2_SROOT_KEY, &error, 0); hammer2_chain_lookup_done(parent); if (schain == NULL) { kprintf("hammer2_mount: invalid super-root\n"); hammer2_unmount_helper(mp, NULL, hmp); lockmgr(&hammer2_mntlk, LK_RELEASE); hammer2_vfs_unmount(mp, MNT_FORCE); return EINVAL; } if (schain->error) { kprintf("hammer2_mount: error %s reading super-root\n", hammer2_error_str(schain->error)); hammer2_chain_unlock(schain); hammer2_chain_drop(schain); schain = NULL; hammer2_unmount_helper(mp, NULL, hmp); lockmgr(&hammer2_mntlk, LK_RELEASE); hammer2_vfs_unmount(mp, MNT_FORCE); return EINVAL; } /* * The super-root always uses an inode_tid of 1 when * creating PFSs. */ spmp->inode_tid = 1; spmp->modify_tid = schain->bref.modify_tid + 1; /* * Sanity-check schain's pmp and finish initialization. * Any chain belonging to the super-root topology should * have a NULL pmp (not even set to spmp). */ ripdata = &schain->data->ipdata; KKASSERT(schain->pmp == NULL); spmp->pfs_clid = ripdata->meta.pfs_clid; /* * Replace the dummy spmp->iroot with a real one. It's * easier to just do a wholesale replacement than to try * to update the chain and fixup the iroot fields. * * The returned inode is locked with the supplied cluster. */ hammer2_dummy_xop_from_chain(&xop, schain); hammer2_inode_drop(spmp->iroot); spmp->iroot = NULL; spmp->iroot = hammer2_inode_get(spmp, &xop, -1, -1); spmp->spmp_hmp = hmp; spmp->pfs_types[0] = ripdata->meta.pfs_type; spmp->pfs_hmps[0] = hmp; hammer2_inode_ref(spmp->iroot); hammer2_inode_unlock(spmp->iroot); hammer2_cluster_unlock(&xop.cluster); hammer2_chain_drop(schain); /* do not call hammer2_cluster_drop() on an embedded cluster */ schain = NULL; /* now invalid */ /* leave spmp->iroot with one ref */ if (!hmp->ronly) { error = hammer2_recovery(hmp); if (error == 0) error |= hammer2_fixup_pfses(hmp); /* XXX do something with error */ } hammer2_update_pmps(hmp); hammer2_iocom_init(hmp); hammer2_bulkfree_init(hmp); /* * Ref the cluster management messaging descriptor. The mount * program deals with the other end of the communications pipe. * * Root mounts typically do not supply one. */ if (info.cluster_fd >= 0) { fp = holdfp(curthread, info.cluster_fd, -1); if (fp) { hammer2_cluster_reconnect(hmp, fp); } else { kprintf("hammer2_mount: bad cluster_fd!\n"); } } } else { spmp = hmp->spmp; if (info.hflags & HMNT2_DEVFLAGS) { kprintf("hammer2_mount: Warning: mount flags pertaining " "to the whole device may only be specified " "on the first mount of the device: %08x\n", info.hflags & HMNT2_DEVFLAGS); } } /* * Force local mount (disassociate all PFSs from their clusters). * Used primarily for debugging. */ force_local = (hmp->hflags & HMNT2_LOCAL) ? hmp : NULL; /* * Lookup the mount point under the media-localized super-root. * Scanning hammer2_pfslist doesn't help us because it represents * PFS cluster ids which can aggregate several named PFSs together. * * cluster->pmp will incorrectly point to spmp and must be fixed * up later on. */ hammer2_inode_lock(spmp->iroot, 0); parent = hammer2_inode_chain(spmp->iroot, 0, HAMMER2_RESOLVE_ALWAYS); lhc = hammer2_dirhash(label, strlen(label)); chain = hammer2_chain_lookup(&parent, &key_next, lhc, lhc + HAMMER2_DIRHASH_LOMASK, &error, 0); while (chain) { if (chain->bref.type == HAMMER2_BREF_TYPE_INODE && strcmp(label, chain->data->ipdata.filename) == 0) { break; } chain = hammer2_chain_next(&parent, chain, &key_next, key_next, lhc + HAMMER2_DIRHASH_LOMASK, &error, 0); } if (parent) { hammer2_chain_unlock(parent); hammer2_chain_drop(parent); } hammer2_inode_unlock(spmp->iroot); /* * PFS could not be found? */ if (chain == NULL) { hammer2_unmount_helper(mp, NULL, hmp); lockmgr(&hammer2_mntlk, LK_RELEASE); hammer2_vfs_unmount(mp, MNT_FORCE); if (error) { kprintf("hammer2_mount: PFS label I/O error\n"); return EINVAL; } else { kprintf("hammer2_mount: PFS label \"%s\" not found\n", label); return ENOENT; } } /* * Acquire the pmp structure (it should have already been allocated * via hammer2_update_pmps() so do not pass cluster in to add to * available chains). * * Check if the cluster has already been mounted. A cluster can * only be mounted once, use null mounts to mount additional copies. */ if (chain->error) { kprintf("hammer2_mount: PFS label I/O error\n"); } else { ripdata = &chain->data->ipdata; bref = chain->bref; pmp = hammer2_pfsalloc(NULL, ripdata, bref.modify_tid, force_local); } hammer2_chain_unlock(chain); hammer2_chain_drop(chain); /* * Finish the mount */ kprintf("hammer2_mount: hmp=%p pmp=%p\n", hmp, pmp); if (pmp->mp) { kprintf("hammer2_mount: PFS already mounted!\n"); hammer2_unmount_helper(mp, NULL, hmp); lockmgr(&hammer2_mntlk, LK_RELEASE); hammer2_vfs_unmount(mp, MNT_FORCE); return EBUSY; } pmp->hflags = info.hflags; mp->mnt_flag |= MNT_LOCAL; mp->mnt_kern_flag |= MNTK_ALL_MPSAFE; /* all entry pts are SMP */ mp->mnt_kern_flag |= MNTK_THR_SYNC; /* new vsyncscan semantics */ /* * required mount structure initializations */ mp->mnt_stat.f_iosize = HAMMER2_PBUFSIZE; mp->mnt_stat.f_bsize = HAMMER2_PBUFSIZE; mp->mnt_vstat.f_frsize = HAMMER2_PBUFSIZE; mp->mnt_vstat.f_bsize = HAMMER2_PBUFSIZE; /* * Optional fields */ mp->mnt_iosize_max = MAXPHYS; /* * Connect up mount pointers. */ hammer2_mount_helper(mp, pmp); lockmgr(&hammer2_mntlk, LK_RELEASE); /* * Finish setup */ vfs_getnewfsid(mp); vfs_add_vnodeops(mp, &hammer2_vnode_vops, &mp->mnt_vn_norm_ops); vfs_add_vnodeops(mp, &hammer2_spec_vops, &mp->mnt_vn_spec_ops); vfs_add_vnodeops(mp, &hammer2_fifo_vops, &mp->mnt_vn_fifo_ops); if (path) { copyinstr(info.volume, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &size); bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size); } /* else root mount, already in there */ bzero(mp->mnt_stat.f_mntonname, sizeof(mp->mnt_stat.f_mntonname)); if (path) { copyinstr(path, mp->mnt_stat.f_mntonname, sizeof(mp->mnt_stat.f_mntonname) - 1, &size); } else { /* root mount */ mp->mnt_stat.f_mntonname[0] = '/'; } /* * Initial statfs to prime mnt_stat. */ hammer2_vfs_statfs(mp, &mp->mnt_stat, cred); return 0; } /* * Scan PFSs under the super-root and create hammer2_pfs structures. */ static void hammer2_update_pmps(hammer2_dev_t *hmp) { const hammer2_inode_data_t *ripdata; hammer2_chain_t *parent; hammer2_chain_t *chain; hammer2_blockref_t bref; hammer2_dev_t *force_local; hammer2_pfs_t *spmp; hammer2_pfs_t *pmp; hammer2_key_t key_next; int error; /* * Force local mount (disassociate all PFSs from their clusters). * Used primarily for debugging. */ force_local = (hmp->hflags & HMNT2_LOCAL) ? hmp : NULL; /* * Lookup mount point under the media-localized super-root. * * cluster->pmp will incorrectly point to spmp and must be fixed * up later on. */ spmp = hmp->spmp; hammer2_inode_lock(spmp->iroot, 0); parent = hammer2_inode_chain(spmp->iroot, 0, HAMMER2_RESOLVE_ALWAYS); chain = hammer2_chain_lookup(&parent, &key_next, HAMMER2_KEY_MIN, HAMMER2_KEY_MAX, &error, 0); while (chain) { if (chain->error) { kprintf("I/O error scanning PFS labels\n"); } else if (chain->bref.type != HAMMER2_BREF_TYPE_INODE) { kprintf("Non inode chain type %d under super-root\n", chain->bref.type); } else { ripdata = &chain->data->ipdata; bref = chain->bref; pmp = hammer2_pfsalloc(chain, ripdata, bref.modify_tid, force_local); } chain = hammer2_chain_next(&parent, chain, &key_next, key_next, HAMMER2_KEY_MAX, &error, 0); } if (parent) { hammer2_chain_unlock(parent); hammer2_chain_drop(parent); } hammer2_inode_unlock(spmp->iroot); } static int hammer2_remount(hammer2_dev_t *hmp, struct mount *mp, char *path __unused, struct ucred *cred) { hammer2_volume_t *vol; struct vnode *devvp; int i, error, result = 0; if (!(hmp->ronly && (mp->mnt_kern_flag & MNTK_WANTRDWR))) return 0; for (i = 0; i < hmp->nvolumes; ++i) { vol = &hmp->volumes[i]; devvp = vol->dev->devvp; KKASSERT(devvp); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); VOP_OPEN(devvp, FREAD | FWRITE, FSCRED, NULL); vn_unlock(devvp); error = 0; if (vol->id == HAMMER2_ROOT_VOLUME) { error = hammer2_recovery(hmp); if (error == 0) error |= hammer2_fixup_pfses(hmp); } vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); if (error == 0) { VOP_CLOSE(devvp, FREAD, NULL); } else { VOP_CLOSE(devvp, FREAD | FWRITE, NULL); } vn_unlock(devvp); result |= error; } if (result == 0) { kprintf("hammer2: enable read/write\n"); hmp->ronly = 0; } return result; } static int hammer2_vfs_unmount(struct mount *mp, int mntflags) { hammer2_pfs_t *pmp; int flags; int error = 0; pmp = MPTOPMP(mp); if (pmp == NULL) return(0); lockmgr(&hammer2_mntlk, LK_EXCLUSIVE); /* * If mount initialization proceeded far enough we must flush * its vnodes and sync the underlying mount points. Three syncs * are required to fully flush the filesystem (freemap updates lag * by one flush, and one extra for safety). */ if (mntflags & MNT_FORCE) flags = FORCECLOSE; else flags = 0; if (pmp->iroot) { error = vflush(mp, 0, flags); if (error) goto failed; hammer2_vfs_sync(mp, MNT_WAIT); hammer2_vfs_sync(mp, MNT_WAIT); hammer2_vfs_sync(mp, MNT_WAIT); } /* * Cleanup the frontend support XOPS threads */ hammer2_xop_helper_cleanup(pmp); if (pmp->mp) hammer2_unmount_helper(mp, pmp, NULL); error = 0; failed: lockmgr(&hammer2_mntlk, LK_RELEASE); return (error); } /* * Mount helper, hook the system mount into our PFS. * The mount lock is held. * * We must bump the mount_count on related devices for any * mounted PFSs. */ static void hammer2_mount_helper(struct mount *mp, hammer2_pfs_t *pmp) { hammer2_cluster_t *cluster; hammer2_chain_t *rchain; int i; mp->mnt_data = (qaddr_t)pmp; pmp->mp = mp; /* * After pmp->mp is set we have to adjust hmp->mount_count. */ cluster = &pmp->iroot->cluster; for (i = 0; i < cluster->nchains; ++i) { rchain = cluster->array[i].chain; if (rchain == NULL) continue; ++rchain->hmp->mount_count; } /* * Create missing Xop threads */ hammer2_xop_helper_create(pmp); } /* * Mount helper, unhook the system mount from our PFS. * The mount lock is held. * * If hmp is supplied a mount responsible for being the first to open * the block device failed and the block device and all PFSs using the * block device must be cleaned up. * * If pmp is supplied multiple devices might be backing the PFS and each * must be disconnected. This might not be the last PFS using some of the * underlying devices. Also, we have to adjust our hmp->mount_count * accounting for the devices backing the pmp which is now undergoing an * unmount. */ static void hammer2_unmount_helper(struct mount *mp, hammer2_pfs_t *pmp, hammer2_dev_t *hmp) { hammer2_cluster_t *cluster; hammer2_chain_t *rchain; int dumpcnt; int i; /* * If no device supplied this is a high-level unmount and we have to * to disconnect the mount, adjust mount_count, and locate devices * that might now have no mounts. */ if (pmp) { KKASSERT(hmp == NULL); KKASSERT(MPTOPMP(mp) == pmp); pmp->mp = NULL; mp->mnt_data = NULL; /* * After pmp->mp is cleared we have to account for * mount_count. */ cluster = &pmp->iroot->cluster; for (i = 0; i < cluster->nchains; ++i) { rchain = cluster->array[i].chain; if (rchain == NULL) continue; --rchain->hmp->mount_count; /* scrapping hmp now may invalidate the pmp */ } again: TAILQ_FOREACH(hmp, &hammer2_mntlist, mntentry) { if (hmp->mount_count == 0) { hammer2_unmount_helper(NULL, NULL, hmp); goto again; } } return; } /* * Try to terminate the block device. We can't terminate it if * there are still PFSs referencing it. */ if (hmp->mount_count) return; /* * Decomission the network before we start messing with the * device and PFS. */ hammer2_iocom_uninit(hmp); hammer2_bulkfree_uninit(hmp); hammer2_pfsfree_scan(hmp, 0); /* * Cycle the volume data lock as a safety (probably not needed any * more). To ensure everything is out we need to flush at least * three times. (1) The running of the sideq can dirty the * filesystem, (2) A normal flush can dirty the freemap, and * (3) ensure that the freemap is fully synchronized. * * The next mount's recovery scan can clean everything up but we want * to leave the filesystem in a 100% clean state on a normal unmount. */ #if 0 hammer2_voldata_lock(hmp); hammer2_voldata_unlock(hmp); #endif /* * Flush whatever is left. Unmounted but modified PFS's might still * have some dirty chains on them. */ hammer2_chain_lock(&hmp->vchain, HAMMER2_RESOLVE_ALWAYS); hammer2_chain_lock(&hmp->fchain, HAMMER2_RESOLVE_ALWAYS); if (hmp->fchain.flags & HAMMER2_CHAIN_FLUSH_MASK) { hammer2_voldata_modify(hmp); hammer2_flush(&hmp->fchain, HAMMER2_FLUSH_TOP | HAMMER2_FLUSH_ALL); } hammer2_chain_unlock(&hmp->fchain); if (hmp->vchain.flags & HAMMER2_CHAIN_FLUSH_MASK) { hammer2_flush(&hmp->vchain, HAMMER2_FLUSH_TOP | HAMMER2_FLUSH_ALL); } hammer2_chain_unlock(&hmp->vchain); if ((hmp->vchain.flags | hmp->fchain.flags) & HAMMER2_CHAIN_FLUSH_MASK) { kprintf("hammer2_unmount: chains left over after final sync\n"); kprintf(" vchain %08x\n", hmp->vchain.flags); kprintf(" fchain %08x\n", hmp->fchain.flags); if (hammer2_debug & 0x0010) Debugger("entered debugger"); } hammer2_pfsfree_scan(hmp, 1); KKASSERT(hmp->spmp == NULL); /* * Finish up with the device vnode */ if (!TAILQ_EMPTY(&hmp->devvpl)) { hammer2_close_devvp(&hmp->devvpl, hmp->ronly); hammer2_cleanup_devvp(&hmp->devvpl); } KKASSERT(TAILQ_EMPTY(&hmp->devvpl)); /* * Clear vchain/fchain flags that might prevent final cleanup * of these chains. */ if (hmp->vchain.flags & HAMMER2_CHAIN_MODIFIED) { atomic_add_long(&hammer2_count_modified_chains, -1); atomic_clear_int(&hmp->vchain.flags, HAMMER2_CHAIN_MODIFIED); hammer2_pfs_memory_wakeup(hmp->vchain.pmp, -1); } if (hmp->vchain.flags & HAMMER2_CHAIN_UPDATE) { atomic_clear_int(&hmp->vchain.flags, HAMMER2_CHAIN_UPDATE); } if (hmp->fchain.flags & HAMMER2_CHAIN_MODIFIED) { atomic_add_long(&hammer2_count_modified_chains, -1); atomic_clear_int(&hmp->fchain.flags, HAMMER2_CHAIN_MODIFIED); hammer2_pfs_memory_wakeup(hmp->fchain.pmp, -1); } if (hmp->fchain.flags & HAMMER2_CHAIN_UPDATE) { atomic_clear_int(&hmp->fchain.flags, HAMMER2_CHAIN_UPDATE); } /* * Final drop of embedded freemap root chain to * clean up fchain.core (fchain structure is not * flagged ALLOCATED so it is cleaned out and then * left to rot). */ hammer2_chain_drop(&hmp->fchain); /* * Final drop of embedded volume root chain to clean * up vchain.core (vchain structure is not flagged * ALLOCATED so it is cleaned out and then left to * rot). */ dumpcnt = 50; hammer2_dump_chain(&hmp->vchain, 0, 0, &dumpcnt, 'v', (u_int)-1); dumpcnt = 50; hammer2_dump_chain(&hmp->fchain, 0, 0, &dumpcnt, 'f', (u_int)-1); hammer2_chain_drop(&hmp->vchain); hammer2_io_cleanup(hmp, &hmp->iotree); if (hmp->iofree_count) { kprintf("io_cleanup: %d I/O's left hanging\n", hmp->iofree_count); } TAILQ_REMOVE(&hammer2_mntlist, hmp, mntentry); kmalloc_destroy_obj(&hmp->mchain); kmalloc_destroy_obj(&hmp->mio); kmalloc_destroy(&hmp->mmsg); kfree(hmp, M_HAMMER2); } int hammer2_vfs_vget(struct mount *mp, struct vnode *dvp, ino_t ino, struct vnode **vpp) { hammer2_xop_lookup_t *xop; hammer2_pfs_t *pmp; hammer2_inode_t *ip; hammer2_tid_t inum; int error; inum = (hammer2_tid_t)ino & HAMMER2_DIRHASH_USERMSK; error = 0; pmp = MPTOPMP(mp); /* * Easy if we already have it cached */ ip = hammer2_inode_lookup(pmp, inum); if (ip) { hammer2_inode_lock(ip, HAMMER2_RESOLVE_SHARED); *vpp = hammer2_igetv(ip, &error); hammer2_inode_unlock(ip); hammer2_inode_drop(ip); /* from lookup */ return error; } /* * Otherwise we have to find the inode */ xop = hammer2_xop_alloc(pmp->iroot, 0); xop->lhc = inum; hammer2_xop_start(&xop->head, &hammer2_lookup_desc); error = hammer2_xop_collect(&xop->head, 0); if (error == 0) ip = hammer2_inode_get(pmp, &xop->head, -1, -1); hammer2_xop_retire(&xop->head, HAMMER2_XOPMASK_VOP); if (ip) { *vpp = hammer2_igetv(ip, &error); hammer2_inode_unlock(ip); } else { *vpp = NULL; error = ENOENT; } return (error); } static int hammer2_vfs_root(struct mount *mp, struct vnode **vpp) { hammer2_pfs_t *pmp; struct vnode *vp; int error; pmp = MPTOPMP(mp); if (pmp->iroot == NULL) { kprintf("hammer2 (%s): no root inode\n", mp->mnt_stat.f_mntfromname); *vpp = NULL; return EINVAL; } error = 0; hammer2_inode_lock(pmp->iroot, HAMMER2_RESOLVE_SHARED); while (pmp->inode_tid == 0) { hammer2_xop_ipcluster_t *xop; const hammer2_inode_meta_t *meta; xop = hammer2_xop_alloc(pmp->iroot, HAMMER2_XOP_MODIFYING); hammer2_xop_start(&xop->head, &hammer2_ipcluster_desc); error = hammer2_xop_collect(&xop->head, 0); if (error == 0) { meta = &hammer2_xop_gdata(&xop->head)->ipdata.meta; pmp->iroot->meta = *meta; pmp->inode_tid = meta->pfs_inum + 1; hammer2_xop_pdata(&xop->head); /* meta invalid */ if (pmp->inode_tid < HAMMER2_INODE_START) pmp->inode_tid = HAMMER2_INODE_START; pmp->modify_tid = xop->head.cluster.focus->bref.modify_tid + 1; #if 0 kprintf("PFS: Starting inode %jd\n", (intmax_t)pmp->inode_tid); kprintf("PMP focus good set nextino=%ld mod=%016jx\n", pmp->inode_tid, pmp->modify_tid); #endif wakeup(&pmp->iroot); hammer2_xop_retire(&xop->head, HAMMER2_XOPMASK_VOP); /* * Prime the mount info. */ hammer2_vfs_statfs(mp, &mp->mnt_stat, NULL); break; } /* * Loop, try again */ hammer2_xop_retire(&xop->head, HAMMER2_XOPMASK_VOP); hammer2_inode_unlock(pmp->iroot); error = tsleep(&pmp->iroot, PCATCH, "h2root", hz); hammer2_inode_lock(pmp->iroot, HAMMER2_RESOLVE_SHARED); if (error == EINTR) break; } if (error) { hammer2_inode_unlock(pmp->iroot); *vpp = NULL; } else { vp = hammer2_igetv(pmp->iroot, &error); hammer2_inode_unlock(pmp->iroot); *vpp = vp; } return (error); } /* * Filesystem status * * XXX incorporate ipdata->meta.inode_quota and data_quota */ static int hammer2_vfs_statfs(struct mount *mp, struct statfs *sbp, struct ucred *cred) { hammer2_pfs_t *pmp; hammer2_dev_t *hmp; hammer2_blockref_t bref; struct statfs tmp; int i; /* * NOTE: iroot might not have validated the cluster yet. */ pmp = MPTOPMP(mp); bzero(&tmp, sizeof(tmp)); for (i = 0; i < pmp->iroot->cluster.nchains; ++i) { hmp = pmp->pfs_hmps[i]; if (hmp == NULL) continue; if (pmp->iroot->cluster.array[i].chain) bref = pmp->iroot->cluster.array[i].chain->bref; else bzero(&bref, sizeof(bref)); tmp.f_files = bref.embed.stats.inode_count; tmp.f_ffree = 0; tmp.f_blocks = hmp->voldata.allocator_size / mp->mnt_vstat.f_bsize; tmp.f_bfree = hmp->voldata.allocator_free / mp->mnt_vstat.f_bsize; tmp.f_bavail = tmp.f_bfree; if (cred && cred->cr_uid != 0) { uint64_t adj; /* 5% */ adj = hmp->free_reserved / mp->mnt_vstat.f_bsize; tmp.f_blocks -= adj; tmp.f_bfree -= adj; tmp.f_bavail -= adj; } mp->mnt_stat.f_blocks = tmp.f_blocks; mp->mnt_stat.f_bfree = tmp.f_bfree; mp->mnt_stat.f_bavail = tmp.f_bavail; mp->mnt_stat.f_files = tmp.f_files; mp->mnt_stat.f_ffree = tmp.f_ffree; *sbp = mp->mnt_stat; } return (0); } static int hammer2_vfs_statvfs(struct mount *mp, struct statvfs *sbp, struct ucred *cred) { hammer2_pfs_t *pmp; hammer2_dev_t *hmp; hammer2_blockref_t bref; struct statvfs tmp; int i; /* * NOTE: iroot might not have validated the cluster yet. */ pmp = MPTOPMP(mp); bzero(&tmp, sizeof(tmp)); for (i = 0; i < pmp->iroot->cluster.nchains; ++i) { hmp = pmp->pfs_hmps[i]; if (hmp == NULL) continue; if (pmp->iroot->cluster.array[i].chain) bref = pmp->iroot->cluster.array[i].chain->bref; else bzero(&bref, sizeof(bref)); tmp.f_files = bref.embed.stats.inode_count; tmp.f_ffree = 0; tmp.f_blocks = hmp->voldata.allocator_size / mp->mnt_vstat.f_bsize; tmp.f_bfree = hmp->voldata.allocator_free / mp->mnt_vstat.f_bsize; tmp.f_bavail = tmp.f_bfree; if (cred && cred->cr_uid != 0) { uint64_t adj; /* 5% */ adj = hmp->free_reserved / mp->mnt_vstat.f_bsize; tmp.f_blocks -= adj; tmp.f_bfree -= adj; tmp.f_bavail -= adj; } mp->mnt_vstat.f_blocks = tmp.f_blocks; mp->mnt_vstat.f_bfree = tmp.f_bfree; mp->mnt_vstat.f_bavail = tmp.f_bavail; mp->mnt_vstat.f_files = tmp.f_files; mp->mnt_vstat.f_ffree = tmp.f_ffree; *sbp = mp->mnt_vstat; } return (0); } /* * Mount-time recovery (RW mounts) * * Updates to the free block table are allowed to lag flushes by one * transaction. In case of a crash, then on a fresh mount we must do an * incremental scan of the last committed transaction id and make sure that * all related blocks have been marked allocated. */ struct hammer2_recovery_elm { TAILQ_ENTRY(hammer2_recovery_elm) entry; hammer2_chain_t *chain; hammer2_tid_t sync_tid; }; TAILQ_HEAD(hammer2_recovery_list, hammer2_recovery_elm); struct hammer2_recovery_info { struct hammer2_recovery_list list; hammer2_tid_t mtid; int depth; }; static int hammer2_recovery_scan(hammer2_dev_t *hmp, hammer2_chain_t *parent, struct hammer2_recovery_info *info, hammer2_tid_t sync_tid); #define HAMMER2_RECOVERY_MAXDEPTH 10 static int hammer2_recovery(hammer2_dev_t *hmp) { struct hammer2_recovery_info info; struct hammer2_recovery_elm *elm; hammer2_chain_t *parent; hammer2_tid_t sync_tid; hammer2_tid_t mirror_tid; int error; hammer2_trans_init(hmp->spmp, 0); sync_tid = hmp->voldata.freemap_tid; mirror_tid = hmp->voldata.mirror_tid; kprintf("hammer2_mount: \"%s\": ", hmp->devrepname); if (sync_tid >= mirror_tid) { kprintf("no recovery needed\n"); } else { kprintf("freemap recovery %016jx-%016jx\n", sync_tid + 1, mirror_tid); } TAILQ_INIT(&info.list); info.depth = 0; parent = hammer2_chain_lookup_init(&hmp->vchain, 0); error = hammer2_recovery_scan(hmp, parent, &info, sync_tid); hammer2_chain_lookup_done(parent); while ((elm = TAILQ_FIRST(&info.list)) != NULL) { TAILQ_REMOVE(&info.list, elm, entry); parent = elm->chain; sync_tid = elm->sync_tid; kfree(elm, M_HAMMER2); hammer2_chain_lock(parent, HAMMER2_RESOLVE_ALWAYS); error |= hammer2_recovery_scan(hmp, parent, &info, hmp->voldata.freemap_tid); hammer2_chain_unlock(parent); hammer2_chain_drop(parent); /* drop elm->chain ref */ } hammer2_trans_done(hmp->spmp, 0); return error; } static int hammer2_recovery_scan(hammer2_dev_t *hmp, hammer2_chain_t *parent, struct hammer2_recovery_info *info, hammer2_tid_t sync_tid) { const hammer2_inode_data_t *ripdata; hammer2_chain_t *chain; hammer2_blockref_t bref; int tmp_error; int rup_error; int error; int first; /* * Adjust freemap to ensure that the block(s) are marked allocated. */ if (parent->bref.type != HAMMER2_BREF_TYPE_VOLUME) { hammer2_freemap_adjust(hmp, &parent->bref, HAMMER2_FREEMAP_DORECOVER); } /* * Check type for recursive scan */ switch(parent->bref.type) { case HAMMER2_BREF_TYPE_VOLUME: /* data already instantiated */ break; case HAMMER2_BREF_TYPE_INODE: /* * Must instantiate data for DIRECTDATA test and also * for recursion. */ hammer2_chain_lock(parent, HAMMER2_RESOLVE_ALWAYS); ripdata = &parent->data->ipdata; if (ripdata->meta.op_flags & HAMMER2_OPFLAG_DIRECTDATA) { /* not applicable to recovery scan */ hammer2_chain_unlock(parent); return 0; } hammer2_chain_unlock(parent); break; case HAMMER2_BREF_TYPE_INDIRECT: /* * Must instantiate data for recursion */ hammer2_chain_lock(parent, HAMMER2_RESOLVE_ALWAYS); hammer2_chain_unlock(parent); break; case HAMMER2_BREF_TYPE_DIRENT: case HAMMER2_BREF_TYPE_DATA: case HAMMER2_BREF_TYPE_FREEMAP: case HAMMER2_BREF_TYPE_FREEMAP_NODE: case HAMMER2_BREF_TYPE_FREEMAP_LEAF: /* not applicable to recovery scan */ return 0; break; default: return HAMMER2_ERROR_BADBREF; } /* * Defer operation if depth limit reached. */ if (info->depth >= HAMMER2_RECOVERY_MAXDEPTH) { struct hammer2_recovery_elm *elm; elm = kmalloc(sizeof(*elm), M_HAMMER2, M_ZERO | M_WAITOK); elm->chain = parent; elm->sync_tid = sync_tid; hammer2_chain_ref(parent); TAILQ_INSERT_TAIL(&info->list, elm, entry); /* unlocked by caller */ return(0); } /* * Recursive scan of the last flushed transaction only. We are * doing this without pmp assignments so don't leave the chains * hanging around after we are done with them. * * error Cumulative error this level only * rup_error Cumulative error for recursion * tmp_error Specific non-cumulative recursion error */ chain = NULL; first = 1; rup_error = 0; error = 0; for (;;) { error |= hammer2_chain_scan(parent, &chain, &bref, &first, HAMMER2_LOOKUP_NODATA); /* * Problem during scan or EOF */ if (error) break; /* * If this is a leaf */ if (chain == NULL) { if (bref.mirror_tid > sync_tid) { hammer2_freemap_adjust(hmp, &bref, HAMMER2_FREEMAP_DORECOVER); } continue; } /* * This may or may not be a recursive node. */ atomic_set_int(&chain->flags, HAMMER2_CHAIN_RELEASE); if (bref.mirror_tid > sync_tid) { ++info->depth; tmp_error = hammer2_recovery_scan(hmp, chain, info, sync_tid); --info->depth; } else { tmp_error = 0; } /* * Flush the recovery at the PFS boundary to stage it for * the final flush of the super-root topology. */ if (tmp_error == 0 && (bref.flags & HAMMER2_BREF_FLAG_PFSROOT) && (chain->flags & HAMMER2_CHAIN_ONFLUSH)) { hammer2_flush(chain, HAMMER2_FLUSH_TOP | HAMMER2_FLUSH_ALL); } rup_error |= tmp_error; } return ((error | rup_error) & ~HAMMER2_ERROR_EOF); } /* * This fixes up an error introduced in earlier H2 implementations where * moving a PFS inode into an indirect block wound up causing the * HAMMER2_BREF_FLAG_PFSROOT flag in the bref to get cleared. */ static int hammer2_fixup_pfses(hammer2_dev_t *hmp) { const hammer2_inode_data_t *ripdata; hammer2_chain_t *parent; hammer2_chain_t *chain; hammer2_key_t key_next; hammer2_pfs_t *spmp; int error; error = 0; /* * Lookup mount point under the media-localized super-root. * * cluster->pmp will incorrectly point to spmp and must be fixed * up later on. */ spmp = hmp->spmp; hammer2_inode_lock(spmp->iroot, 0); parent = hammer2_inode_chain(spmp->iroot, 0, HAMMER2_RESOLVE_ALWAYS); chain = hammer2_chain_lookup(&parent, &key_next, HAMMER2_KEY_MIN, HAMMER2_KEY_MAX, &error, 0); while (chain) { if (chain->bref.type != HAMMER2_BREF_TYPE_INODE) continue; if (chain->error) { kprintf("I/O error scanning PFS labels\n"); error |= chain->error; } else if ((chain->bref.flags & HAMMER2_BREF_FLAG_PFSROOT) == 0) { int error2; ripdata = &chain->data->ipdata; hammer2_trans_init(hmp->spmp, 0); error2 = hammer2_chain_modify(chain, chain->bref.modify_tid, 0, 0); if (error2 == 0) { kprintf("hammer2: Correct mis-flagged PFS %s\n", ripdata->filename); chain->bref.flags |= HAMMER2_BREF_FLAG_PFSROOT; } else { error |= error2; } hammer2_flush(chain, HAMMER2_FLUSH_TOP | HAMMER2_FLUSH_ALL); hammer2_trans_done(hmp->spmp, 0); } chain = hammer2_chain_next(&parent, chain, &key_next, key_next, HAMMER2_KEY_MAX, &error, 0); } if (parent) { hammer2_chain_unlock(parent); hammer2_chain_drop(parent); } hammer2_inode_unlock(spmp->iroot); return error; } /* * Sync a mount point; this is called periodically on a per-mount basis from * the filesystem syncer, and whenever a user issues a sync. */ int hammer2_vfs_sync(struct mount *mp, int waitfor) { int error; error = hammer2_vfs_sync_pmp(MPTOPMP(mp), waitfor); return error; } /* * Because frontend operations lock vnodes before we get a chance to * lock the related inode, we can't just acquire a vnode lock without * risking a deadlock. The frontend may be holding a vnode lock while * also blocked on our SYNCQ flag while trying to get the inode lock. * * To deal with this situation we can check the vnode lock situation * after locking the inode and perform a work-around. */ int hammer2_vfs_sync_pmp(hammer2_pfs_t *pmp, int waitfor) { struct mount *mp; /*hammer2_xop_flush_t *xop;*/ hammer2_inode_t *ip; hammer2_depend_t *depend; hammer2_depend_t *depend_next; struct vnode *vp; uint32_t pass2; int error; int wakecount; int dorestart; mp = pmp->mp; /* * Move all inodes on sideq to syncq. This will clear sideq. * This should represent all flushable inodes. These inodes * will already have refs due to being on syncq or sideq. We * must do this all at once with the spinlock held to ensure that * all inode dependencies are part of the same flush. * * We should be able to do this asynchronously from frontend * operations because we will be locking the inodes later on * to actually flush them, and that will partition any frontend * op using the same inode. Either it has already locked the * inode and we will block, or it has not yet locked the inode * and it will block until we are finished flushing that inode. * * When restarting, only move the inodes flagged as PASS2 from * SIDEQ to SYNCQ. PASS2 propagation by inode_lock4() and * inode_depend() are atomic with the spin-lock. */ hammer2_trans_init(pmp, HAMMER2_TRANS_ISFLUSH); #ifdef HAMMER2_DEBUG_SYNC kprintf("FILESYSTEM SYNC BOUNDARY\n"); #endif dorestart = 0; /* * Move inodes from depq to syncq, releasing the related * depend structures. */ restart: #ifdef HAMMER2_DEBUG_SYNC kprintf("FILESYSTEM SYNC RESTART (%d)\n", dorestart); #endif hammer2_trans_setflags(pmp, 0/*HAMMER2_TRANS_COPYQ*/); hammer2_trans_clearflags(pmp, HAMMER2_TRANS_RESCAN); /* * Move inodes from depq to syncq. When restarting, only depq's * marked pass2 are moved. */ hammer2_spin_ex(&pmp->list_spin); depend_next = TAILQ_FIRST(&pmp->depq); wakecount = 0; while ((depend = depend_next) != NULL) { depend_next = TAILQ_NEXT(depend, entry); if (dorestart && depend->pass2 == 0) continue; TAILQ_FOREACH(ip, &depend->sideq, entry) { KKASSERT(ip->flags & HAMMER2_INODE_SIDEQ); atomic_set_int(&ip->flags, HAMMER2_INODE_SYNCQ); atomic_clear_int(&ip->flags, HAMMER2_INODE_SIDEQ); ip->depend = NULL; } /* * NOTE: pmp->sideq_count includes both sideq and syncq */ TAILQ_CONCAT(&pmp->syncq, &depend->sideq, entry); depend->count = 0; depend->pass2 = 0; TAILQ_REMOVE(&pmp->depq, depend, entry); } hammer2_spin_unex(&pmp->list_spin); hammer2_trans_clearflags(pmp, /*HAMMER2_TRANS_COPYQ |*/ HAMMER2_TRANS_WAITING); dorestart = 0; /* * sideq_count may have dropped enough to allow us to unstall * the frontend. */ hammer2_pfs_memory_wakeup(pmp, 0); /* * Now run through all inodes on syncq. * * Flush transactions only interlock with other flush transactions. * Any conflicting frontend operations will block on the inode, but * may hold a vnode lock while doing so. */ hammer2_spin_ex(&pmp->list_spin); while ((ip = TAILQ_FIRST(&pmp->syncq)) != NULL) { /* * Remove the inode from the SYNCQ, transfer the syncq ref * to us. We must clear SYNCQ to allow any potential * front-end deadlock to proceed. We must set PASS2 so * the dependency code knows what to do. */ pass2 = ip->flags; cpu_ccfence(); if (atomic_cmpset_int(&ip->flags, pass2, (pass2 & ~(HAMMER2_INODE_SYNCQ | HAMMER2_INODE_SYNCQ_WAKEUP)) | HAMMER2_INODE_SYNCQ_PASS2) == 0) { continue; } TAILQ_REMOVE(&pmp->syncq, ip, entry); --pmp->sideq_count; hammer2_spin_unex(&pmp->list_spin); /* * Tickle anyone waiting on ip->flags or the hysteresis * on the dirty inode count. */ if (pass2 & HAMMER2_INODE_SYNCQ_WAKEUP) wakeup(&ip->flags); if (++wakecount >= hammer2_limit_dirty_inodes / 20 + 1) { wakecount = 0; hammer2_pfs_memory_wakeup(pmp, 0); } /* * Relock the inode, and we inherit a ref from the above. * We will check for a race after we acquire the vnode. */ hammer2_mtx_ex(&ip->lock); /* * We need the vp in order to vfsync() dirty buffers, so if * one isn't attached we can skip it. * * Ordering the inode lock and then the vnode lock has the * potential to deadlock. If we had left SYNCQ set that could * also deadlock us against the frontend even if we don't hold * any locks, but the latter is not a problem now since we * cleared it. igetv will temporarily release the inode lock * in a safe manner to work-around the deadlock. * * Unfortunately it is still possible to deadlock when the * frontend obtains multiple inode locks, because all the * related vnodes are already locked (nor can the vnode locks * be released and reacquired without messing up RECLAIM and * INACTIVE sequencing). * * The solution for now is to move the vp back onto SIDEQ * and set dorestart, which will restart the flush after we * exhaust the current SYNCQ. Note that additional * dependencies may build up, so we definitely need to move * the whole SIDEQ back to SYNCQ when we restart. */ vp = ip->vp; if (vp) { if (vget(vp, LK_EXCLUSIVE|LK_NOWAIT)) { /* * Failed to get the vnode, requeue the inode * (PASS2 is already set so it will be found * again on the restart). * * Then unlock, possibly sleep, and retry * later. We sleep if PASS2 was *previously* * set, before we set it again above. */ vp = NULL; dorestart = 1; #ifdef HAMMER2_DEBUG_SYNC kprintf("inum %ld (sync delayed by vnode)\n", (long)ip->meta.inum); #endif hammer2_inode_delayed_sideq(ip); hammer2_mtx_unlock(&ip->lock); hammer2_inode_drop(ip); if (pass2 & HAMMER2_INODE_SYNCQ_PASS2) { tsleep(&dorestart, 0, "h2syndel", 2); } hammer2_spin_ex(&pmp->list_spin); continue; } } else { vp = NULL; } /* * If the inode wound up on a SIDEQ again it will already be * prepped for another PASS2. In this situation if we flush * it now we will just wind up flushing it again in the same * syncer run, so we might as well not flush it now. */ if (ip->flags & HAMMER2_INODE_SIDEQ) { hammer2_mtx_unlock(&ip->lock); hammer2_inode_drop(ip); if (vp) vput(vp); dorestart = 1; hammer2_spin_ex(&pmp->list_spin); continue; } /* * Ok we have the inode exclusively locked and if vp is * not NULL that will also be exclusively locked. Do the * meat of the flush. * * vp token needed for v_rbdirty_tree check / vclrisdirty * sequencing. Though we hold the vnode exclusively so * we shouldn't need to hold the token also in this case. */ if (vp) { vfsync(vp, MNT_WAIT, 1, NULL, NULL); bio_track_wait(&vp->v_track_write, 0, 0); /* XXX */ } /* * If the inode has not yet been inserted into the tree * we must do so. Then sync and flush it. The flush should * update the parent. */ if (ip->flags & HAMMER2_INODE_DELETING) { #ifdef HAMMER2_DEBUG_SYNC kprintf("inum %ld destroy\n", (long)ip->meta.inum); #endif hammer2_inode_chain_des(ip); atomic_add_long(&hammer2_iod_inode_deletes, 1); } else if (ip->flags & HAMMER2_INODE_CREATING) { #ifdef HAMMER2_DEBUG_SYNC kprintf("inum %ld insert\n", (long)ip->meta.inum); #endif hammer2_inode_chain_ins(ip); atomic_add_long(&hammer2_iod_inode_creates, 1); } #ifdef HAMMER2_DEBUG_SYNC kprintf("inum %ld chain-sync\n", (long)ip->meta.inum); #endif /* * Because I kinda messed up the design and index the inodes * under the root inode, along side the directory entries, * we can't flush the inode index under the iroot until the * end. If we do it now we might miss effects created by * other inodes on the SYNCQ. * * Do a normal (non-FSSYNC) flush instead, which allows the * vnode code to work the same. We don't want to force iroot * back onto the SIDEQ, and we also don't want the flush code * to update pfs_iroot_blocksets until the final flush later. * * XXX at the moment this will likely result in a double-flush * of the iroot chain. */ hammer2_inode_chain_sync(ip); if (ip == pmp->iroot) { hammer2_inode_chain_flush(ip, HAMMER2_XOP_INODE_STOP); } else { hammer2_inode_chain_flush(ip, HAMMER2_XOP_INODE_STOP | HAMMER2_XOP_FSSYNC); } if (vp) { lwkt_gettoken(&vp->v_token); if ((ip->flags & (HAMMER2_INODE_MODIFIED | HAMMER2_INODE_RESIZED | HAMMER2_INODE_DIRTYDATA)) == 0 && RB_EMPTY(&vp->v_rbdirty_tree) && !bio_track_active(&vp->v_track_write)) { vclrisdirty(vp); } else { hammer2_inode_delayed_sideq(ip); } lwkt_reltoken(&vp->v_token); vput(vp); vp = NULL; /* safety */ } atomic_clear_int(&ip->flags, HAMMER2_INODE_SYNCQ_PASS2); hammer2_inode_unlock(ip); /* unlock+drop */ /* ip pointer invalid */ /* * If the inode got dirted after we dropped our locks, * it will have already been moved back to the SIDEQ. */ hammer2_spin_ex(&pmp->list_spin); } hammer2_spin_unex(&pmp->list_spin); hammer2_pfs_memory_wakeup(pmp, 0); if (dorestart || (pmp->trans.flags & HAMMER2_TRANS_RESCAN)) { #ifdef HAMMER2_DEBUG_SYNC kprintf("FILESYSTEM SYNC STAGE 1 RESTART\n"); /*tsleep(&dorestart, 0, "h2STG1-R", hz*20);*/ #endif dorestart = 1; goto restart; } #ifdef HAMMER2_DEBUG_SYNC kprintf("FILESYSTEM SYNC STAGE 2 BEGIN\n"); /*tsleep(&dorestart, 0, "h2STG2", hz*20);*/ #endif /* * We have to flush the PFS root last, even if it does not appear to * be dirty, because all the inodes in the PFS are indexed under it. * The normal flushing of iroot above would only occur if directory * entries under the root were changed. * * Specifying VOLHDR will cause an additionl flush of hmp->spmp * for the media making up the cluster. */ if ((ip = pmp->iroot) != NULL) { hammer2_inode_ref(ip); hammer2_mtx_ex(&ip->lock); hammer2_inode_chain_sync(ip); hammer2_inode_chain_flush(ip, HAMMER2_XOP_INODE_STOP | HAMMER2_XOP_FSSYNC | HAMMER2_XOP_VOLHDR); hammer2_inode_unlock(ip); /* unlock+drop */ } #ifdef HAMMER2_DEBUG_SYNC kprintf("FILESYSTEM SYNC STAGE 2 DONE\n"); #endif /* * device bioq sync */ hammer2_bioq_sync(pmp); #if 0 /* * Generally speaking we now want to flush the media topology from * the iroot through to the inodes. The flush stops at any inode * boundary, which allows the frontend to continue running concurrent * modifying operations on inodes (including kernel flushes of * buffers) without interfering with the main sync. * * Use the XOP interface to concurrently flush all nodes to * synchronize the PFSROOT subtopology to the media. A standard * end-of-scan ENOENT error indicates cluster sufficiency. * * Note that this flush will not be visible on crash recovery until * we flush the super-root topology in the next loop. * * XXX For now wait for all flushes to complete. */ if (mp && (ip = pmp->iroot) != NULL) { /* * If unmounting try to flush everything including any * sub-trees under inodes, just in case there is dangling * modified data, as a safety. Otherwise just flush up to * the inodes in this stage. */ kprintf("MP & IROOT\n"); #ifdef HAMMER2_DEBUG_SYNC kprintf("FILESYSTEM SYNC STAGE 3 IROOT BEGIN\n"); #endif if (mp->mnt_kern_flag & MNTK_UNMOUNT) { xop = hammer2_xop_alloc(ip, HAMMER2_XOP_MODIFYING | HAMMER2_XOP_VOLHDR | HAMMER2_XOP_FSSYNC | HAMMER2_XOP_INODE_STOP); } else { xop = hammer2_xop_alloc(ip, HAMMER2_XOP_MODIFYING | HAMMER2_XOP_INODE_STOP | HAMMER2_XOP_VOLHDR | HAMMER2_XOP_FSSYNC | HAMMER2_XOP_INODE_STOP); } hammer2_xop_start(&xop->head, &hammer2_inode_flush_desc); error = hammer2_xop_collect(&xop->head, HAMMER2_XOP_COLLECT_WAITALL); hammer2_xop_retire(&xop->head, HAMMER2_XOPMASK_VOP); #ifdef HAMMER2_DEBUG_SYNC kprintf("FILESYSTEM SYNC STAGE 3 IROOT END\n"); #endif if (error == HAMMER2_ERROR_ENOENT) error = 0; else error = hammer2_error_to_errno(error); } else { error = 0; } #endif error = 0; /* XXX */ hammer2_trans_done(pmp, HAMMER2_TRANS_ISFLUSH); return (error); } static int hammer2_vfs_vptofh(struct vnode *vp, struct fid *fhp) { hammer2_inode_t *ip; KKASSERT(MAXFIDSZ >= 16); ip = VTOI(vp); fhp->fid_len = offsetof(struct fid, fid_data[16]); fhp->fid_ext = 0; ((hammer2_tid_t *)fhp->fid_data)[0] = ip->meta.inum; ((hammer2_tid_t *)fhp->fid_data)[1] = 0; return 0; } static int hammer2_vfs_fhtovp(struct mount *mp, struct vnode *rootvp, struct fid *fhp, struct vnode **vpp) { hammer2_pfs_t *pmp; hammer2_tid_t inum; int error; pmp = MPTOPMP(mp); inum = ((hammer2_tid_t *)fhp->fid_data)[0] & HAMMER2_DIRHASH_USERMSK; if (vpp) { if (inum == 1) error = hammer2_vfs_root(mp, vpp); else error = hammer2_vfs_vget(mp, NULL, inum, vpp); } else { error = 0; } return error; } static int hammer2_vfs_checkexp(struct mount *mp, struct sockaddr *nam, int *exflagsp, struct ucred **credanonp) { hammer2_pfs_t *pmp; struct netcred *np; int error; pmp = MPTOPMP(mp); np = vfs_export_lookup(mp, &pmp->export, nam); if (np) { *exflagsp = np->netc_exflags; *credanonp = &np->netc_anon; error = 0; } else { error = EACCES; } return error; } /* * This handles hysteresis on regular file flushes. Because the BIOs are * routed to a thread it is possible for an excessive number to build up * and cause long front-end stalls long before the runningbuffspace limit * is hit, so we implement hammer2_flush_pipe to control the * hysteresis. * * This is a particular problem when compression is used. */ void hammer2_lwinprog_ref(hammer2_pfs_t *pmp) { atomic_add_int(&pmp->count_lwinprog, 1); } void hammer2_lwinprog_drop(hammer2_pfs_t *pmp) { int lwinprog; lwinprog = atomic_fetchadd_int(&pmp->count_lwinprog, -1); if ((lwinprog & HAMMER2_LWINPROG_WAITING) && (lwinprog & HAMMER2_LWINPROG_MASK) <= hammer2_flush_pipe * 2 / 3) { atomic_clear_int(&pmp->count_lwinprog, HAMMER2_LWINPROG_WAITING); wakeup(&pmp->count_lwinprog); } if ((lwinprog & HAMMER2_LWINPROG_WAITING0) && (lwinprog & HAMMER2_LWINPROG_MASK) <= 0) { atomic_clear_int(&pmp->count_lwinprog, HAMMER2_LWINPROG_WAITING0); wakeup(&pmp->count_lwinprog); } } void hammer2_lwinprog_wait(hammer2_pfs_t *pmp, int flush_pipe) { int lwinprog; int lwflag = (flush_pipe) ? HAMMER2_LWINPROG_WAITING : HAMMER2_LWINPROG_WAITING0; for (;;) { lwinprog = pmp->count_lwinprog; cpu_ccfence(); if ((lwinprog & HAMMER2_LWINPROG_MASK) <= flush_pipe) break; tsleep_interlock(&pmp->count_lwinprog, 0); atomic_set_int(&pmp->count_lwinprog, lwflag); lwinprog = pmp->count_lwinprog; if ((lwinprog & HAMMER2_LWINPROG_MASK) <= flush_pipe) break; tsleep(&pmp->count_lwinprog, PINTERLOCKED, "h2wpipe", hz); } } /* * It is possible for an excessive number of dirty chains or dirty inodes * to build up. When this occurs we start an asynchronous filesystem sync. * If the level continues to build up, we stall, waiting for it to drop, * with some hysteresis. * * This relies on the kernel calling hammer2_vfs_modifying() prior to * obtaining any vnode locks before making a modifying VOP call. */ static int hammer2_vfs_modifying(struct mount *mp) { if (mp->mnt_flag & MNT_RDONLY) return EROFS; hammer2_pfs_memory_wait(MPTOPMP(mp)); return 0; } /* * Initiate an asynchronous filesystem sync and, with hysteresis, * stall if the internal data structure count becomes too bloated. */ void hammer2_pfs_memory_wait(hammer2_pfs_t *pmp) { uint32_t waiting; int pcatch; int error; if (pmp == NULL || pmp->mp == NULL) return; for (;;) { waiting = pmp->inmem_dirty_chains & HAMMER2_DIRTYCHAIN_MASK; cpu_ccfence(); /* * Start the syncer running at 1/2 the limit */ if (waiting > hammer2_limit_dirty_chains / 2 || pmp->sideq_count > hammer2_limit_dirty_inodes / 2) { trigger_syncer(pmp->mp); } /* * Stall at the limit waiting for the counts to drop. * This code will typically be woken up once the count * drops below 3/4 the limit, or in one second. */ if (waiting < hammer2_limit_dirty_chains && pmp->sideq_count < hammer2_limit_dirty_inodes) { break; } pcatch = curthread->td_proc ? PCATCH : 0; tsleep_interlock(&pmp->inmem_dirty_chains, pcatch); atomic_set_int(&pmp->inmem_dirty_chains, HAMMER2_DIRTYCHAIN_WAITING); if (waiting < hammer2_limit_dirty_chains && pmp->sideq_count < hammer2_limit_dirty_inodes) { break; } trigger_syncer(pmp->mp); error = tsleep(&pmp->inmem_dirty_chains, PINTERLOCKED | pcatch, "h2memw", hz); if (error == ERESTART) break; } } /* * Wake up any stalled frontend ops waiting, with hysteresis, using * 2/3 of the limit. */ void hammer2_pfs_memory_wakeup(hammer2_pfs_t *pmp, int count) { uint32_t waiting; if (pmp) { waiting = atomic_fetchadd_int(&pmp->inmem_dirty_chains, count); /* don't need --waiting to test flag */ if ((waiting & HAMMER2_DIRTYCHAIN_WAITING) && (pmp->inmem_dirty_chains & HAMMER2_DIRTYCHAIN_MASK) <= hammer2_limit_dirty_chains * 2 / 3 && pmp->sideq_count <= hammer2_limit_dirty_inodes * 2 / 3) { atomic_clear_int(&pmp->inmem_dirty_chains, HAMMER2_DIRTYCHAIN_WAITING); wakeup(&pmp->inmem_dirty_chains); } } } void hammer2_pfs_memory_inc(hammer2_pfs_t *pmp) { if (pmp) { atomic_add_int(&pmp->inmem_dirty_chains, 1); } } /* * Volume header data locks */ void hammer2_voldata_lock(hammer2_dev_t *hmp) { lockmgr(&hmp->vollk, LK_EXCLUSIVE); } void hammer2_voldata_unlock(hammer2_dev_t *hmp) { lockmgr(&hmp->vollk, LK_RELEASE); } /* * Caller indicates that the volume header is being modified. Flag * the related chain and adjust its transaction id. * * The transaction id is set to voldata.mirror_tid + 1, similar to * what hammer2_chain_modify() does. Be very careful here, volume * data can be updated independently of the rest of the filesystem. */ void hammer2_voldata_modify(hammer2_dev_t *hmp) { if ((hmp->vchain.flags & HAMMER2_CHAIN_MODIFIED) == 0) { atomic_add_long(&hammer2_count_modified_chains, 1); atomic_set_int(&hmp->vchain.flags, HAMMER2_CHAIN_MODIFIED); hammer2_pfs_memory_inc(hmp->vchain.pmp); hmp->vchain.bref.mirror_tid = hmp->voldata.mirror_tid + 1; } } /* * Returns 0 if the filesystem has tons of free space * Returns 1 if the filesystem has less than 10% remaining * Returns 2 if the filesystem has less than 2%/5% (user/root) remaining. */ int hammer2_vfs_enospace(hammer2_inode_t *ip, off_t bytes, struct ucred *cred) { hammer2_pfs_t *pmp; hammer2_dev_t *hmp; hammer2_off_t free_reserved; hammer2_off_t free_nominal; int i; pmp = ip->pmp; if (pmp->free_ticks == 0 || pmp->free_ticks != ticks) { free_reserved = HAMMER2_SEGSIZE; free_nominal = 0x7FFFFFFFFFFFFFFFLLU; for (i = 0; i < pmp->iroot->cluster.nchains; ++i) { hmp = pmp->pfs_hmps[i]; if (hmp == NULL) continue; if (pmp->pfs_types[i] != HAMMER2_PFSTYPE_MASTER && pmp->pfs_types[i] != HAMMER2_PFSTYPE_SOFT_MASTER) continue; if (free_nominal > hmp->voldata.allocator_free) free_nominal = hmp->voldata.allocator_free; if (free_reserved < hmp->free_reserved) free_reserved = hmp->free_reserved; } /* * SMP races ok */ pmp->free_reserved = free_reserved; pmp->free_nominal = free_nominal; pmp->free_ticks = ticks; } else { free_reserved = pmp->free_reserved; free_nominal = pmp->free_nominal; } if (cred && cred->cr_uid != 0) { if ((int64_t)(free_nominal - bytes) < (int64_t)free_reserved) { return 2; } } else { if ((int64_t)(free_nominal - bytes) < (int64_t)free_reserved / 2) { return 2; } } if ((int64_t)(free_nominal - bytes) < (int64_t)free_reserved * 2) return 1; return 0; } /* * Debugging */ void hammer2_dump_chain(hammer2_chain_t *chain, int tab, int bi, int *countp, char pfx, u_int flags) { hammer2_chain_t *scan; hammer2_chain_t *parent; --*countp; if (*countp == 0) { kprintf("%*.*s...\n", tab, tab, ""); return; } if (*countp < 0) return; kprintf("%*.*s%c-chain %p %s.%-3d %016jx %016jx/%-2d mir=%016jx\n", tab, tab, "", pfx, chain, hammer2_bref_type_str(chain->bref.type), bi, chain->bref.data_off, chain->bref.key, chain->bref.keybits, chain->bref.mirror_tid); kprintf("%*.*s [%08x] (%s) refs=%d", tab, tab, "", chain->flags, ((chain->bref.type == HAMMER2_BREF_TYPE_INODE && chain->data) ? (char *)chain->data->ipdata.filename : "?"), chain->refs); parent = chain->parent; if (parent) kprintf("\n%*.*s p=%p [pflags %08x prefs %d]", tab, tab, "", parent, parent->flags, parent->refs); if (RB_EMPTY(&chain->core.rbtree)) { kprintf("\n"); } else { int bi = 0; kprintf(" {\n"); RB_FOREACH(scan, hammer2_chain_tree, &chain->core.rbtree) { if ((scan->flags & flags) || flags == (u_int)-1) { hammer2_dump_chain(scan, tab + 4, bi, countp, 'a', flags); } bi++; } if (chain->bref.type == HAMMER2_BREF_TYPE_INODE && chain->data) kprintf("%*.*s}(%s)\n", tab, tab, "", chain->data->ipdata.filename); else kprintf("%*.*s}\n", tab, tab, ""); } }
allogic/Redshift
Redshift/Include/Delegates.h
#pragma once #include <Core.h> #include <Types.h> class Actor; class Delegates { public: //////////////////////////////////////////////////////// // Primitives //////////////////////////////////////////////////////// using AxisDelegate = void (Actor::*)(float); using ActionDelegate = void (Actor::*)(); struct AxisInfo { Actor* Instance; AxisDelegate Delegate; bool operator < (AxisInfo const& other) const { return Instance < other.Instance; } }; struct ActionInfo { Actor* Instance; ActionDelegate Delegate; bool operator < (ActionInfo const& other) const { return Instance < other.Instance; } }; struct ActionKey { U32 Key; EInputState::Type State; bool operator == (ActionKey const& other) const { return Key == other.Key && State == other.State; } }; struct ActionHasher { U64 operator () (ActionKey const& actionKey) const { return actionKey.Key ^ actionKey.State; } }; struct MouseInfo { R64V2 Current; R64V2 Previous; }; using AxisDelegates = std::unordered_map<std::string, std::multiset<AxisInfo>>; using ActionDelegates = std::unordered_map<ActionKey, std::multiset<ActionInfo>, ActionHasher>; struct Event { EInputState::Type Current; EInputState::Type Previous; }; public: //////////////////////////////////////////////////////// // Constructor //////////////////////////////////////////////////////// Delegates(GLFWwindow* context) : mGlfwContext{ context } { } public: //////////////////////////////////////////////////////// // Getter //////////////////////////////////////////////////////// inline AxisDelegates const& GetAxisDelegates() const { return mAxisDelegates; } inline ActionDelegates const& GetActionDelegates() const { return mActionDelegates; } public: //////////////////////////////////////////////////////// // Event forwarding // Note: Do not put this function inside source file // otherwise it breaks ABI and cannot execute // delegates properly (for whatever reason..) //////////////////////////////////////////////////////// void Update() { // Update mouse button states for (U32 i = 0; i < GLFW_MOUSE_BUTTON_LAST; ++i) { Event& event = mMouseKeyStates[i]; U32 action = glfwGetMouseButton(mGlfwContext, (I32)i); event.Previous = event.Current; if (action == GLFW_PRESS) { if (event.Current != EInputState::Pressed && event.Previous != EInputState::Held) { event.Current = EInputState::Pressed; } else { event.Current = EInputState::Held; } } if (action == GLFW_RELEASE) { if (event.Current != EInputState::Released && event.Previous == EInputState::Held) { event.Current = EInputState::Released; } else { event.Current = EInputState::None; } } } // Update keyboard button states for (U32 i = GLFW_KEY_SPACE; i < GLFW_KEY_LAST; ++i) { Event& event = mKeyboardKeyStates[i]; I32 action = glfwGetKey(mGlfwContext, (I32)i); if (action == GLFW_PRESS) { if (event.Current != EInputState::Pressed && event.Previous != EInputState::Held) { event.Current = EInputState::Pressed; } else { event.Current = EInputState::Held; } } if (action == GLFW_RELEASE) { if (event.Current != EInputState::Released && event.Previous == EInputState::Held) { event.Current = EInputState::Released; } else { event.Current = EInputState::None; } } } // Update mouse position mMouseInfo.Previous = mMouseInfo.Current; glfwGetCursorPos(mGlfwContext, &mMouseInfo.Current.x, &mMouseInfo.Current.y); // Forward axis delegates if (mMouseInfo.Current.x != mMouseInfo.Previous.x) { for (auto const& axisInfo : mAxisDelegates["Horizontal"]) { ((*axisInfo.Instance).*(axisInfo.Delegate))(R32(mMouseInfo.Current.x - mMouseInfo.Previous.x)); } } if (mMouseInfo.Current.y != mMouseInfo.Previous.y) { for (auto const& axisInfo : mAxisDelegates["Vertical"]) { ((*axisInfo.Instance).*(axisInfo.Delegate))(R32(mMouseInfo.Current.y - mMouseInfo.Previous.y)); } } // Forward action delegates for (auto const& [actionKey, actionInfos] : mActionDelegates) { if (mMouseKeyStates[actionKey.Key].Current == actionKey.State) { // Execute delegate for all registered instances for (auto const& actionInfo : actionInfos) { ((*actionInfo.Instance).*(actionInfo.Delegate))(); } } if (mKeyboardKeyStates[actionKey.Key].Current == actionKey.State) { // Execute delegate for all registered instances for (auto const& actionInfo : actionInfos) { ((*actionInfo.Instance).*(actionInfo.Delegate))(); } } } } public: //////////////////////////////////////////////////////// // Input interface //////////////////////////////////////////////////////// template<typename A> requires std::is_base_of_v<Actor, A> void BindAxis(std::string const& axisName, A* actor, void(A::* axisDelegate)(float)) { mAxisDelegates[axisName].emplace(AxisInfo{ (Actor*)actor, (AxisDelegate)axisDelegate }); } template<typename A> requires std::is_base_of_v<Actor, A> void BindAction(U32 key, EInputState::Type state, A* actor, void(A::* actionDelegate)()) { mActionDelegates[ActionKey{ key, state }].emplace(ActionInfo{ (Actor*)actor, (ActionDelegate)actionDelegate }); } template<typename A> requires std::is_base_of_v<Actor, A> void UnBindAll(A* actor) { // Search delegates for actor instance for (auto& [axisName, axisInfos] : mAxisDelegates) { for (auto it = axisInfos.begin(); it != axisInfos.end();) { if (it->Instance == actor) { it = axisInfos.erase(it); } else { ++it; } } } // Search delegates for actor instance for (auto& [actionKey, actionInfos] : mActionDelegates) { for (auto it = actionInfos.begin(); it != actionInfos.end();) { if (it->Instance == actor) { it = actionInfos.erase(it); } else { ++it; } } } } private: GLFWwindow* mGlfwContext; AxisDelegates mAxisDelegates = AxisDelegates{}; ActionDelegates mActionDelegates = ActionDelegates{}; MouseInfo mMouseInfo = MouseInfo{}; Event mMouseKeyStates[GLFW_MOUSE_BUTTON_LAST] = {}; Event mKeyboardKeyStates[GLFW_KEY_LAST] = {}; };
yaohb/J2ObjCAuto
2.4/include/javax/crypto/spec/DHPublicKeySpec.h
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: android/platform/libcore/ojluni/src/main/java/javax/crypto/spec/DHPublicKeySpec.java // #include "J2ObjC_header.h" #pragma push_macro("INCLUDE_ALL_JavaxCryptoSpecDHPublicKeySpec") #ifdef RESTRICT_JavaxCryptoSpecDHPublicKeySpec #define INCLUDE_ALL_JavaxCryptoSpecDHPublicKeySpec 0 #else #define INCLUDE_ALL_JavaxCryptoSpecDHPublicKeySpec 1 #endif #undef RESTRICT_JavaxCryptoSpecDHPublicKeySpec #pragma clang diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #if __has_feature(nullability) #pragma clang diagnostic push #pragma GCC diagnostic ignored "-Wnullability" #pragma GCC diagnostic ignored "-Wnullability-completeness" #endif #if !defined (JavaxCryptoSpecDHPublicKeySpec_) && (INCLUDE_ALL_JavaxCryptoSpecDHPublicKeySpec || defined(INCLUDE_JavaxCryptoSpecDHPublicKeySpec)) #define JavaxCryptoSpecDHPublicKeySpec_ #define RESTRICT_JavaSecuritySpecKeySpec 1 #define INCLUDE_JavaSecuritySpecKeySpec 1 #include "java/security/spec/KeySpec.h" @class JavaMathBigInteger; /*! @brief This class specifies a Diffie-Hellman public key with its associated parameters. <p>Note that this class does not perform any validation on specified parameters. Thus, the specified values are returned directly even if they are null. @author <NAME> - seealso: DHPrivateKeySpec @since 1.4 */ @interface JavaxCryptoSpecDHPublicKeySpec : NSObject < JavaSecuritySpecKeySpec > #pragma mark Public /*! @brief Constructor that takes a public value <code>y</code>, a prime modulus <code>p</code>, and a base generator <code>g</code>. @param y public value y @param p prime modulus p @param g base generator g */ - (instancetype __nonnull)initWithJavaMathBigInteger:(JavaMathBigInteger *)y withJavaMathBigInteger:(JavaMathBigInteger *)p withJavaMathBigInteger:(JavaMathBigInteger *)g; /*! @brief Returns the base generator <code>g</code>. @return the base generator <code>g</code> */ - (JavaMathBigInteger *)getG; /*! @brief Returns the prime modulus <code>p</code>. @return the prime modulus <code>p</code> */ - (JavaMathBigInteger *)getP; /*! @brief Returns the public value <code>y</code>. @return the public value <code>y</code> */ - (JavaMathBigInteger *)getY; // Disallowed inherited constructors, do not use. - (instancetype __nonnull)init NS_UNAVAILABLE; @end J2OBJC_EMPTY_STATIC_INIT(JavaxCryptoSpecDHPublicKeySpec) FOUNDATION_EXPORT void JavaxCryptoSpecDHPublicKeySpec_initWithJavaMathBigInteger_withJavaMathBigInteger_withJavaMathBigInteger_(JavaxCryptoSpecDHPublicKeySpec *self, JavaMathBigInteger *y, JavaMathBigInteger *p, JavaMathBigInteger *g); FOUNDATION_EXPORT JavaxCryptoSpecDHPublicKeySpec *new_JavaxCryptoSpecDHPublicKeySpec_initWithJavaMathBigInteger_withJavaMathBigInteger_withJavaMathBigInteger_(JavaMathBigInteger *y, JavaMathBigInteger *p, JavaMathBigInteger *g) NS_RETURNS_RETAINED; FOUNDATION_EXPORT JavaxCryptoSpecDHPublicKeySpec *create_JavaxCryptoSpecDHPublicKeySpec_initWithJavaMathBigInteger_withJavaMathBigInteger_withJavaMathBigInteger_(JavaMathBigInteger *y, JavaMathBigInteger *p, JavaMathBigInteger *g); J2OBJC_TYPE_LITERAL_HEADER(JavaxCryptoSpecDHPublicKeySpec) #endif #if __has_feature(nullability) #pragma clang diagnostic pop #endif #pragma clang diagnostic pop #pragma pop_macro("INCLUDE_ALL_JavaxCryptoSpecDHPublicKeySpec")
monu9401/Data-Structures-and-Algorithms
sqrtx/sqrtx.java
<filename>sqrtx/sqrtx.java class Solution { public int mySqrt(int x) { long low = 0,high = x; while(low<=high) { long mid = (low+high)/2; if(mid*mid<x) { low=mid+1; } else if(mid*mid>x) { high=mid-1; } else { return (int)mid; } } return (int)high; } }
mgpavlov/SoftUni
Java/Java Web/02.Java MVC Frameworks - Spring - February 2019/Individual Project/onlinegrocery/src/main/java/org/softuni/onlinegrocery/service/ReceiptServiceImpl.java
<filename>Java/Java Web/02.Java MVC Frameworks - Spring - February 2019/Individual Project/onlinegrocery/src/main/java/org/softuni/onlinegrocery/service/ReceiptServiceImpl.java<gh_stars>1-10 package org.softuni.onlinegrocery.service; import org.modelmapper.ModelMapper; import org.softuni.onlinegrocery.domain.entities.Order; import org.softuni.onlinegrocery.domain.entities.Receipt; import org.softuni.onlinegrocery.domain.entities.User; import org.softuni.onlinegrocery.domain.models.service.ReceiptServiceModel; import org.softuni.onlinegrocery.util.error.OrderNotFoundException; import org.softuni.onlinegrocery.util.error.ReceiptNotFoundException; import org.softuni.onlinegrocery.repository.OrderRepository; import org.softuni.onlinegrocery.repository.ReceiptRepository; import org.softuni.onlinegrocery.repository.UserRepository; import org.softuni.onlinegrocery.validation.ReceiptValidationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import java.time.LocalDateTime; import java.util.List; import java.util.stream.Collectors; import static org.softuni.onlinegrocery.util.constants.ExceptionMessages.*; @Service public class ReceiptServiceImpl implements ReceiptService { private final ReceiptRepository receiptRepository; private final OrderRepository orderRepository; private final OrderService orderService; private final UserRepository userRepository; private final ReceiptValidationService receiptValidationService; private final ModelMapper modelMapper; @Autowired public ReceiptServiceImpl(ReceiptRepository receiptRepository, OrderRepository orderRepository, OrderService orderService, UserRepository userRepository, ReceiptValidationService receiptValidationService, ModelMapper modelMapper) { this.receiptRepository = receiptRepository; this.orderRepository = orderRepository; this.orderService = orderService; this.userRepository = userRepository; this.receiptValidationService = receiptValidationService; this.modelMapper = modelMapper; } @Override public List<ReceiptServiceModel> findAllReceiptsByUsername(String username) { return this.receiptRepository .findAllReceiptsByRecipient_UsernameOrderByIssuedOn(username) .stream() .map(r -> this.modelMapper.map(r, ReceiptServiceModel.class)) .collect(Collectors.toList()); } @Override public List<ReceiptServiceModel> findAllReceipts() { return this.receiptRepository .findAll() .stream() .map(r -> this.modelMapper.map(r, ReceiptServiceModel.class)) .collect(Collectors.toList()); } @Override public void receiptRegister(ReceiptServiceModel receiptServiceModel) { if (!receiptValidationService.isValid(receiptServiceModel)){ throw new IllegalArgumentException(); } Receipt receipt = this.modelMapper.map(receiptServiceModel, Receipt.class); this.receiptRepository.save(receipt); } @Override public ReceiptServiceModel getReceiptById(String id) { Receipt receipt = this.receiptRepository.findById(id) .orElseThrow(ReceiptNotFoundException::new); return modelMapper.map(receipt, ReceiptServiceModel.class); } @Override public void createReceipt(String orderId, String name) { Order order = this.orderRepository.findById(orderId) .orElseThrow(OrderNotFoundException::new); User recipient = this.userRepository.findByUsername(name) .orElseThrow(() -> new UsernameNotFoundException(USER_NOT_FOUND_EX_MSG)); Receipt receipt = new Receipt(); receipt.setFee(order.getTotalPrice()); receipt.setIssuedOn(LocalDateTime.now()); receipt.setOrder(order); receipt.setRecipient(recipient); this.receiptRepository.save(receipt); this.orderService.changeOrderStatus(orderId); } @Override public ReceiptServiceModel findReceiptById(String receiptId) { Receipt receipt = this.receiptRepository.findById(receiptId) .orElseThrow(ReceiptNotFoundException::new); return modelMapper.map(receipt, ReceiptServiceModel.class); } }
Imfdj/egg-beehive
app/controller/v1/configurations.js
'use strict'; const Controller = require('egg').Controller; const NodeRSA = require('node-rsa'); /** * @controller 配置 configuration */ class RoleController extends Controller { /** * @apikey * @summary 获取公钥 配置 * @description 获取公钥 配置 * @router get /api/v1/configurations/public_key */ async findRsaPublicKey() { const { ctx, service } = this; const res = await service.configurations.findRsaPublicKey(1); res ? ctx.helper.body.SUCCESS({ ctx, res }) : ctx.helper.body.NOT_FOUND({ ctx }); } /** * @apikey * @summary 更新 配置 * @description 更新 配置 * @router put /api/v1/configurations * @request body configurationPutBodyReq */ async update() { const { ctx, service } = this; const key = new NodeRSA({ b: 512 }); key.setOptions({ encryptionScheme: 'pkcs1' }); const rsa_public_key = key.exportKey('public'); const rsa_private_key = key.exportKey('private'); const body = { ...ctx.request.body, id: 1, rsa_private_key, rsa_public_key, }; ctx.validate(ctx.rule.configurationPutBodyReq, body); const res = await service.configurations.update(body); res && res[0] !== 0 ? ctx.helper.body.CREATED_UPDATE({ ctx }) : ctx.helper.body.NOT_FOUND({ ctx }); } } module.exports = RoleController;
xinwuyun/cattery
node_modules/mathjax/unpacked/localization/zh-hans/FontWarnings.js
<reponame>xinwuyun/cattery /************************************************************* * * MathJax/localization/zh-hans/FontWarnings.js * * Copyright (c) 2009-2019 The MathJax Consortium * * 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. * */ MathJax.Localization.addTranslation("zh-hans","FontWarnings",{ version: "2.7.6", isLoaded: true, strings: { webFont: "MathJax\u4F7F\u7528\u57FA\u4E8EWeb\u7684\u5B57\u4F53\u6765\u663E\u793A\u6B64\u9875\u4E0A\u663E\u793A\u6570\u5B66\u76F8\u5173\u5185\u5BB9\u3002\u8FD9\u5C06\u82B1\u8D39\u8F83\u957F\u65F6\u95F4\u4E0B\u8F7D\uFF0C\u6240\u4EE5\u6211\u4EEC\u5F3A\u70C8\u5EFA\u8BAE\u60A8\u76F4\u63A5\u5728\u60A8\u7684\u64CD\u4F5C\u7CFB\u7EDF\u7684\u5B57\u4F53\u6587\u4EF6\u5939\u4E2D\u5B89\u88C5\u6570\u5B66\u7B26\u53F7\u5B57\u4F53\u4EE5\u4FBF\u7ACB\u523B\u663E\u793A\u3002", imageFonts: "MathJax\u4F7F\u7528\u56FE\u50CF\u5B57\u4F53\u800C\u4E0D\u662F\u672C\u5730\u6216\u57FA\u4E8EWeb\u7684\u5B57\u4F53\u3002\u8FD9\u5C06\u6BD4\u5E73\u5E38\u663E\u793A\u66F4\u6162\uFF0C\u4E14\u76F8\u5173\u6570\u5B66\u7B26\u53F7\u53EF\u80FD\u65E0\u6CD5\u5168\u606F\u7684\u88AB\u6253\u5370\u673A\u6253\u5370\u3002", noFonts: "MathJax\u65E0\u6CD5\u5B9A\u4F4D\u60A8\u4F7F\u7528\u4E2D\u7684\u5B57\u4F53\u4EE5\u663E\u793A\u6570\u5B66\u7B26\u53F7\uFF0C\u56FE\u50CF\u5B57\u4F53\u4EA6\u65E0\u6CD5\u4F7F\u7528\uFF0C\u6240\u4EE5\u6211\u4EEC\u4E0D\u5F97\u4E0D\u8C03\u7528Unicode\u5B57\u7B26\u4EE5\u663E\u793A\u4E4B\u3002\u67D0\u4E9B\u5B57\u7B26\u5C06\u65E0\u6CD5\u6B63\u786E\u663E\u793A\uFF0C\u4E43\u81F3\u5F7B\u5E95\u65E0\u6CD5\u663E\u793A\u3002", webFonts: "\u73B0\u65F6\u5927\u591A\u6570\u6D4F\u89C8\u5668\u5141\u8BB8\u901A\u8FC7\u4E92\u8054\u7F51\u4E0B\u8F7D\u5B57\u4F53\u3002\u66F4\u65B0\u60A8\u7684\u6D4F\u89C8\u5668\u81F3\u6700\u65B0\u7248\u672C\uFF08\u6216\u8005\u5E72\u8106\u66F4\u6362\u6D4F\u89C8\u5668\uFF09\u4EE5\u4FBF\u5728\u6B64\u9875\u9762\u63D0\u9AD8\u6570\u5B66\u7B26\u53F7\u7684\u663E\u793A\u8D28\u91CF\u3002", fonts: "MathJax\u53EF\u4F7F\u7528[STIX fonts](%1)\u6216\u8005[MathJax TeX fonts](%2)\u3002\u4E0B\u8F7D\u5E76\u5B89\u88C5\u8FD9\u4E9B\u5B57\u4F53\u4EE5\u6539\u5584\u60A8\u7684MathJax\u4F53\u9A8C\u3002", STIXPage: "\u6B64\u9875\u9762\u88AB\u8BBE\u8BA1\u4E3A\u4F7F\u7528[STIX fonts](%1)\u3002\u4E0B\u8F7D\u5E76\u5B89\u88C5\u5B83\u4EE5\u589E\u52A0\u60A8\u7684MathJax\u4F53\u9A8C\u3002", TeXPage: "\u6B64\u9875\u9762\u88AB\u8BBE\u8BA1\u4E3A\u4F7F\u7528[MathJax TeX fonts](%1)\u3002\u4E0B\u8F7D\u5E76\u5B89\u88C5\u5B83\u4EE5\u589E\u52A0\u60A8\u7684MathJax\u4F53\u9A8C\u3002" } }); MathJax.Ajax.loadComplete("[MathJax]/localization/zh-hans/FontWarnings.js");
youngmonkeys/ezyfox
ezyfox-bean/src/test/java/com/tvd12/ezyfox/bean/testing/combine3/pack1/C.java
package com.tvd12.ezyfox.bean.testing.combine3.pack1; public interface C { }
3c1u/krkrz
sound/android/OpenSLESAudioDevice.cpp
#ifdef ANDROID #include "tjsCommHead.h" #include <assert.h> #include <SLES/OpenSLES.h> #include <SLES/OpenSLES_Android.h> #include <algorithm> #include "AudioDevice.h" #include "MsgIntf.h" #include "DebugIntf.h" #include "QueueSoundBufferImpl.h" // サウンドHW/ドライバが最終出力するサンプリングレートとバッファサイズ // この値に基づき最適なパラメータを設定する static int TVPSoundNativeFrameRate = 48000; static int TVPSoundNativeFramesPerBuffer = 256; void TVPSetSoundNativeParameter( int rate, int buffSize ) { TVPSoundNativeFrameRate = rate; TVPSoundNativeFramesPerBuffer = buffSize; } //--------------------------------------------------------------------------- void TVPWaveSoundBufferCommitSettings() {} //--------------------------------------------------------------------------- static const tjs_char* TVPGetOpenSLESErrorMessage( SLresult result ) { switch( result ) { case SL_RESULT_SUCCESS: return TJS_W("Success"); case SL_RESULT_PRECONDITIONS_VIOLATED: return TJS_W("Preconditions Violated"); case SL_RESULT_PARAMETER_INVALID: return TJS_W("Parameter Invalid"); case SL_RESULT_MEMORY_FAILURE: return TJS_W("Memory Failure"); case SL_RESULT_RESOURCE_ERROR: return TJS_W("Resource Error"); case SL_RESULT_RESOURCE_LOST: return TJS_W("Resource Lost"); case SL_RESULT_IO_ERROR: return TJS_W("IO Error"); case SL_RESULT_BUFFER_INSUFFICIENT: return TJS_W("Buffer Insufficient"); case SL_RESULT_CONTENT_CORRUPTED: return TJS_W("Content Corrupted"); case SL_RESULT_CONTENT_UNSUPPORTED: return TJS_W("Content Unsupported"); case SL_RESULT_CONTENT_NOT_FOUND: return TJS_W("Content Not Found"); case SL_RESULT_PERMISSION_DENIED: return TJS_W("Permission Denied"); case SL_RESULT_FEATURE_UNSUPPORTED: return TJS_W("Feature Unsupported"); case SL_RESULT_INTERNAL_ERROR: return TJS_W("Internal Error"); case SL_RESULT_UNKNOWN_ERROR: return TJS_W("Unknown Error"); case SL_RESULT_OPERATION_ABORTED: return TJS_W("Operation Aborted"); case SL_RESULT_CONTROL_LOST: return TJS_W("Control Lost"); default: return TJS_W("Unknown Erorr"); } } class OpenSLESAudioStream; class OpenSLESAudioDevice : public iTVPAudioDevice { SLObjectItf EngineObject; SLEngineItf EngineEngine; tjs_int Volume; std::vector<OpenSLESAudioStream*> Children; public: OpenSLESAudioDevice() : EngineObject(nullptr), EngineEngine(nullptr), Volume(100000) {} virtual ~OpenSLESAudioDevice() override {} virtual void Initialize( tTVPAudioInitParam& param ) override; virtual void Uninitialize() override; virtual iTVPAudioStream* CreateAudioStream( tTVPAudioStreamParam& param ) override; virtual void SetMasterVolume(tjs_int vol) override; virtual tjs_int GetMasterVolume() const override; void AddStream( OpenSLESAudioStream* stream ) { Children.push_back( stream ); } void DelStream( OpenSLESAudioStream* stream ) { auto i = std::remove( Children.begin(), Children.end(), stream ); Children.erase( i, Children.end() ); } SLEngineItf GetEngine() { return EngineEngine; } }; class OpenSLESAudioStream : public iTVPAudioStream { OpenSLESAudioDevice* Owner; tTVPAudioStreamParam Param; SLObjectItf OutputMixObject; // 出力オブジェクト SLObjectItf PlayerObject; // プレイヤーオブジェクト SLPlayItf Player; // インタフェース SLAndroidSimpleBufferQueueItf BufferQueue; // バッファキューインタフェース SLVolumeItf Volume; // 音量インタフェース StreamQueueCallback CallbackFunc; void* UserData; tjs_int AudioVolumeValue; tjs_int AudioBalanceValue; public: OpenSLESAudioStream( OpenSLESAudioDevice* parent, const tTVPAudioStreamParam& param ); virtual ~OpenSLESAudioStream(); static void PlayerCallback(SLAndroidSimpleBufferQueueItf, void* context) { OpenSLESAudioStream* stream = reinterpret_cast<OpenSLESAudioStream*>(context); stream->Callback(); } void Callback() { CallbackFunc( this, UserData ); } virtual void SetCallback( StreamQueueCallback callback, void* user ) override { CallbackFunc = callback; UserData = user; } virtual void Enqueue( void *data, size_t size, bool last ) override { (*BufferQueue)->Enqueue(BufferQueue, data, (SLuint32)size ); } virtual void ClearQueue() override { (*BufferQueue)->Clear( BufferQueue ); } virtual tjs_uint32 GetQueuedCount() const { SLAndroidSimpleBufferQueueState state; SLresult result = (*BufferQueue)->GetState( BufferQueue, &state ); if( SL_RESULT_SUCCESS == result ) { return state.count; } else { return 0; } } virtual tjs_uint64 GetSamplesPlayed() const { SLmillisecond pos = 0; SLresult result = (*Player)->GetPosition( Player, &pos ); if( SL_RESULT_SUCCESS == result ) { return (tjs_uint64)Param.SampleRate * (tjs_uint64)pos / 1000ULL; } else { return 0; } } virtual void StartStream() override { (*Player)->SetPlayState( Player, SL_PLAYSTATE_PLAYING ); } virtual void StopStream() override { (*Player)->SetPlayState( Player, SL_PLAYSTATE_STOPPED ); } virtual void AbortStream() override { (*Player)->SetPlayState( Player, SL_PLAYSTATE_STOPPED ); } virtual void SetVolume(tjs_int vol) override { if( AudioVolumeValue != vol ) { SLmillibel maxVol; SLresult result = (*Volume)->GetMaxVolumeLevel( Volume, &maxVol ); if( SL_RESULT_SUCCESS != result ) { TVPThrowExceptionMessage( (TJS_W("SLVolumeItf::GetMaxVolumeLevel Error : ") + ttstr(TVPGetOpenSLESErrorMessage(result))).c_str() ); } SLmillibel vol = static_cast<SLmillibel>( (static_cast<tjs_int>(maxVol)*100000) / vol ); (*Volume)->SetVolumeLevel( Volume, vol ); if( SL_RESULT_SUCCESS != result ) { TVPThrowExceptionMessage( (TJS_W("SLVolumeItf::SetVolumeLevel Error : ") + ttstr(TVPGetOpenSLESErrorMessage(result))).c_str() ); } AudioVolumeValue = vol; } } virtual tjs_int GetVolume() const override { return AudioVolumeValue; } virtual void SetPan(tjs_int pan) override { if( AudioBalanceValue != pan ) { if( pan == 0 ) { SLresult result = (*Volume)->SetStereoPosition( Volume, 0 ); if( SL_RESULT_SUCCESS != result ) { TVPThrowExceptionMessage( (TJS_W("SLVolumeItf::SetStereoPosition Error : ") + ttstr(TVPGetOpenSLESErrorMessage(result))).c_str() ); } result = (*Volume)->EnableStereoPosition( Volume, SL_BOOLEAN_FALSE ); if( SL_RESULT_SUCCESS != result ) { TVPThrowExceptionMessage( (TJS_W("SLVolumeItf::EnableStereoPosition Error : ") + ttstr(TVPGetOpenSLESErrorMessage(result))).c_str() ); } } else { SLboolean panning; SLresult result = (*Volume)->IsEnabledStereoPosition( Volume, &panning ); if( SL_RESULT_SUCCESS != result ) { TVPThrowExceptionMessage( (TJS_W("SLVolumeItf::IsEnabledStereoPosition Error : ") + ttstr(TVPGetOpenSLESErrorMessage(result))).c_str() ); } if( panning != SL_BOOLEAN_TRUE ) { result = (*Volume)->EnableStereoPosition( Volume, SL_BOOLEAN_TRUE ); if( SL_RESULT_SUCCESS != result ) { TVPThrowExceptionMessage( (TJS_W("SLVolumeItf::EnableStereoPosition Error : ") + ttstr(TVPGetOpenSLESErrorMessage(result))).c_str() ); } } SLpermille pos = static_cast<SLpermille>( pan / 100 ); result = (*Volume)->SetStereoPosition( Volume, pos ); // -1000 - 0 - 1000 if( SL_RESULT_SUCCESS != result ) { TVPThrowExceptionMessage( (TJS_W("SLVolumeItf::SetStereoPosition Error : ") + ttstr(TVPGetOpenSLESErrorMessage(result))).c_str() ); } } AudioBalanceValue = pan; } } virtual tjs_int GetPan() const override { return AudioBalanceValue; } // Android ではサポートされない SLRatePitchItf の取得はエラーとなる virtual void SetFrequency(tjs_int freq) {} virtual tjs_int GetFrequency() const { return Param.SampleRate; } }; void OpenSLESAudioDevice::Initialize( tTVPAudioInitParam& param ) { // param は無視。環境依存で設定されている SLresult result; result = slCreateEngine(&EngineObject, 0, nullptr, 0, nullptr, nullptr); assert(SL_RESULT_SUCCESS == result); result = (*EngineObject)->Realize(EngineObject, SL_BOOLEAN_FALSE); assert(SL_RESULT_SUCCESS == result); result = (*EngineObject)->GetInterface(EngineObject, SL_IID_ENGINE, &EngineEngine); assert(SL_RESULT_SUCCESS == result); } void OpenSLESAudioDevice::Uninitialize() { if( EngineObject ) { (*EngineObject)->Destroy(EngineObject); EngineObject = nullptr; } } void OpenSLESAudioDevice::SetMasterVolume(tjs_int vol) { // call to java } tjs_int OpenSLESAudioDevice::GetMasterVolume() const { // call to java return 1; // TODO implements } iTVPAudioStream* OpenSLESAudioDevice::CreateAudioStream( tTVPAudioStreamParam& param ) { OpenSLESAudioStream* stream = new OpenSLESAudioStream( this, param ); AddStream( stream ); return stream; } OpenSLESAudioStream::OpenSLESAudioStream( OpenSLESAudioDevice* parent, const tTVPAudioStreamParam& param ) { Owner = parent; Param = param; SLEngineItf engine = parent->GetEngine(); // 出力オブジェクト作成 SLresult result = (*engine)->CreateOutputMix(engine, &OutputMixObject, 0, nullptr, nullptr ); assert(SL_RESULT_SUCCESS == result); result = (*OutputMixObject)->Realize(OutputMixObject, SL_BOOLEAN_FALSE); assert(SL_RESULT_SUCCESS == result); SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, 2}; SLDataFormat_PCM format_pcm; SLDataSource audioSrc = {&loc_bufq, &format_pcm}; format_pcm.formatType = SL_DATAFORMAT_PCM; format_pcm.numChannels = (SLuint32)param.Channels; format_pcm.samplesPerSec = (SLuint32)param.SampleRate*1000; format_pcm.bitsPerSample = (SLuint32)param.BitsPerSample; format_pcm.containerSize = (SLuint32)param.BitsPerSample; format_pcm.channelMask = (param.Channels == 1) ? SL_SPEAKER_FRONT_CENTER : (SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT); format_pcm.endianness = SL_BYTEORDER_LITTLEENDIAN; SLDataLocator_OutputMix loc_outmix = {SL_DATALOCATOR_OUTPUTMIX, OutputMixObject}; SLDataSink audioSnk = {&loc_outmix, nullptr}; const SLInterfaceID ids[3] = {SL_IID_PLAY, SL_IID_BUFFERQUEUE, SL_IID_VOLUME}; const SLboolean req[3] = {SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE}; // プレイヤーオブジェクト作成 result = (*engine)->CreateAudioPlayer(engine, &PlayerObject, &audioSrc, &audioSnk, 3, ids, req); if( SL_RESULT_SUCCESS != result ) { PlayerObject = nullptr; throw; } result = (*PlayerObject)->Realize(PlayerObject, SL_BOOLEAN_FALSE); assert(SL_RESULT_SUCCESS == result); // インタフェース取得 result = (*PlayerObject)->GetInterface(PlayerObject, SL_IID_PLAY, &Player); assert(SL_RESULT_SUCCESS == result); // バッファキューインタフェース result = (*PlayerObject)->GetInterface(PlayerObject, SL_IID_BUFFERQUEUE, &BufferQueue); assert(SL_RESULT_SUCCESS == result); // 音量インタフェース result = (*PlayerObject)->GetInterface(PlayerObject, SL_IID_VOLUME, &Volume); assert(SL_RESULT_SUCCESS == result); // 再生コールバック設定 result = (*BufferQueue)->RegisterCallback(BufferQueue, OpenSLESAudioStream::PlayerCallback, this); assert(SL_RESULT_SUCCESS == result); } OpenSLESAudioStream::~OpenSLESAudioStream() { if( PlayerObject ) { (*PlayerObject)->Destroy(PlayerObject); PlayerObject = nullptr; } if( OutputMixObject ) { (*OutputMixObject)->Destroy(OutputMixObject); OutputMixObject = nullptr; } if( Owner ) { Owner->DelStream( this ); Owner = nullptr; } } iTVPAudioDevice* TVPCreateAudioDevice() { return new OpenSLESAudioDevice(); } #endif
jarocho105/pre2
erp_desktop_all/src_cartera/com/bydan/erp/cartera/presentation/swing/jinternalframes/SubPreguntaEvaluacionBeanSwingJInternalFrame.java
<gh_stars>1-10 /* *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.cartera.presentation.swing.jinternalframes; import com.bydan.erp.seguridad.business.entity.Usuario; import com.bydan.erp.seguridad.business.entity.ResumenUsuario; import com.bydan.erp.seguridad.business.entity.Opcion; import com.bydan.erp.seguridad.business.entity.PerfilOpcion; import com.bydan.erp.seguridad.business.entity.PerfilCampo; import com.bydan.erp.seguridad.business.entity.PerfilAccion; import com.bydan.erp.seguridad.business.entity.ParametroGeneralSg; import com.bydan.erp.seguridad.business.entity.ParametroGeneralUsuario; import com.bydan.erp.seguridad.business.entity.Modulo; import com.bydan.erp.seguridad.business.entity.Accion; import com.bydan.erp.seguridad.util.SistemaParameterReturnGeneralAdditional; import com.bydan.erp.seguridad.util.SistemaParameterReturnGeneral; //import com.bydan.erp.seguridad.business.entity.PerfilAccion; import com.bydan.erp.seguridad.util.SistemaConstantesFunciones; import com.bydan.erp.seguridad.util.SistemaConstantesFuncionesAdditional; import com.bydan.erp.seguridad.business.logic.SistemaLogicAdditional; import com.bydan.erp.cartera.util.SubPreguntaEvaluacionConstantesFunciones; import com.bydan.erp.cartera.util.SubPreguntaEvaluacionParameterReturnGeneral; //import com.bydan.erp.cartera.util.SubPreguntaEvaluacionParameterGeneral; //import com.bydan.erp.cartera.presentation.report.source.SubPreguntaEvaluacionBean; import com.bydan.framework.erp.business.dataaccess.ConstantesSql; import com.bydan.framework.erp.business.entity.Classe; import com.bydan.framework.erp.business.entity.DatoGeneral; import com.bydan.framework.erp.business.entity.GeneralEntityParameterGeneral; import com.bydan.framework.erp.business.entity.OrderBy; import com.bydan.framework.erp.business.entity.DatoGeneralMinimo; import com.bydan.framework.erp.business.entity.GeneralEntity; import com.bydan.framework.erp.business.entity.Mensajes; import com.bydan.framework.erp.business.entity.GeneralEntityParameterReturnGeneral; //import com.bydan.framework.erp.business.entity.MaintenanceType; import com.bydan.framework.erp.util.MaintenanceType; import com.bydan.framework.erp.util.FuncionesReporte; import com.bydan.framework.erp.business.logic.DatosCliente; import com.bydan.framework.erp.business.logic.Pagination; import com.bydan.erp.cartera.presentation.swing.jinternalframes.auxiliar.*; import com.bydan.framework.erp.presentation.desktop.swing.TablaGeneralTotalModel; import com.bydan.framework.erp.presentation.desktop.swing.TablaGeneralOrderByModel; 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.DateRenderer; import com.bydan.framework.erp.presentation.desktop.swing.DateEditorRenderer; import com.bydan.framework.erp.presentation.desktop.swing.BooleanRenderer; import com.bydan.framework.erp.presentation.desktop.swing.BooleanEditorRenderer; import com.bydan.framework.erp.presentation.desktop.swing.TextFieldRenderer; import com.bydan.framework.erp.presentation.desktop.swing.RunnableProceso; import com.bydan.framework.erp.presentation.desktop.swing.*; //import com.bydan.framework.erp.presentation.desktop.swing.TextFieldEditorRenderer; import com.bydan.framework.erp.presentation.desktop.swing.HeaderRenderer; import com.bydan.framework.erp.presentation.desktop.swing.JInternalFrameBase; import com.bydan.framework.erp.presentation.desktop.swing.FuncionesSwing; import com.bydan.framework.erp.presentation.desktop.swing.MainJFrame; import com.bydan.framework.erp.resources.imagenes.AuxiliarImagenes; import com.bydan.erp.cartera.resources.reportes.AuxiliarReportes; import com.bydan.erp.cartera.util.*; import com.bydan.erp.cartera.business.logic.*; import com.bydan.erp.seguridad.business.logic.*; import com.bydan.erp.contabilidad.business.logic.*; //EJB //PARAMETROS //EJB PARAMETROS import com.bydan.framework.erp.business.logic.*; import com.bydan.framework.erp.util.*; import com.bydan.erp.cartera.business.entity.*; //import com.bydan.framework.erp.business.entity.ConexionBeanFace; //import com.bydan.framework.erp.business.entity.Mensajes; import com.bydan.erp.seguridad.presentation.swing.jinternalframes.*; import com.bydan.erp.contabilidad.presentation.swing.jinternalframes.*; import com.bydan.erp.seguridad.presentation.swing.jinternalframes.auxiliar.*; import com.bydan.erp.contabilidad.presentation.swing.jinternalframes.auxiliar.*; import javax.imageio.ImageIO; import java.net.NetworkInterface; import java.net.InterfaceAddress; import java.net.InetAddress; import javax.naming.InitialContext; import java.lang.Long; import java.util.Date; import java.util.Enumeration; import java.util.Iterator; import java.util.Set; import java.util.HashSet; import java.util.List; import java.util.ArrayList; import java.io.Serializable; import java.util.Hashtable; import java.util.Collections; import java.io.File; import java.io.FileInputStream; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.FileOutputStream; import java.io.InputStream; import java.io.BufferedReader; import java.io.FileReader; import java.util.HashMap; import java.util.Map; import java.io.PrintWriter; import java.sql.SQLException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.stream.StreamSource; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.w3c.dom.Document; import org.w3c.dom.Document; import org.w3c.dom.NodeList; import org.w3c.dom.Node; import org.w3c.dom.Element; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.ss.util.CellRangeAddress; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; 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 net.sf.jasperreports.view.JasperViewer; import org.apache.log4j.Logger; import com.bydan.framework.erp.business.entity.Reporte; //VALIDACION import org.hibernate.validator.ClassValidator; import org.hibernate.validator.InvalidValue; import net.sf.jasperreports.engine.JREmptyDataSource; import net.sf.jasperreports.engine.JasperCompileManager; import net.sf.jasperreports.engine.JasperExportManager; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperPrintManager; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.JasperRunManager; import net.sf.jasperreports.engine.export.JExcelApiExporter; import net.sf.jasperreports.engine.export.JRCsvExporter; import net.sf.jasperreports.engine.export.JRRtfExporter; import net.sf.jasperreports.engine.export.JRXlsExporter; import net.sf.jasperreports.engine.export.JRXlsExporterParameter; import net.sf.jasperreports.engine.util.JRSaver; import net.sf.jasperreports.engine.xml.JRXmlWriter; import com.bydan.erp.cartera.presentation.web.jsf.sessionbean.*; import java.util.EventObject; import javax.swing.*; import javax.swing.border.Border; import javax.swing.border.TitledBorder; import javax.swing.border.EmptyBorder; import javax.swing.event.*; import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableColumn; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import java.awt.*; import java.awt.event.*; import org.jdesktop.beansbinding.Binding.SyncFailure; import org.jdesktop.beansbinding.BindingListener; import org.jdesktop.beansbinding.Bindings; import org.jdesktop.beansbinding.BeanProperty; import org.jdesktop.beansbinding.ELProperty; import org.jdesktop.beansbinding.AutoBinding.UpdateStrategy; import org.jdesktop.beansbinding.PropertyStateEvent; import org.jdesktop.swingbinding.JComboBoxBinding; import org.jdesktop.swingbinding.SwingBindings; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import com.toedter.calendar.JDateChooser; import com.bydan.erp.seguridad.business.entity.*; import com.bydan.erp.contabilidad.business.entity.*; import com.bydan.erp.seguridad.util.*; import com.bydan.erp.contabilidad.util.*; import com.bydan.erp.seguridad.presentation.web.jsf.sessionbean.*; import com.bydan.erp.contabilidad.presentation.web.jsf.sessionbean.*; @SuppressWarnings("unused") public class SubPreguntaEvaluacionBeanSwingJInternalFrame extends SubPreguntaEvaluacionJInternalFrame implements WindowListener,WindowFocusListener { public static final long serialVersionUID = 1L; public static Logger logger = Logger.getLogger(SubPreguntaEvaluacionBeanSwingJInternalFrame.class); public static ClassValidator<SubPreguntaEvaluacion> subpreguntaevaluacionValidator = new ClassValidator<SubPreguntaEvaluacion>(SubPreguntaEvaluacion.class); public InvalidValue[] invalidValues=null; //Ejb Foreign Keys public SubPreguntaEvaluacion subpreguntaevaluacion; public SubPreguntaEvaluacion subpreguntaevaluacionAux; public SubPreguntaEvaluacion subpreguntaevaluacionAnterior;//USADO PARA MANEJAR FOCUS GAINED,LOST public SubPreguntaEvaluacion subpreguntaevaluacionTotales; public Long idSubPreguntaEvaluacionActual; public Long iIdNuevoSubPreguntaEvaluacion=0L; public int rowIndexActual=0; public String sFinalQueryComboEmpresa=""; public List<Empresa> empresasForeignKey; public List<Empresa> getempresasForeignKey() { return empresasForeignKey; } public void setempresasForeignKey(List<Empresa> empresasForeignKey) { this.empresasForeignKey = empresasForeignKey; } //OBJETO FK ACTUAL public Empresa empresaForeignKey; public Empresa getempresaForeignKey() { return empresaForeignKey; } public void setempresaForeignKey(Empresa empresaForeignKey) { this.empresaForeignKey = empresaForeignKey; } public String sFinalQueryComboSucursal=""; public List<Sucursal> sucursalsForeignKey; public List<Sucursal> getsucursalsForeignKey() { return sucursalsForeignKey; } public void setsucursalsForeignKey(List<Sucursal> sucursalsForeignKey) { this.sucursalsForeignKey = sucursalsForeignKey; } //OBJETO FK ACTUAL public Sucursal sucursalForeignKey; public Sucursal getsucursalForeignKey() { return sucursalForeignKey; } public void setsucursalForeignKey(Sucursal sucursalForeignKey) { this.sucursalForeignKey = sucursalForeignKey; } public String sFinalQueryComboPreguntaEvaluacion=""; public List<PreguntaEvaluacion> preguntaevaluacionsForeignKey; public List<PreguntaEvaluacion> getpreguntaevaluacionsForeignKey() { return preguntaevaluacionsForeignKey; } public void setpreguntaevaluacionsForeignKey(List<PreguntaEvaluacion> preguntaevaluacionsForeignKey) { this.preguntaevaluacionsForeignKey = preguntaevaluacionsForeignKey; } //OBJETO FK ACTUAL public PreguntaEvaluacion preguntaevaluacionForeignKey; public PreguntaEvaluacion getpreguntaevaluacionForeignKey() { return preguntaevaluacionForeignKey; } public void setpreguntaevaluacionForeignKey(PreguntaEvaluacion preguntaevaluacionForeignKey) { this.preguntaevaluacionForeignKey = preguntaevaluacionForeignKey; } public String sFinalQueryComboEjercicio=""; public List<Ejercicio> ejerciciosForeignKey; public List<Ejercicio> getejerciciosForeignKey() { return ejerciciosForeignKey; } public void setejerciciosForeignKey(List<Ejercicio> ejerciciosForeignKey) { this.ejerciciosForeignKey = ejerciciosForeignKey; } //OBJETO FK ACTUAL public Ejercicio ejercicioForeignKey; public Ejercicio getejercicioForeignKey() { return ejercicioForeignKey; } public void setejercicioForeignKey(Ejercicio ejercicioForeignKey) { this.ejercicioForeignKey = ejercicioForeignKey; } public String sFinalQueryComboPeriodo=""; public List<Periodo> periodosForeignKey; public List<Periodo> getperiodosForeignKey() { return periodosForeignKey; } public void setperiodosForeignKey(List<Periodo> periodosForeignKey) { this.periodosForeignKey = periodosForeignKey; } //OBJETO FK ACTUAL public Periodo periodoForeignKey; public Periodo getperiodoForeignKey() { return periodoForeignKey; } public void setperiodoForeignKey(Periodo periodoForeignKey) { this.periodoForeignKey = periodoForeignKey; } public Boolean isTienePermisosDetalleEvaluacionProveedor=false; public Boolean getIsTienePermisosDetalleEvaluacionProveedor() { return isTienePermisosDetalleEvaluacionProveedor; } public void setIsTienePermisosDetalleEvaluacionProveedor(Boolean isTienePermisosDetalleEvaluacionProveedor) { this.isTienePermisosDetalleEvaluacionProveedor= isTienePermisosDetalleEvaluacionProveedor; } //FALTA:PARA BUSQUEDAS POR CAMPO EN FORMULARIO public String sFinalQueryGeneral=""; public Boolean isEntroOnLoad=false; public Boolean isErrorGuardar=false; public Boolean isGuardarCambiosEnLote=false; public Boolean isCargarCombosDependencia=false; public Boolean isSeleccionarTodos=false; public Boolean isSeleccionados=false; public Boolean conGraficoReporte=false; public Boolean isPostAccionNuevo=false; public Boolean isPostAccionSinCerrar=false; public Boolean isPostAccionSinMensaje=false; public Boolean esControlTabla=false; public Boolean isPermisoTodoSubPreguntaEvaluacion; public Boolean isPermisoNuevoSubPreguntaEvaluacion; public Boolean isPermisoActualizarSubPreguntaEvaluacion; public Boolean isPermisoActualizarOriginalSubPreguntaEvaluacion; public Boolean isPermisoEliminarSubPreguntaEvaluacion; public Boolean isPermisoGuardarCambiosSubPreguntaEvaluacion; public Boolean isPermisoConsultaSubPreguntaEvaluacion; public Boolean isPermisoBusquedaSubPreguntaEvaluacion; public Boolean isPermisoReporteSubPreguntaEvaluacion; public Boolean isPermisoPaginacionMedioSubPreguntaEvaluacion; public Boolean isPermisoPaginacionAltoSubPreguntaEvaluacion; public Boolean isPermisoPaginacionTodoSubPreguntaEvaluacion; public Boolean isPermisoCopiarSubPreguntaEvaluacion; public Boolean isPermisoVerFormSubPreguntaEvaluacion; public Boolean isPermisoDuplicarSubPreguntaEvaluacion; public Boolean isPermisoOrdenSubPreguntaEvaluacion; public ArrayList<DatoGeneral> arrDatoGeneral; public ArrayList<String> arrDatoGeneralNo; ArrayList<Classe> classesActual=new ArrayList<Classe>(); public List<Accion> accions; public List<Accion> accionsFormulario; public ArrayList<DatoGeneralMinimo> arrDatoGeneralMinimos; public ArrayList<Reporte> tiposArchivosReportes; public ArrayList<Reporte> tiposArchivosReportesDinamico; public ArrayList<Reporte> tiposReportes; public ArrayList<Reporte> tiposReportesDinamico; public ArrayList<Reporte> tiposGraficosReportes; public ArrayList<Reporte> tiposPaginacion; public ArrayList<Reporte> tiposRelaciones; public ArrayList<Reporte> tiposAcciones; public ArrayList<Reporte> tiposAccionesFormulario; public ArrayList<Reporte> tiposSeleccionar; public ArrayList<Reporte> tiposColumnasSelect; public ArrayList<Reporte> tiposRelacionesSelect; public Integer iNumeroPaginacion; public Integer iNumeroPaginacionPagina; public Pagination pagination; public DatosCliente datosCliente; public DatosDeep datosDeep; public String sTipoArchivoReporte=""; public String sTipoArchivoReporteDinamico=""; public String sTipoReporte=""; public String sTipoReporteDinamico=""; public String sTipoGraficoReporte=""; public String sTipoPaginacion=""; public String sTipoRelacion=""; public String sTipoAccion=""; public String sTipoAccionFormulario=""; public String sTipoSeleccionar=""; public String sDetalleReporte=""; public Boolean isMostrarNumeroPaginacion; public String sTipoReporteExtra=""; public String sValorCampoGeneral=""; public Boolean esReporteDinamico=false; public Boolean esReporteAccionProceso=false; public Boolean esRecargarFks=false; public String sPathReporteDinamico=""; public SubPreguntaEvaluacionParameterReturnGeneral subpreguntaevaluacionReturnGeneral; public SubPreguntaEvaluacionParameterReturnGeneral subpreguntaevaluacionParameterGeneral; public DetalleEvaluacionProveedorLogic detalleevaluacionproveedorLogic=null; public DetalleEvaluacionProveedorLogic getDetalleEvaluacionProveedorLogic() { return detalleevaluacionproveedorLogic; } public void setDetalleEvaluacionProveedorLogic(DetalleEvaluacionProveedorLogic detalleevaluacionproveedorLogic) { this.detalleevaluacionproveedorLogic = detalleevaluacionproveedorLogic; } public JasperPrint jasperPrint = null; public Long lIdUsuarioSesion=0L; public Boolean isEsNuevoSubPreguntaEvaluacion=false; public Boolean esParaAccionDesdeFormularioSubPreguntaEvaluacion=false; public Boolean isEsMantenimientoRelacionesRelacionadoUnico=false; public Boolean isEsMantenimientoRelaciones=false; public Boolean isEsMantenimientoRelacionado=false; public Boolean isContieneImagenes=false; //public Boolean conTotales=false; //Viene heredado de JInternalFrameBase //public Boolean esParaBusquedaForeignKey=false; protected SubPreguntaEvaluacionSessionBeanAdditional subpreguntaevaluacionSessionBeanAdditional=null; public SubPreguntaEvaluacionSessionBeanAdditional getSubPreguntaEvaluacionSessionBeanAdditional() { return this.subpreguntaevaluacionSessionBeanAdditional; } public void setSubPreguntaEvaluacionSessionBeanAdditional(SubPreguntaEvaluacionSessionBeanAdditional subpreguntaevaluacionSessionBeanAdditional) { try { this.subpreguntaevaluacionSessionBeanAdditional=subpreguntaevaluacionSessionBeanAdditional; } catch(Exception e) { ; } } protected SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional subpreguntaevaluacionBeanSwingJInternalFrameAdditional=null; //public class SubPreguntaEvaluacionBeanSwingJInternalFrame public SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional getSubPreguntaEvaluacionBeanSwingJInternalFrameAdditional() { return this.subpreguntaevaluacionBeanSwingJInternalFrameAdditional; } public void setSubPreguntaEvaluacionBeanSwingJInternalFrameAdditional(SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional subpreguntaevaluacionBeanSwingJInternalFrameAdditional) { try { this.subpreguntaevaluacionBeanSwingJInternalFrameAdditional=subpreguntaevaluacionBeanSwingJInternalFrameAdditional; } catch(Exception e) { ; } } //ESTA EN PADRE //public SubPreguntaEvaluacionLogic subpreguntaevaluacionLogic; public SistemaLogicAdditional sistemaLogicAdditional; public SubPreguntaEvaluacion subpreguntaevaluacionBean; public SubPreguntaEvaluacionConstantesFunciones subpreguntaevaluacionConstantesFunciones; //public SubPreguntaEvaluacionParameterReturnGeneral subpreguntaevaluacionReturnGeneral; //FK public EmpresaLogic empresaLogic; public SucursalLogic sucursalLogic; public PreguntaEvaluacionLogic preguntaevaluacionLogic; public EjercicioLogic ejercicioLogic; public PeriodoLogic periodoLogic; //PARAMETROS //public List<SubPreguntaEvaluacion> subpreguntaevaluacions; //public List<SubPreguntaEvaluacion> subpreguntaevaluacionsEliminados; //public List<SubPreguntaEvaluacion> subpreguntaevaluacionsAux; public String sAccionMantenimiento=""; public String sAccionBusqueda=""; public String sAccionAdicional=""; public String sUltimaBusqueda=""; public Mensaje mensaje; public String sVisibilidadTablaBusquedas=""; public String sVisibilidadTablaElementos=""; public String sVisibilidadTablaAcciones=""; public Boolean isVisibilidadCeldaNuevoSubPreguntaEvaluacion=false; public Boolean isVisibilidadCeldaDuplicarSubPreguntaEvaluacion=true; public Boolean isVisibilidadCeldaCopiarSubPreguntaEvaluacion=true; public Boolean isVisibilidadCeldaVerFormSubPreguntaEvaluacion=true; public Boolean isVisibilidadCeldaOrdenSubPreguntaEvaluacion=true; public Boolean isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=false; public Boolean isVisibilidadCeldaModificarSubPreguntaEvaluacion=false; public Boolean isVisibilidadCeldaActualizarSubPreguntaEvaluacion=false; public Boolean isVisibilidadCeldaEliminarSubPreguntaEvaluacion=false; public Boolean isVisibilidadCeldaCancelarSubPreguntaEvaluacion=false; public Boolean isVisibilidadCeldaGuardarSubPreguntaEvaluacion=false; public Boolean isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=false; public Boolean isVisibilidadFK_IdEjercicio=false; public Boolean isVisibilidadFK_IdEmpresa=false; public Boolean isVisibilidadFK_IdPeriodo=false; public Boolean isVisibilidadFK_IdPreguntaEvaluacion=false; public Boolean isVisibilidadFK_IdSucursal=false; public Long getiIdNuevoSubPreguntaEvaluacion() { return this.iIdNuevoSubPreguntaEvaluacion; } public void setiIdNuevoSubPreguntaEvaluacion(Long iIdNuevoSubPreguntaEvaluacion) { this.iIdNuevoSubPreguntaEvaluacion = iIdNuevoSubPreguntaEvaluacion; } public Long getidSubPreguntaEvaluacionActual() { return this.idSubPreguntaEvaluacionActual; } public void setidSubPreguntaEvaluacionActual(Long idSubPreguntaEvaluacionActual) { this.idSubPreguntaEvaluacionActual = idSubPreguntaEvaluacionActual; } public int getrowIndexActual() { return this.rowIndexActual; } public void setrowIndexActual(int rowIndexActual) { this.rowIndexActual=rowIndexActual; } public SubPreguntaEvaluacion getsubpreguntaevaluacion() { return this.subpreguntaevaluacion; } public void setsubpreguntaevaluacion(SubPreguntaEvaluacion subpreguntaevaluacion) { this.subpreguntaevaluacion = subpreguntaevaluacion; } public SubPreguntaEvaluacion getsubpreguntaevaluacionAux() { return this.subpreguntaevaluacionAux; } public void setsubpreguntaevaluacionAux(SubPreguntaEvaluacion subpreguntaevaluacionAux) { this.subpreguntaevaluacionAux = subpreguntaevaluacionAux; } public SubPreguntaEvaluacion getsubpreguntaevaluacionAnterior() { return this.subpreguntaevaluacionAnterior; } public void setsubpreguntaevaluacionAnterior(SubPreguntaEvaluacion subpreguntaevaluacionAnterior) { this.subpreguntaevaluacionAnterior = subpreguntaevaluacionAnterior; } public SubPreguntaEvaluacion getsubpreguntaevaluacionTotales() { return this.subpreguntaevaluacionTotales; } public void setsubpreguntaevaluacionTotales(SubPreguntaEvaluacion subpreguntaevaluacionTotales) { this.subpreguntaevaluacionTotales = subpreguntaevaluacionTotales; } public SubPreguntaEvaluacion getsubpreguntaevaluacionBean() { return this.subpreguntaevaluacionBean; } public void setsubpreguntaevaluacionBean(SubPreguntaEvaluacion subpreguntaevaluacionBean) { this.subpreguntaevaluacionBean = subpreguntaevaluacionBean; } public SubPreguntaEvaluacionParameterReturnGeneral getsubpreguntaevaluacionReturnGeneral() { return this.subpreguntaevaluacionReturnGeneral; } public void setsubpreguntaevaluacionReturnGeneral(SubPreguntaEvaluacionParameterReturnGeneral subpreguntaevaluacionReturnGeneral) { this.subpreguntaevaluacionReturnGeneral = subpreguntaevaluacionReturnGeneral; } public Long id_ejercicioFK_IdEjercicio=-1L; public Long getid_ejercicioFK_IdEjercicio() { return this.id_ejercicioFK_IdEjercicio; } public void setid_ejercicioFK_IdEjercicio(Long id_ejercicioFK_IdEjercicio) { this.id_ejercicioFK_IdEjercicio = id_ejercicioFK_IdEjercicio; } public Long id_empresaFK_IdEmpresa=-1L; public Long getid_empresaFK_IdEmpresa() { return this.id_empresaFK_IdEmpresa; } public void setid_empresaFK_IdEmpresa(Long id_empresaFK_IdEmpresa) { this.id_empresaFK_IdEmpresa = id_empresaFK_IdEmpresa; } public Long id_periodoFK_IdPeriodo=-1L; public Long getid_periodoFK_IdPeriodo() { return this.id_periodoFK_IdPeriodo; } public void setid_periodoFK_IdPeriodo(Long id_periodoFK_IdPeriodo) { this.id_periodoFK_IdPeriodo = id_periodoFK_IdPeriodo; } public Long id_pregunta_evaluacionFK_IdPreguntaEvaluacion=-1L; public Long getid_pregunta_evaluacionFK_IdPreguntaEvaluacion() { return this.id_pregunta_evaluacionFK_IdPreguntaEvaluacion; } public void setid_pregunta_evaluacionFK_IdPreguntaEvaluacion(Long id_pregunta_evaluacionFK_IdPreguntaEvaluacion) { this.id_pregunta_evaluacionFK_IdPreguntaEvaluacion = id_pregunta_evaluacionFK_IdPreguntaEvaluacion; } public Long id_sucursalFK_IdSucursal=-1L; public Long getid_sucursalFK_IdSucursal() { return this.id_sucursalFK_IdSucursal; } public void setid_sucursalFK_IdSucursal(Long id_sucursalFK_IdSucursal) { this.id_sucursalFK_IdSucursal = id_sucursalFK_IdSucursal; } //ELEMENTOS TABLAS PARAMETOS //ELEMENTOS TABLAS PARAMETOS_FIN public SubPreguntaEvaluacionLogic getSubPreguntaEvaluacionLogic() { return subpreguntaevaluacionLogic; } public void setSubPreguntaEvaluacionLogic(SubPreguntaEvaluacionLogic subpreguntaevaluacionLogic) { this.subpreguntaevaluacionLogic = subpreguntaevaluacionLogic; } public void setsFinalQueryGeneral(String sFinalQueryGeneral) { this.sFinalQueryGeneral=sFinalQueryGeneral; } public String getsFinalQueryGeneral() { return this.sFinalQueryGeneral; } public Boolean getIsGuardarCambiosEnLote() { return isGuardarCambiosEnLote; } public void setIsGuardarCambiosEnLote(Boolean isGuardarCambiosEnLote) { this.isGuardarCambiosEnLote = isGuardarCambiosEnLote; } public Boolean getIsCargarCombosDependencia() { return isCargarCombosDependencia; } public void setIsCargarCombosDependencia(Boolean isCargarCombosDependencia) { this.isCargarCombosDependencia = isCargarCombosDependencia; } public Boolean getIsEsNuevoSubPreguntaEvaluacion() { return isEsNuevoSubPreguntaEvaluacion; } public void setIsEsNuevoSubPreguntaEvaluacion(Boolean isEsNuevoSubPreguntaEvaluacion) { this.isEsNuevoSubPreguntaEvaluacion = isEsNuevoSubPreguntaEvaluacion; } public Boolean getEsParaAccionDesdeFormularioSubPreguntaEvaluacion() { return esParaAccionDesdeFormularioSubPreguntaEvaluacion; } public void setEsParaAccionDesdeFormularioSubPreguntaEvaluacion(Boolean esParaAccionDesdeFormularioSubPreguntaEvaluacion) { this.esParaAccionDesdeFormularioSubPreguntaEvaluacion = esParaAccionDesdeFormularioSubPreguntaEvaluacion; } public Boolean getIsEsMantenimientoRelacionesRelacionadoUnico() { return isEsMantenimientoRelacionesRelacionadoUnico; } public void setIsEsMantenimientoRelacionesRelacionadoUnico(Boolean isEsMantenimientoRelacionesRelacionadoUnico) { this.isEsMantenimientoRelacionesRelacionadoUnico = isEsMantenimientoRelacionesRelacionadoUnico; } public Boolean getIsEsMantenimientoRelaciones() { return isEsMantenimientoRelaciones; } public void setIsEsMantenimientoRelaciones(Boolean isEsMantenimientoRelaciones) { this.isEsMantenimientoRelaciones = isEsMantenimientoRelaciones; } public Boolean getIsEsMantenimientoRelacionado() { return isEsMantenimientoRelacionado; } public void setIsEsMantenimientoRelacionado(Boolean isEsMantenimientoRelacionado) { this.isEsMantenimientoRelacionado = isEsMantenimientoRelacionado; } public Boolean getesParaBusquedaForeignKey() { return esParaBusquedaForeignKey; } public void setesParaBusquedaForeignKey(Boolean esParaBusquedaForeignKey) { this.esParaBusquedaForeignKey = esParaBusquedaForeignKey; } public Boolean getIsContieneImagenes() { return isContieneImagenes; } public void setIsContieneImagenes(Boolean isContieneImagenes) { this.isContieneImagenes = isContieneImagenes; } public void cargarCombosEmpresasForeignKeyLista(String sFinalQuery)throws Exception { try { this.empresasForeignKey=new ArrayList<Empresa>(); ArrayList<Classe> clases=new ArrayList<Classe>(); ArrayList<String> arrClasses=new ArrayList<String>(); Classe classe=new Classe(); DatosDeep datosDeep=new DatosDeep(false,DeepLoadType.INCLUDE,clases,""); EmpresaLogic empresaLogic=new EmpresaLogic(); //empresaLogic.getEmpresaDataAccess().setIsForForeingKeyData(true); if(this.subpreguntaevaluacionSessionBean==null) { this.subpreguntaevaluacionSessionBean=new SubPreguntaEvaluacionSessionBean(); } if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionEmpresa()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //empresaLogic.getEmpresaDataAccess().setIsForForeingKeyData(true); empresaLogic.getTodosEmpresasWithConnection(sFinalQuery,new Pagination()); this.empresasForeignKey=empresaLogic.getEmpresas(); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } else { if(!this.conCargarMinimo) { this.setVisibilidadBusquedasParaEmpresa(true); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { empresaLogic.getEntityWithConnection(subpreguntaevaluacionSessionBean.getlidEmpresaActual()); this.empresasForeignKey.add(empresaLogic.getEmpresa()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } } catch(Exception e) { throw e; } } public void cargarCombosSucursalsForeignKeyLista(String sFinalQuery)throws Exception { try { this.sucursalsForeignKey=new ArrayList<Sucursal>(); ArrayList<Classe> clases=new ArrayList<Classe>(); ArrayList<String> arrClasses=new ArrayList<String>(); Classe classe=new Classe(); DatosDeep datosDeep=new DatosDeep(false,DeepLoadType.INCLUDE,clases,""); SucursalLogic sucursalLogic=new SucursalLogic(); //sucursalLogic.getSucursalDataAccess().setIsForForeingKeyData(true); if(this.subpreguntaevaluacionSessionBean==null) { this.subpreguntaevaluacionSessionBean=new SubPreguntaEvaluacionSessionBean(); } if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionSucursal()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //sucursalLogic.getSucursalDataAccess().setIsForForeingKeyData(true); sucursalLogic.getTodosSucursalsWithConnection(sFinalQuery,new Pagination()); this.sucursalsForeignKey=sucursalLogic.getSucursals(); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } else { if(!this.conCargarMinimo) { this.setVisibilidadBusquedasParaSucursal(true); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { sucursalLogic.getEntityWithConnection(subpreguntaevaluacionSessionBean.getlidSucursalActual()); this.sucursalsForeignKey.add(sucursalLogic.getSucursal()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } } catch(Exception e) { throw e; } } public void cargarCombosPreguntaEvaluacionsForeignKeyLista(String sFinalQuery)throws Exception { try { this.preguntaevaluacionsForeignKey=new ArrayList<PreguntaEvaluacion>(); ArrayList<Classe> clases=new ArrayList<Classe>(); ArrayList<String> arrClasses=new ArrayList<String>(); Classe classe=new Classe(); DatosDeep datosDeep=new DatosDeep(false,DeepLoadType.INCLUDE,clases,""); PreguntaEvaluacionLogic preguntaevaluacionLogic=new PreguntaEvaluacionLogic(); //preguntaevaluacionLogic.getPreguntaEvaluacionDataAccess().setIsForForeingKeyData(true); if(this.subpreguntaevaluacionSessionBean==null) { this.subpreguntaevaluacionSessionBean=new SubPreguntaEvaluacionSessionBean(); } if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionPreguntaEvaluacion()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //preguntaevaluacionLogic.getPreguntaEvaluacionDataAccess().setIsForForeingKeyData(true); preguntaevaluacionLogic.getTodosPreguntaEvaluacionsWithConnection(sFinalQuery,new Pagination()); this.preguntaevaluacionsForeignKey=preguntaevaluacionLogic.getPreguntaEvaluacions(); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } else { if(!this.conCargarMinimo) { this.setVisibilidadBusquedasParaPreguntaEvaluacion(true); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { preguntaevaluacionLogic.getEntityWithConnection(subpreguntaevaluacionSessionBean.getlidPreguntaEvaluacionActual()); this.preguntaevaluacionsForeignKey.add(preguntaevaluacionLogic.getPreguntaEvaluacion()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } } catch(Exception e) { throw e; } } public void cargarCombosEjerciciosForeignKeyLista(String sFinalQuery)throws Exception { try { this.ejerciciosForeignKey=new ArrayList<Ejercicio>(); ArrayList<Classe> clases=new ArrayList<Classe>(); ArrayList<String> arrClasses=new ArrayList<String>(); Classe classe=new Classe(); DatosDeep datosDeep=new DatosDeep(false,DeepLoadType.INCLUDE,clases,""); EjercicioLogic ejercicioLogic=new EjercicioLogic(); //ejercicioLogic.getEjercicioDataAccess().setIsForForeingKeyData(true); if(this.subpreguntaevaluacionSessionBean==null) { this.subpreguntaevaluacionSessionBean=new SubPreguntaEvaluacionSessionBean(); } if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionEjercicio()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //ejercicioLogic.getEjercicioDataAccess().setIsForForeingKeyData(true); ejercicioLogic.getTodosEjerciciosWithConnection(sFinalQuery,new Pagination()); this.ejerciciosForeignKey=ejercicioLogic.getEjercicios(); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } else { if(!this.conCargarMinimo) { this.setVisibilidadBusquedasParaEjercicio(true); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { ejercicioLogic.getEntityWithConnection(subpreguntaevaluacionSessionBean.getlidEjercicioActual()); this.ejerciciosForeignKey.add(ejercicioLogic.getEjercicio()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } } catch(Exception e) { throw e; } } public void cargarCombosPeriodosForeignKeyLista(String sFinalQuery)throws Exception { try { this.periodosForeignKey=new ArrayList<Periodo>(); ArrayList<Classe> clases=new ArrayList<Classe>(); ArrayList<String> arrClasses=new ArrayList<String>(); Classe classe=new Classe(); DatosDeep datosDeep=new DatosDeep(false,DeepLoadType.INCLUDE,clases,""); PeriodoLogic periodoLogic=new PeriodoLogic(); //periodoLogic.getPeriodoDataAccess().setIsForForeingKeyData(true); if(this.subpreguntaevaluacionSessionBean==null) { this.subpreguntaevaluacionSessionBean=new SubPreguntaEvaluacionSessionBean(); } if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionPeriodo()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //periodoLogic.getPeriodoDataAccess().setIsForForeingKeyData(true); periodoLogic.getTodosPeriodosWithConnection(sFinalQuery,new Pagination()); this.periodosForeignKey=periodoLogic.getPeriodos(); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } else { if(!this.conCargarMinimo) { this.setVisibilidadBusquedasParaPeriodo(true); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { periodoLogic.getEntityWithConnection(subpreguntaevaluacionSessionBean.getlidPeriodoActual()); this.periodosForeignKey.add(periodoLogic.getPeriodo()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } } catch(Exception e) { throw e; } } public void setActualEmpresaForeignKey(Long idEmpresaSeleccionado,Boolean conCombosBusquedas,String sFormularioTipoBusqueda)throws Exception { try { Empresa empresaTemp=null; for(Empresa empresaAux:empresasForeignKey) { if(empresaAux.getId()!=null && empresaAux.getId().equals(idEmpresaSeleccionado)) { empresaTemp=empresaAux; break; } } if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(empresaTemp!=null) { if(this.subpreguntaevaluacion!=null) { this.subpreguntaevaluacion.setEmpresa(empresaTemp); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion.setSelectedItem(empresaTemp); } } else { //jComboBoxid_empresaSubPreguntaEvaluacion.setSelectedItem(empresaTemp); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion.getItemCount()>0) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion.setSelectedIndex(0); } } } } if(conCombosBusquedas) { //BYDAN_BUSQUEDAS } } catch(Exception e) { throw e; } } public String getActualEmpresaForeignKeyDescripcion(Long idEmpresaSeleccionado)throws Exception { String sDescripcion=""; try { Empresa empresaTemp=null; for(Empresa empresaAux:empresasForeignKey) { if(empresaAux.getId()!=null && empresaAux.getId().equals(idEmpresaSeleccionado)) { empresaTemp=empresaAux; break; } } sDescripcion=EmpresaConstantesFunciones.getEmpresaDescripcion(empresaTemp); } catch(Exception e) { throw e; } return sDescripcion; } @SuppressWarnings("rawtypes") public void setActualEmpresaForeignKeyGenerico(Long idEmpresaSeleccionado,JComboBox jComboBoxid_empresaSubPreguntaEvaluacionGenerico)throws Exception { try { Empresa empresaTemp=null; for(Empresa empresaAux:empresasForeignKey) { if(empresaAux.getId()!=null && empresaAux.getId().equals(idEmpresaSeleccionado)) { empresaTemp=empresaAux; break; } } if(empresaTemp!=null) { jComboBoxid_empresaSubPreguntaEvaluacionGenerico.setSelectedItem(empresaTemp); } else { if(jComboBoxid_empresaSubPreguntaEvaluacionGenerico!=null && jComboBoxid_empresaSubPreguntaEvaluacionGenerico.getItemCount()>0) { jComboBoxid_empresaSubPreguntaEvaluacionGenerico.setSelectedIndex(0); } } } catch(Exception e) { throw e; } } public void setActualSucursalForeignKey(Long idSucursalSeleccionado,Boolean conCombosBusquedas,String sFormularioTipoBusqueda)throws Exception { try { Sucursal sucursalTemp=null; for(Sucursal sucursalAux:sucursalsForeignKey) { if(sucursalAux.getId()!=null && sucursalAux.getId().equals(idSucursalSeleccionado)) { sucursalTemp=sucursalAux; break; } } if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(sucursalTemp!=null) { if(this.subpreguntaevaluacion!=null) { this.subpreguntaevaluacion.setSucursal(sucursalTemp); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion.setSelectedItem(sucursalTemp); } } else { //jComboBoxid_sucursalSubPreguntaEvaluacion.setSelectedItem(sucursalTemp); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion.getItemCount()>0) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion.setSelectedIndex(0); } } } } if(conCombosBusquedas) { //BYDAN_BUSQUEDAS } } catch(Exception e) { throw e; } } public String getActualSucursalForeignKeyDescripcion(Long idSucursalSeleccionado)throws Exception { String sDescripcion=""; try { Sucursal sucursalTemp=null; for(Sucursal sucursalAux:sucursalsForeignKey) { if(sucursalAux.getId()!=null && sucursalAux.getId().equals(idSucursalSeleccionado)) { sucursalTemp=sucursalAux; break; } } sDescripcion=SucursalConstantesFunciones.getSucursalDescripcion(sucursalTemp); } catch(Exception e) { throw e; } return sDescripcion; } @SuppressWarnings("rawtypes") public void setActualSucursalForeignKeyGenerico(Long idSucursalSeleccionado,JComboBox jComboBoxid_sucursalSubPreguntaEvaluacionGenerico)throws Exception { try { Sucursal sucursalTemp=null; for(Sucursal sucursalAux:sucursalsForeignKey) { if(sucursalAux.getId()!=null && sucursalAux.getId().equals(idSucursalSeleccionado)) { sucursalTemp=sucursalAux; break; } } if(sucursalTemp!=null) { jComboBoxid_sucursalSubPreguntaEvaluacionGenerico.setSelectedItem(sucursalTemp); } else { if(jComboBoxid_sucursalSubPreguntaEvaluacionGenerico!=null && jComboBoxid_sucursalSubPreguntaEvaluacionGenerico.getItemCount()>0) { jComboBoxid_sucursalSubPreguntaEvaluacionGenerico.setSelectedIndex(0); } } } catch(Exception e) { throw e; } } public void setActualPreguntaEvaluacionForeignKey(Long idPreguntaEvaluacionSeleccionado,Boolean conCombosBusquedas,String sFormularioTipoBusqueda)throws Exception { try { PreguntaEvaluacion preguntaevaluacionTemp=null; for(PreguntaEvaluacion preguntaevaluacionAux:preguntaevaluacionsForeignKey) { if(preguntaevaluacionAux.getId()!=null && preguntaevaluacionAux.getId().equals(idPreguntaEvaluacionSeleccionado)) { preguntaevaluacionTemp=preguntaevaluacionAux; break; } } if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(preguntaevaluacionTemp!=null) { if(this.subpreguntaevaluacion!=null) { this.subpreguntaevaluacion.setPreguntaEvaluacion(preguntaevaluacionTemp); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.setSelectedItem(preguntaevaluacionTemp); } } else { //jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.setSelectedItem(preguntaevaluacionTemp); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.getItemCount()>0) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.setSelectedIndex(0); } } } } if(conCombosBusquedas) { //BYDAN_BUSQUEDAS if(sFormularioTipoBusqueda.equals("FK_IdPreguntaEvaluacion") || sFormularioTipoBusqueda.equals("Todos")){ if(preguntaevaluacionTemp!=null && jComboBoxid_pregunta_evaluacionFK_IdPreguntaEvaluacionSubPreguntaEvaluacion!=null) { jComboBoxid_pregunta_evaluacionFK_IdPreguntaEvaluacionSubPreguntaEvaluacion.setSelectedItem(preguntaevaluacionTemp); } else { if(jComboBoxid_pregunta_evaluacionFK_IdPreguntaEvaluacionSubPreguntaEvaluacion!=null) { //jComboBoxid_pregunta_evaluacionFK_IdPreguntaEvaluacionSubPreguntaEvaluacion.setSelectedItem(preguntaevaluacionTemp); if(jComboBoxid_pregunta_evaluacionFK_IdPreguntaEvaluacionSubPreguntaEvaluacion.getItemCount()>0) { jComboBoxid_pregunta_evaluacionFK_IdPreguntaEvaluacionSubPreguntaEvaluacion.setSelectedIndex(0); } } } } } } catch(Exception e) { throw e; } } public String getActualPreguntaEvaluacionForeignKeyDescripcion(Long idPreguntaEvaluacionSeleccionado)throws Exception { String sDescripcion=""; try { PreguntaEvaluacion preguntaevaluacionTemp=null; for(PreguntaEvaluacion preguntaevaluacionAux:preguntaevaluacionsForeignKey) { if(preguntaevaluacionAux.getId()!=null && preguntaevaluacionAux.getId().equals(idPreguntaEvaluacionSeleccionado)) { preguntaevaluacionTemp=preguntaevaluacionAux; break; } } sDescripcion=PreguntaEvaluacionConstantesFunciones.getPreguntaEvaluacionDescripcion(preguntaevaluacionTemp); } catch(Exception e) { throw e; } return sDescripcion; } @SuppressWarnings("rawtypes") public void setActualPreguntaEvaluacionForeignKeyGenerico(Long idPreguntaEvaluacionSeleccionado,JComboBox jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacionGenerico)throws Exception { try { PreguntaEvaluacion preguntaevaluacionTemp=null; for(PreguntaEvaluacion preguntaevaluacionAux:preguntaevaluacionsForeignKey) { if(preguntaevaluacionAux.getId()!=null && preguntaevaluacionAux.getId().equals(idPreguntaEvaluacionSeleccionado)) { preguntaevaluacionTemp=preguntaevaluacionAux; break; } } if(preguntaevaluacionTemp!=null) { jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacionGenerico.setSelectedItem(preguntaevaluacionTemp); } else { if(jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacionGenerico!=null && jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacionGenerico.getItemCount()>0) { jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacionGenerico.setSelectedIndex(0); } } } catch(Exception e) { throw e; } } public void setActualEjercicioForeignKey(Long idEjercicioSeleccionado,Boolean conCombosBusquedas,String sFormularioTipoBusqueda)throws Exception { try { Ejercicio ejercicioTemp=null; for(Ejercicio ejercicioAux:ejerciciosForeignKey) { if(ejercicioAux.getId()!=null && ejercicioAux.getId().equals(idEjercicioSeleccionado)) { ejercicioTemp=ejercicioAux; break; } } if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(ejercicioTemp!=null) { if(this.subpreguntaevaluacion!=null) { this.subpreguntaevaluacion.setEjercicio(ejercicioTemp); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.setSelectedItem(ejercicioTemp); } } else { //jComboBoxid_ejercicioSubPreguntaEvaluacion.setSelectedItem(ejercicioTemp); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.getItemCount()>0) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.setSelectedIndex(0); } } } } if(conCombosBusquedas) { //BYDAN_BUSQUEDAS } } catch(Exception e) { throw e; } } public String getActualEjercicioForeignKeyDescripcion(Long idEjercicioSeleccionado)throws Exception { String sDescripcion=""; try { Ejercicio ejercicioTemp=null; for(Ejercicio ejercicioAux:ejerciciosForeignKey) { if(ejercicioAux.getId()!=null && ejercicioAux.getId().equals(idEjercicioSeleccionado)) { ejercicioTemp=ejercicioAux; break; } } sDescripcion=EjercicioConstantesFunciones.getEjercicioDescripcion(ejercicioTemp); } catch(Exception e) { throw e; } return sDescripcion; } @SuppressWarnings("rawtypes") public void setActualEjercicioForeignKeyGenerico(Long idEjercicioSeleccionado,JComboBox jComboBoxid_ejercicioSubPreguntaEvaluacionGenerico)throws Exception { try { Ejercicio ejercicioTemp=null; for(Ejercicio ejercicioAux:ejerciciosForeignKey) { if(ejercicioAux.getId()!=null && ejercicioAux.getId().equals(idEjercicioSeleccionado)) { ejercicioTemp=ejercicioAux; break; } } if(ejercicioTemp!=null) { jComboBoxid_ejercicioSubPreguntaEvaluacionGenerico.setSelectedItem(ejercicioTemp); } else { if(jComboBoxid_ejercicioSubPreguntaEvaluacionGenerico!=null && jComboBoxid_ejercicioSubPreguntaEvaluacionGenerico.getItemCount()>0) { jComboBoxid_ejercicioSubPreguntaEvaluacionGenerico.setSelectedIndex(0); } } } catch(Exception e) { throw e; } } public void setActualPeriodoForeignKey(Long idPeriodoSeleccionado,Boolean conCombosBusquedas,String sFormularioTipoBusqueda)throws Exception { try { Periodo periodoTemp=null; for(Periodo periodoAux:periodosForeignKey) { if(periodoAux.getId()!=null && periodoAux.getId().equals(idPeriodoSeleccionado)) { periodoTemp=periodoAux; break; } } if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(periodoTemp!=null) { if(this.subpreguntaevaluacion!=null) { this.subpreguntaevaluacion.setPeriodo(periodoTemp); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.setSelectedItem(periodoTemp); } } else { //jComboBoxid_periodoSubPreguntaEvaluacion.setSelectedItem(periodoTemp); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.getItemCount()>0) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.setSelectedIndex(0); } } } } if(conCombosBusquedas) { //BYDAN_BUSQUEDAS } } catch(Exception e) { throw e; } } public String getActualPeriodoForeignKeyDescripcion(Long idPeriodoSeleccionado)throws Exception { String sDescripcion=""; try { Periodo periodoTemp=null; for(Periodo periodoAux:periodosForeignKey) { if(periodoAux.getId()!=null && periodoAux.getId().equals(idPeriodoSeleccionado)) { periodoTemp=periodoAux; break; } } sDescripcion=PeriodoConstantesFunciones.getPeriodoDescripcion(periodoTemp); } catch(Exception e) { throw e; } return sDescripcion; } @SuppressWarnings("rawtypes") public void setActualPeriodoForeignKeyGenerico(Long idPeriodoSeleccionado,JComboBox jComboBoxid_periodoSubPreguntaEvaluacionGenerico)throws Exception { try { Periodo periodoTemp=null; for(Periodo periodoAux:periodosForeignKey) { if(periodoAux.getId()!=null && periodoAux.getId().equals(idPeriodoSeleccionado)) { periodoTemp=periodoAux; break; } } if(periodoTemp!=null) { jComboBoxid_periodoSubPreguntaEvaluacionGenerico.setSelectedItem(periodoTemp); } else { if(jComboBoxid_periodoSubPreguntaEvaluacionGenerico!=null && jComboBoxid_periodoSubPreguntaEvaluacionGenerico.getItemCount()>0) { jComboBoxid_periodoSubPreguntaEvaluacionGenerico.setSelectedIndex(0); } } } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public void setActualParaGuardarEmpresaForeignKey(SubPreguntaEvaluacion subpreguntaevaluacion,JComboBox jComboBoxid_empresaSubPreguntaEvaluacionGenerico)throws Exception { try { Empresa empresaAux=new Empresa(); if(jComboBoxid_empresaSubPreguntaEvaluacionGenerico==null) { empresaAux=(Empresa)this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion.getSelectedItem(); } else { empresaAux=(Empresa)jComboBoxid_empresaSubPreguntaEvaluacionGenerico.getSelectedItem(); } if(empresaAux!=null && empresaAux.getId()!=null) { subpreguntaevaluacion.setid_empresa(empresaAux.getId()); subpreguntaevaluacion.setempresa_descripcion(SubPreguntaEvaluacionConstantesFunciones.getEmpresaDescripcion(empresaAux)); subpreguntaevaluacion.setEmpresa(empresaAux); } } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public void setActualParaGuardarSucursalForeignKey(SubPreguntaEvaluacion subpreguntaevaluacion,JComboBox jComboBoxid_sucursalSubPreguntaEvaluacionGenerico)throws Exception { try { Sucursal sucursalAux=new Sucursal(); if(jComboBoxid_sucursalSubPreguntaEvaluacionGenerico==null) { sucursalAux=(Sucursal)this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion.getSelectedItem(); } else { sucursalAux=(Sucursal)jComboBoxid_sucursalSubPreguntaEvaluacionGenerico.getSelectedItem(); } if(sucursalAux!=null && sucursalAux.getId()!=null) { subpreguntaevaluacion.setid_sucursal(sucursalAux.getId()); subpreguntaevaluacion.setsucursal_descripcion(SubPreguntaEvaluacionConstantesFunciones.getSucursalDescripcion(sucursalAux)); subpreguntaevaluacion.setSucursal(sucursalAux); } } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public void setActualParaGuardarPreguntaEvaluacionForeignKey(SubPreguntaEvaluacion subpreguntaevaluacion,JComboBox jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacionGenerico)throws Exception { try { PreguntaEvaluacion preguntaevaluacionAux=new PreguntaEvaluacion(); if(jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacionGenerico==null) { preguntaevaluacionAux=(PreguntaEvaluacion)this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.getSelectedItem(); } else { preguntaevaluacionAux=(PreguntaEvaluacion)jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacionGenerico.getSelectedItem(); } if(preguntaevaluacionAux!=null && preguntaevaluacionAux.getId()!=null) { subpreguntaevaluacion.setid_pregunta_evaluacion(preguntaevaluacionAux.getId()); subpreguntaevaluacion.setpreguntaevaluacion_descripcion(SubPreguntaEvaluacionConstantesFunciones.getPreguntaEvaluacionDescripcion(preguntaevaluacionAux)); subpreguntaevaluacion.setPreguntaEvaluacion(preguntaevaluacionAux); } } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public void setActualParaGuardarEjercicioForeignKey(SubPreguntaEvaluacion subpreguntaevaluacion,JComboBox jComboBoxid_ejercicioSubPreguntaEvaluacionGenerico)throws Exception { try { Ejercicio ejercicioAux=new Ejercicio(); if(jComboBoxid_ejercicioSubPreguntaEvaluacionGenerico==null) { ejercicioAux=(Ejercicio)this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.getSelectedItem(); } else { ejercicioAux=(Ejercicio)jComboBoxid_ejercicioSubPreguntaEvaluacionGenerico.getSelectedItem(); } if(ejercicioAux!=null && ejercicioAux.getId()!=null) { subpreguntaevaluacion.setid_ejercicio(ejercicioAux.getId()); subpreguntaevaluacion.setejercicio_descripcion(SubPreguntaEvaluacionConstantesFunciones.getEjercicioDescripcion(ejercicioAux)); subpreguntaevaluacion.setEjercicio(ejercicioAux); } } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public void setActualParaGuardarPeriodoForeignKey(SubPreguntaEvaluacion subpreguntaevaluacion,JComboBox jComboBoxid_periodoSubPreguntaEvaluacionGenerico)throws Exception { try { Periodo periodoAux=new Periodo(); if(jComboBoxid_periodoSubPreguntaEvaluacionGenerico==null) { periodoAux=(Periodo)this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.getSelectedItem(); } else { periodoAux=(Periodo)jComboBoxid_periodoSubPreguntaEvaluacionGenerico.getSelectedItem(); } if(periodoAux!=null && periodoAux.getId()!=null) { if(periodoAux.getid_estado_periodo().equals(0L)) { throw new Exception("Periodo INACTIVO, NO PUEDE GUARDAR LA INFORMACION CONSULTE CON EL ADMINISTRADOR"); } subpreguntaevaluacion.setid_periodo(periodoAux.getId()); subpreguntaevaluacion.setperiodo_descripcion(SubPreguntaEvaluacionConstantesFunciones.getPeriodoDescripcion(periodoAux)); subpreguntaevaluacion.setPeriodo(periodoAux); } } catch(Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) public void cargarCombosFrameEmpresasForeignKey(String sFormularioTipoBusqueda)throws Exception { try { JComboBoxBinding jComboBoxBindingEmpresa=null; if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { } else { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion.removeAllItems(); for(Empresa empresa:this.empresasForeignKey) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion.addItem(empresa); } } } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { } if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { } } if(!this.conCargarMinimo) { } } catch(Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) public void cargarCombosFrameSucursalsForeignKey(String sFormularioTipoBusqueda)throws Exception { try { JComboBoxBinding jComboBoxBindingSucursal=null; if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { } else { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion.removeAllItems(); for(Sucursal sucursal:this.sucursalsForeignKey) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion.addItem(sucursal); } } } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { } if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { } } if(!this.conCargarMinimo) { } } catch(Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) public void cargarCombosFramePreguntaEvaluacionsForeignKey(String sFormularioTipoBusqueda)throws Exception { try { JComboBoxBinding jComboBoxBindingPreguntaEvaluacion=null; if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { } else { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.removeAllItems(); for(PreguntaEvaluacion preguntaevaluacion:this.preguntaevaluacionsForeignKey) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.addItem(preguntaevaluacion); } } } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { } if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { } } if(!this.conCargarMinimo) { if(sFormularioTipoBusqueda.equals("FK_IdPreguntaEvaluacion") || sFormularioTipoBusqueda.equals("Todos")){ //BYDAN_BUSQUEDAS if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { } else { this.jComboBoxid_pregunta_evaluacionFK_IdPreguntaEvaluacionSubPreguntaEvaluacion.removeAllItems(); for(PreguntaEvaluacion preguntaevaluacion:this.preguntaevaluacionsForeignKey) { this.jComboBoxid_pregunta_evaluacionFK_IdPreguntaEvaluacionSubPreguntaEvaluacion.addItem(preguntaevaluacion); } } if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { } } } } catch(Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) public void cargarCombosFrameEjerciciosForeignKey(String sFormularioTipoBusqueda)throws Exception { try { JComboBoxBinding jComboBoxBindingEjercicio=null; if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { } else { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.removeAllItems(); for(Ejercicio ejercicio:this.ejerciciosForeignKey) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.addItem(ejercicio); } } } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { } if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { } } if(!this.conCargarMinimo) { } } catch(Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) public void cargarCombosFramePeriodosForeignKey(String sFormularioTipoBusqueda)throws Exception { try { JComboBoxBinding jComboBoxBindingPeriodo=null; if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { } else { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.removeAllItems(); for(Periodo periodo:this.periodosForeignKey) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.addItem(periodo); } } } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { } if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { } } if(!this.conCargarMinimo) { } } catch(Exception e) { throw e; } } public void setSelectedItemCombosFrameEmpresaForeignKey(Empresa empresa,int iIndexSelected,Boolean conSelectedIndex,Boolean conFormulario,Boolean conBusqueda)throws Exception { try { if(conFormulario) { if(!conSelectedIndex) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion.setSelectedItem(empresa); } } else { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion.setSelectedIndex(iIndexSelected); } } } if(!this.conCargarMinimo) { if(conBusqueda) { //BYDAN_BUSQUEDAS } } } catch(Exception e) { throw e; } } public void setSelectedItemCombosFrameSucursalForeignKey(Sucursal sucursal,int iIndexSelected,Boolean conSelectedIndex,Boolean conFormulario,Boolean conBusqueda)throws Exception { try { if(conFormulario) { if(!conSelectedIndex) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion.setSelectedItem(sucursal); } } else { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion.setSelectedIndex(iIndexSelected); } } } if(!this.conCargarMinimo) { if(conBusqueda) { //BYDAN_BUSQUEDAS } } } catch(Exception e) { throw e; } } public void setSelectedItemCombosFramePreguntaEvaluacionForeignKey(PreguntaEvaluacion preguntaevaluacion,int iIndexSelected,Boolean conSelectedIndex,Boolean conFormulario,Boolean conBusqueda)throws Exception { try { if(conFormulario) { if(!conSelectedIndex) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.setSelectedItem(preguntaevaluacion); } } else { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.setSelectedIndex(iIndexSelected); } } } if(!this.conCargarMinimo) { if(conBusqueda) { //BYDAN_BUSQUEDAS if(!conSelectedIndex) { this.jComboBoxid_pregunta_evaluacionFK_IdPreguntaEvaluacionSubPreguntaEvaluacion.setSelectedItem(preguntaevaluacion); } else { this.jComboBoxid_pregunta_evaluacionFK_IdPreguntaEvaluacionSubPreguntaEvaluacion.setSelectedIndex(iIndexSelected); } } } } catch(Exception e) { throw e; } } public void setSelectedItemCombosFrameEjercicioForeignKey(Ejercicio ejercicio,int iIndexSelected,Boolean conSelectedIndex,Boolean conFormulario,Boolean conBusqueda)throws Exception { try { if(conFormulario) { if(!conSelectedIndex) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.setSelectedItem(ejercicio); } } else { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.setSelectedIndex(iIndexSelected); } } } if(!this.conCargarMinimo) { if(conBusqueda) { //BYDAN_BUSQUEDAS } } } catch(Exception e) { throw e; } } public void setSelectedItemCombosFramePeriodoForeignKey(Periodo periodo,int iIndexSelected,Boolean conSelectedIndex,Boolean conFormulario,Boolean conBusqueda)throws Exception { try { if(conFormulario) { if(!conSelectedIndex) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.setSelectedItem(periodo); } } else { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.setSelectedIndex(iIndexSelected); } } } if(!this.conCargarMinimo) { if(conBusqueda) { //BYDAN_BUSQUEDAS } } } catch(Exception e) { throw e; } } public void refrescarForeignKeysDescripcionesSubPreguntaEvaluacion() throws Exception { //SI FUNCIONA DEEPLOAD ESTO VA AL ULTIMO if(Constantes.ISUSAEJBLOGICLAYER) { SubPreguntaEvaluacionConstantesFunciones.refrescarForeignKeysDescripcionesSubPreguntaEvaluacion(this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { SubPreguntaEvaluacionConstantesFunciones.refrescarForeignKeysDescripcionesSubPreguntaEvaluacion(this.subpreguntaevaluacions); } /* ArrayList<Classe> classes=new ArrayList<Classe>(); classes.add(new Classe(Empresa.class)); classes.add(new Classe(Sucursal.class)); classes.add(new Classe(PreguntaEvaluacion.class)); classes.add(new Classe(Ejercicio.class)); classes.add(new Classe(Periodo.class)); if(Constantes.ISUSAEJBLOGICLAYER) { //USA LOS OBJETOS DE LOGIC DIRECTAMENTE //subpreguntaevaluacionLogic.setSubPreguntaEvaluacions(this.subpreguntaevaluacions); subpreguntaevaluacionLogic.deepLoadsWithConnection(false, DeepLoadType.INCLUDE, classes,""); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } */ } public Integer getiNumeroPaginacion() { return iNumeroPaginacion; } public void setiNumeroPaginacion(Integer iNumeroPaginacion) { this.iNumeroPaginacion= iNumeroPaginacion; } public Integer getiNumeroPaginacionPagina() { return iNumeroPaginacionPagina; } public void setiNumeroPaginacionPagina(Integer iNumeroPaginacionPagina) { this.iNumeroPaginacionPagina= iNumeroPaginacionPagina; } public Boolean getIsSeleccionarTodos() { return this.isSeleccionarTodos; } public void setIsSeleccionarTodos(Boolean isSeleccionarTodos) { this.isSeleccionarTodos= isSeleccionarTodos; } public Boolean getEsControlTabla() { return this.esControlTabla; } public void setEsControlTabla(Boolean esControlTabla) { this.esControlTabla= esControlTabla; } public Boolean getIsSeleccionados() { return this.isSeleccionados; } public void setIsSeleccionados(Boolean isSeleccionados) { this.isSeleccionados= isSeleccionados; } public Boolean getIsPostAccionNuevo() { return this.isPostAccionNuevo; } public void setIsPostAccionNuevo(Boolean isPostAccionNuevo) { this.isPostAccionNuevo= isPostAccionNuevo; } public Boolean getIsPostAccionSinCerrar() { return this.isPostAccionSinCerrar; } public void setIsPostAccionSinCerrar(Boolean isPostAccionSinCerrar) { this.isPostAccionSinCerrar= isPostAccionSinCerrar; } public Boolean getIsPostAccionSinMensaje() { return this.isPostAccionSinMensaje; } public void setIsPostAccionSinMensaje(Boolean isPostAccionSinMensaje) { this.isPostAccionSinMensaje= isPostAccionSinMensaje; } public Boolean getConGraficoReporte() { return this.conGraficoReporte; } public void setConGraficoReporte(Boolean conGraficoReporte) { this.conGraficoReporte= conGraficoReporte; } public ArrayList<Reporte> gettiposArchivosReportes() { return this.tiposArchivosReportes; } public void settiposArchivosReportes(ArrayList<Reporte> tiposArchivosReportes) { this.tiposArchivosReportes = tiposArchivosReportes; } //TIPOS ARCHIVOS DINAMICOS public ArrayList<Reporte> gettiposArchivosReportesDinamico() { return this.tiposArchivosReportesDinamico; } public void settiposArchivosReportesDinamico(ArrayList<Reporte> tiposArchivosReportesDinamico) { this.tiposArchivosReportesDinamico = tiposArchivosReportesDinamico; } //TIPOS REPORTES public ArrayList<Reporte> gettiposReportes() { return this.tiposReportes; } public void settiposReportes(ArrayList<Reporte> tiposReportes) { this.tiposReportes = tiposReportes; } //TIPOS REPORTES public ArrayList<Reporte> gettiposReportesDinamico() { return this.tiposReportesDinamico; } public void settiposReportesDinamico(ArrayList<Reporte> tiposReportesDinamico) { this.tiposReportesDinamico = tiposReportesDinamico; } //TIPOS GRAFICOS REPORTES public ArrayList<Reporte> gettiposGraficosReportes() { return this.tiposGraficosReportes; } public void settiposGraficosReportes(ArrayList<Reporte> tiposGraficosReportes) { this.tiposGraficosReportes = tiposGraficosReportes; } public ArrayList<Reporte> gettiposPaginacion() { return this.tiposPaginacion; } public void settiposPaginacion(ArrayList<Reporte> tiposPaginacion) { this.tiposPaginacion = tiposPaginacion; } public ArrayList<Reporte> gettiposRelaciones() { return this.tiposRelaciones; } public void settiposRelaciones(ArrayList<Reporte> tiposRelaciones) { this.tiposRelaciones= tiposRelaciones; } public ArrayList<Reporte> gettiposAcciones() { return this.tiposAcciones; } public void settiposAcciones(ArrayList<Reporte> tiposAcciones) { this.tiposAcciones = tiposAcciones; } public ArrayList<Reporte> gettiposAccionesFormulario() { return this.tiposAccionesFormulario; } public void settiposAccionesFormulario(ArrayList<Reporte> tiposAccionesFormulario) { this.tiposAccionesFormulario = tiposAccionesFormulario; } public ArrayList<Reporte> gettiposSeleccionar() { return this.tiposSeleccionar; } public void settiposSeleccionar(ArrayList<Reporte> tiposSeleccionar) { this.tiposSeleccionar = tiposSeleccionar; } public ArrayList<Reporte> gettiposColumnasSelect() { return this.tiposColumnasSelect; } public void settiposColumnasSelect(ArrayList<Reporte> tiposColumnasSelect) { this.tiposColumnasSelect = tiposColumnasSelect; } public ArrayList<Reporte> gettiposRelacionesSelect() { return this.tiposRelacionesSelect; } public void settiposRelacionesSelect(ArrayList<Reporte> tiposRelacionesSelect) { this.tiposRelacionesSelect = tiposRelacionesSelect; } public Long getIIdUsuarioSesion() { return lIdUsuarioSesion; } public void setIIdUsuarioSesion(Long lIdUsuarioSesion) { this.lIdUsuarioSesion = lIdUsuarioSesion; } public List<Accion> getAccions() { return this.accions; } public void setAccions(List<Accion> accions) { this.accions = accions; } public List<Accion> getAccionsFormulario() { return this.accionsFormulario; } public void setAccionsFormulario(List<Accion> accionsFormulario) { this.accionsFormulario = accionsFormulario; } public String getsAccionMantenimiento() { return sAccionMantenimiento; } public void setsAccionMantenimiento(String sAccionMantenimiento) { this.sAccionMantenimiento = sAccionMantenimiento; } public String getsAccionBusqueda() { return sAccionBusqueda; } public void setsAccionBusqueda(String sAccionBusqueda) { this.sAccionBusqueda = sAccionBusqueda; } public String getsAccionAdicional() { return sAccionAdicional; } public void setsAccionAdicional(String sAccionAdicional) { this.sAccionAdicional = sAccionAdicional; } public String getsUltimaBusqueda() { return sUltimaBusqueda; } public void setsUltimaBusqueda(String sUltimaBusqueda) { this.sUltimaBusqueda = sUltimaBusqueda; } public String getsTipoArchivoReporte() { return sTipoArchivoReporte; } public void setsTipoArchivoReporte(String sTipoArchivoReporte) { this.sTipoArchivoReporte = sTipoArchivoReporte; } public String getsTipoArchivoReporteDinamico() { return sTipoArchivoReporteDinamico; } public void setsTipoArchivoReporteDinamico(String sTipoArchivoReporteDinamico) { this.sTipoArchivoReporteDinamico = sTipoArchivoReporteDinamico; } public String getsTipoReporte() { return sTipoReporte; } public void setsTipoReporte(String sTipoReporte) { this.sTipoReporte = sTipoReporte; } public String getsTipoReporteDinamico() { return sTipoReporteDinamico; } public void setsTipoReporteDinamico(String sTipoReporteDinamico) { this.sTipoReporteDinamico = sTipoReporteDinamico; } public String getsTipoGraficoReporte() { return sTipoGraficoReporte; } public void setsTipoGraficoReporte(String sTipoGraficoReporte) { this.sTipoGraficoReporte = sTipoGraficoReporte; } public String getsTipoPaginacion() { return sTipoPaginacion; } public void setsTipoPaginacion(String sTipoPaginacion) { this.sTipoPaginacion = sTipoPaginacion; } public String getsTipoRelacion() { return sTipoRelacion; } public void setsTipoRelacion(String sTipoRelacion) { this.sTipoRelacion = sTipoRelacion; } public String getsTipoAccion() { return sTipoAccion; } public void setsTipoAccion(String sTipoAccion) { this.sTipoAccion = sTipoAccion; } public String getsTipoAccionFormulario() { return sTipoAccionFormulario; } public void setsTipoAccionFormulario(String sTipoAccionFormulario) { this.sTipoAccionFormulario = sTipoAccionFormulario; } public String getsTipoSeleccionar() { return sTipoSeleccionar; } public void setsTipoSeleccionar(String sTipoSeleccionar) { this.sTipoSeleccionar = sTipoSeleccionar; } public String getsValorCampoGeneral() { return sValorCampoGeneral; } public void setsValorCampoGeneral(String sValorCampoGeneral) { this.sValorCampoGeneral = sValorCampoGeneral; } public String getsDetalleReporte() { return sDetalleReporte; } public void setsDetalleReporte(String sDetalleReporte) { this.sDetalleReporte = sDetalleReporte; } public String getsTipoReporteExtra() { return sTipoReporteExtra; } public void setsTipoReporteExtra(String sTipoReporteExtra) { this.sTipoReporteExtra = sTipoReporteExtra; } public Boolean getesReporteDinamico() { return esReporteDinamico; } public void setesReporteDinamico(Boolean esReporteDinamico) { this.esReporteDinamico = esReporteDinamico; } public Boolean getesRecargarFks() { return esRecargarFks; } public void setesRecargarFks(Boolean esRecargarFks) { this.esRecargarFks = esRecargarFks; } public Boolean getesReporteAccionProceso() { return esReporteAccionProceso; } public void setesReporteAccionProceso(Boolean esReporteAccionProceso) { this.esReporteAccionProceso= esReporteAccionProceso; } public SubPreguntaEvaluacionParameterReturnGeneral getSubPreguntaEvaluacionParameterGeneral() { return this.subpreguntaevaluacionParameterGeneral; } public void setSubPreguntaEvaluacionParameterGeneral(SubPreguntaEvaluacionParameterReturnGeneral subpreguntaevaluacionParameterGeneral) { this.subpreguntaevaluacionParameterGeneral = subpreguntaevaluacionParameterGeneral; } public String getsPathReporteDinamico() { return sPathReporteDinamico; } public void setsPathReporteDinamico(String sPathReporteDinamico) { this.sPathReporteDinamico = sPathReporteDinamico; } public Boolean getisMostrarNumeroPaginacion() { return isMostrarNumeroPaginacion; } public void setisMostrarNumeroPaginacion(Boolean isMostrarNumeroPaginacion) { this.isMostrarNumeroPaginacion = isMostrarNumeroPaginacion; } public Mensaje getMensaje() { return mensaje; } public void setMensaje(Mensaje mensaje) { this.mensaje = mensaje; } public Boolean getIsPermisoTodoSubPreguntaEvaluacion() { return isPermisoTodoSubPreguntaEvaluacion; } public void setIsPermisoTodoSubPreguntaEvaluacion(Boolean isPermisoTodoSubPreguntaEvaluacion) { this.isPermisoTodoSubPreguntaEvaluacion = isPermisoTodoSubPreguntaEvaluacion; } public Boolean getIsPermisoNuevoSubPreguntaEvaluacion() { return isPermisoNuevoSubPreguntaEvaluacion; } public void setIsPermisoNuevoSubPreguntaEvaluacion(Boolean isPermisoNuevoSubPreguntaEvaluacion) { this.isPermisoNuevoSubPreguntaEvaluacion = isPermisoNuevoSubPreguntaEvaluacion; } public Boolean getIsPermisoActualizarSubPreguntaEvaluacion() { return isPermisoActualizarSubPreguntaEvaluacion; } public void setIsPermisoActualizarSubPreguntaEvaluacion(Boolean isPermisoActualizarSubPreguntaEvaluacion) { this.isPermisoActualizarSubPreguntaEvaluacion = isPermisoActualizarSubPreguntaEvaluacion; } public Boolean getIsPermisoEliminarSubPreguntaEvaluacion() { return isPermisoEliminarSubPreguntaEvaluacion; } public void setIsPermisoEliminarSubPreguntaEvaluacion(Boolean isPermisoEliminarSubPreguntaEvaluacion) { this.isPermisoEliminarSubPreguntaEvaluacion = isPermisoEliminarSubPreguntaEvaluacion; } public Boolean getIsPermisoGuardarCambiosSubPreguntaEvaluacion() { return isPermisoGuardarCambiosSubPreguntaEvaluacion; } public void setIsPermisoGuardarCambiosSubPreguntaEvaluacion(Boolean isPermisoGuardarCambiosSubPreguntaEvaluacion) { this.isPermisoGuardarCambiosSubPreguntaEvaluacion = isPermisoGuardarCambiosSubPreguntaEvaluacion; } public Boolean getIsPermisoConsultaSubPreguntaEvaluacion() { return isPermisoConsultaSubPreguntaEvaluacion; } public void setIsPermisoConsultaSubPreguntaEvaluacion(Boolean isPermisoConsultaSubPreguntaEvaluacion) { this.isPermisoConsultaSubPreguntaEvaluacion = isPermisoConsultaSubPreguntaEvaluacion; } public Boolean getIsPermisoBusquedaSubPreguntaEvaluacion() { return isPermisoBusquedaSubPreguntaEvaluacion; } public void setIsPermisoBusquedaSubPreguntaEvaluacion(Boolean isPermisoBusquedaSubPreguntaEvaluacion) { this.isPermisoBusquedaSubPreguntaEvaluacion = isPermisoBusquedaSubPreguntaEvaluacion; } public Boolean getIsPermisoReporteSubPreguntaEvaluacion() { return isPermisoReporteSubPreguntaEvaluacion; } public void setIsPermisoReporteSubPreguntaEvaluacion(Boolean isPermisoReporteSubPreguntaEvaluacion) { this.isPermisoReporteSubPreguntaEvaluacion = isPermisoReporteSubPreguntaEvaluacion; } public Boolean getIsPermisoPaginacionMedioSubPreguntaEvaluacion() { return isPermisoPaginacionMedioSubPreguntaEvaluacion; } public void setIsPermisoPaginacionMedioSubPreguntaEvaluacion(Boolean isPermisoPaginacionMedioSubPreguntaEvaluacion) { this.isPermisoPaginacionMedioSubPreguntaEvaluacion = isPermisoPaginacionMedioSubPreguntaEvaluacion; } public Boolean getIsPermisoPaginacionTodoSubPreguntaEvaluacion() { return isPermisoPaginacionTodoSubPreguntaEvaluacion; } public void setIsPermisoPaginacionTodoSubPreguntaEvaluacion(Boolean isPermisoPaginacionTodoSubPreguntaEvaluacion) { this.isPermisoPaginacionTodoSubPreguntaEvaluacion = isPermisoPaginacionTodoSubPreguntaEvaluacion; } public Boolean getIsPermisoPaginacionAltoSubPreguntaEvaluacion() { return isPermisoPaginacionAltoSubPreguntaEvaluacion; } public void setIsPermisoPaginacionAltoSubPreguntaEvaluacion(Boolean isPermisoPaginacionAltoSubPreguntaEvaluacion) { this.isPermisoPaginacionAltoSubPreguntaEvaluacion = isPermisoPaginacionAltoSubPreguntaEvaluacion; } public Boolean getIsPermisoCopiarSubPreguntaEvaluacion() { return isPermisoCopiarSubPreguntaEvaluacion; } public void setIsPermisoCopiarSubPreguntaEvaluacion(Boolean isPermisoCopiarSubPreguntaEvaluacion) { this.isPermisoCopiarSubPreguntaEvaluacion = isPermisoCopiarSubPreguntaEvaluacion; } public Boolean getIsPermisoVerFormSubPreguntaEvaluacion() { return isPermisoVerFormSubPreguntaEvaluacion; } public void setIsPermisoVerFormSubPreguntaEvaluacion(Boolean isPermisoVerFormSubPreguntaEvaluacion) { this.isPermisoVerFormSubPreguntaEvaluacion = isPermisoVerFormSubPreguntaEvaluacion; } public Boolean getIsPermisoDuplicarSubPreguntaEvaluacion() { return isPermisoDuplicarSubPreguntaEvaluacion; } public void setIsPermisoDuplicarSubPreguntaEvaluacion(Boolean isPermisoDuplicarSubPreguntaEvaluacion) { this.isPermisoDuplicarSubPreguntaEvaluacion = isPermisoDuplicarSubPreguntaEvaluacion; } public Boolean getIsPermisoOrdenSubPreguntaEvaluacion() { return isPermisoOrdenSubPreguntaEvaluacion; } public void setIsPermisoOrdenSubPreguntaEvaluacion(Boolean isPermisoOrdenSubPreguntaEvaluacion) { this.isPermisoOrdenSubPreguntaEvaluacion = isPermisoOrdenSubPreguntaEvaluacion; } public String getsVisibilidadTablaBusquedas() { return sVisibilidadTablaBusquedas; } public void setsVisibilidadTablaBusquedas(String sVisibilidadTablaBusquedas) { this.sVisibilidadTablaBusquedas = sVisibilidadTablaBusquedas; } public String getsVisibilidadTablaElementos() { return sVisibilidadTablaElementos; } public void setsVisibilidadTablaElementos(String sVisibilidadTablaElementos) { this.sVisibilidadTablaElementos = sVisibilidadTablaElementos; } public String getsVisibilidadTablaAcciones() { return sVisibilidadTablaAcciones; } public void setsVisibilidadTablaAcciones(String sVisibilidadTablaAcciones) { this.sVisibilidadTablaAcciones = sVisibilidadTablaAcciones; } public Boolean getIsVisibilidadCeldaNuevoSubPreguntaEvaluacion() { return isVisibilidadCeldaNuevoSubPreguntaEvaluacion; } public void setIsVisibilidadCeldaNuevoSubPreguntaEvaluacion(Boolean isVisibilidadCeldaNuevoSubPreguntaEvaluacion) { this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion = isVisibilidadCeldaNuevoSubPreguntaEvaluacion; } public Boolean getIsVisibilidadCeldaDuplicarSubPreguntaEvaluacion() { return isVisibilidadCeldaDuplicarSubPreguntaEvaluacion; } public void setIsVisibilidadCeldaDuplicarSubPreguntaEvaluacion(Boolean isVisibilidadCeldaDuplicarSubPreguntaEvaluacion) { this.isVisibilidadCeldaDuplicarSubPreguntaEvaluacion = isVisibilidadCeldaDuplicarSubPreguntaEvaluacion; } public Boolean getIsVisibilidadCeldaCopiarSubPreguntaEvaluacion() { return isVisibilidadCeldaCopiarSubPreguntaEvaluacion; } public void setIsVisibilidadCeldaCopiarSubPreguntaEvaluacion(Boolean isVisibilidadCeldaCopiarSubPreguntaEvaluacion) { this.isVisibilidadCeldaCopiarSubPreguntaEvaluacion = isVisibilidadCeldaCopiarSubPreguntaEvaluacion; } public Boolean getIsVisibilidadCeldaVerFormSubPreguntaEvaluacion() { return isVisibilidadCeldaVerFormSubPreguntaEvaluacion; } public void setIsVisibilidadCeldaVerFormSubPreguntaEvaluacion(Boolean isVisibilidadCeldaVerFormSubPreguntaEvaluacion) { this.isVisibilidadCeldaVerFormSubPreguntaEvaluacion = isVisibilidadCeldaVerFormSubPreguntaEvaluacion; } public Boolean getIsVisibilidadCeldaOrdenSubPreguntaEvaluacion() { return isVisibilidadCeldaOrdenSubPreguntaEvaluacion; } public void setIsVisibilidadCeldaOrdenSubPreguntaEvaluacion(Boolean isVisibilidadCeldaOrdenSubPreguntaEvaluacion) { this.isVisibilidadCeldaOrdenSubPreguntaEvaluacion = isVisibilidadCeldaOrdenSubPreguntaEvaluacion; } public Boolean getIsVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion() { return isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion; } public void setIsVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion(Boolean isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion) { this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion = isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion; } public Boolean getIsVisibilidadCeldaModificarSubPreguntaEvaluacion() { return isVisibilidadCeldaModificarSubPreguntaEvaluacion; } public void setIsVisibilidadCeldaModificarSubPreguntaEvaluacion(Boolean isVisibilidadCeldaModificarSubPreguntaEvaluacion) { this.isVisibilidadCeldaModificarSubPreguntaEvaluacion = isVisibilidadCeldaModificarSubPreguntaEvaluacion; } public Boolean getIsVisibilidadCeldaActualizarSubPreguntaEvaluacion() { return isVisibilidadCeldaActualizarSubPreguntaEvaluacion; } public void setIsVisibilidadCeldaActualizarSubPreguntaEvaluacion(Boolean isVisibilidadCeldaActualizarSubPreguntaEvaluacion) { this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion = isVisibilidadCeldaActualizarSubPreguntaEvaluacion; } public Boolean getIsVisibilidadCeldaEliminarSubPreguntaEvaluacion() { return isVisibilidadCeldaEliminarSubPreguntaEvaluacion; } public void setIsVisibilidadCeldaEliminarSubPreguntaEvaluacion(Boolean isVisibilidadCeldaEliminarSubPreguntaEvaluacion) { this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion = isVisibilidadCeldaEliminarSubPreguntaEvaluacion; } public Boolean getIsVisibilidadCeldaCancelarSubPreguntaEvaluacion() { return isVisibilidadCeldaCancelarSubPreguntaEvaluacion; } public void setIsVisibilidadCeldaCancelarSubPreguntaEvaluacion(Boolean isVisibilidadCeldaCancelarSubPreguntaEvaluacion) { this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion = isVisibilidadCeldaCancelarSubPreguntaEvaluacion; } public Boolean getIsVisibilidadCeldaGuardarSubPreguntaEvaluacion() { return isVisibilidadCeldaGuardarSubPreguntaEvaluacion; } public void setIsVisibilidadCeldaGuardarSubPreguntaEvaluacion(Boolean isVisibilidadCeldaGuardarSubPreguntaEvaluacion) { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion = isVisibilidadCeldaGuardarSubPreguntaEvaluacion; } public Boolean getIsVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion() { return isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion; } public void setIsVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion(Boolean isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion) { this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion = isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion; } public SubPreguntaEvaluacionSessionBean getsubpreguntaevaluacionSessionBean() { return this.subpreguntaevaluacionSessionBean; } public void setsubpreguntaevaluacionSessionBean(SubPreguntaEvaluacionSessionBean subpreguntaevaluacionSessionBean) { this.subpreguntaevaluacionSessionBean=subpreguntaevaluacionSessionBean; } public Boolean getisVisibilidadFK_IdEjercicio() { return this.isVisibilidadFK_IdEjercicio; } public void setisVisibilidadFK_IdEjercicio(Boolean isVisibilidadFK_IdEjercicio) { this.isVisibilidadFK_IdEjercicio=isVisibilidadFK_IdEjercicio; } public Boolean getisVisibilidadFK_IdEmpresa() { return this.isVisibilidadFK_IdEmpresa; } public void setisVisibilidadFK_IdEmpresa(Boolean isVisibilidadFK_IdEmpresa) { this.isVisibilidadFK_IdEmpresa=isVisibilidadFK_IdEmpresa; } public Boolean getisVisibilidadFK_IdPeriodo() { return this.isVisibilidadFK_IdPeriodo; } public void setisVisibilidadFK_IdPeriodo(Boolean isVisibilidadFK_IdPeriodo) { this.isVisibilidadFK_IdPeriodo=isVisibilidadFK_IdPeriodo; } public Boolean getisVisibilidadFK_IdPreguntaEvaluacion() { return this.isVisibilidadFK_IdPreguntaEvaluacion; } public void setisVisibilidadFK_IdPreguntaEvaluacion(Boolean isVisibilidadFK_IdPreguntaEvaluacion) { this.isVisibilidadFK_IdPreguntaEvaluacion=isVisibilidadFK_IdPreguntaEvaluacion; } public Boolean getisVisibilidadFK_IdSucursal() { return this.isVisibilidadFK_IdSucursal; } public void setisVisibilidadFK_IdSucursal(Boolean isVisibilidadFK_IdSucursal) { this.isVisibilidadFK_IdSucursal=isVisibilidadFK_IdSucursal; } public void setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion)throws Exception { try { this.setActualParaGuardarEmpresaForeignKey(subpreguntaevaluacion,null); this.setActualParaGuardarSucursalForeignKey(subpreguntaevaluacion,null); this.setActualParaGuardarPreguntaEvaluacionForeignKey(subpreguntaevaluacion,null); this.setActualParaGuardarEjercicioForeignKey(subpreguntaevaluacion,null); this.setActualParaGuardarPeriodoForeignKey(subpreguntaevaluacion,null); } catch(Exception e) { throw e; } } public void cargarLicenciaCliente(DatosCliente datosCliente) throws Exception { Boolean existe=false; try { InputStream reportFile=null; String sPath=this.parametroGeneralUsuario.getpath_exportar()+"erp_bydan/license/license.xml"; reportFile = new FileInputStream(sPath); Document documentBuilder=null; if(this.constantes2.DOCUMENT_BUILDER==null) { documentBuilder=Funciones2.parseXml(reportFile); } else { documentBuilder=this.constantes2.DOCUMENT_BUILDER; } //GlobalSeguridad.readXml(documentBuilder); String sNamePCServerLicencia=""; String sClaveSistemaLicencia=""; Date dFechaServerLicencia=null; //CARGAR ELEMENTOS DE LICENCIA NodeList nodeList = documentBuilder.getElementsByTagName("Licencia"); for (int iIndice = 0; iIndice < nodeList.getLength(); iIndice++) { Node node = nodeList.item(iIndice); if (node.getNodeType() == Node.ELEMENT_NODE) { Element element = (Element) node; sNamePCServerLicencia=element.getElementsByTagName("NombrePc").item(0).getTextContent(); sClaveSistemaLicencia=element.getElementsByTagName("ClaveSistema").item(0).getTextContent(); existe=true; break; } } if(existe) { datosCliente.setsClaveSistema(sClaveSistemaLicencia); if(!datosCliente.getsNamePCServer().equals(sNamePCServerLicencia) && !datosCliente.getsNamePCServer().equals("")) { datosCliente.setsNamePCServer(sNamePCServerLicencia); } } else { throw new Exception("NO EXISTE LICENCIA O NO ESTA BIEN FORMADO"); } } catch(Exception e) { throw new Exception("NO EXISTE LICENCIA O NO ESTA BIEN FORMADO"); } } public void cargarDatosCliente() throws Exception { String sPrimerMacAddress=""; String sHostName=""; String sHostIp=""; String sHostUser=""; sPrimerMacAddress=FuncionesNetwork.getPrimerMacAddress(); sHostName=FuncionesNetwork.getHostName(); sHostIp=FuncionesNetwork.getHostIp(); sHostUser=FuncionesNetwork.getHostUser(); this.datosCliente=new DatosCliente(); if(lIdUsuarioSesion!=null){datosCliente.setIdUsuario(this.lIdUsuarioSesion);} //SERVIDOR WEB Y TALVEZ SERVIDOR SWING WINDOWS this.datosCliente.setsUsuarioPCServer(sHostUser); this.datosCliente.setsNamePCServer(sHostName); this.datosCliente.setsIPPCServer(sHostIp); this.datosCliente.setsMacAddressPCServer(sPrimerMacAddress); //CLIENTE SWING WINDOWS this.datosCliente.setIsClienteWeb(false); this.datosCliente.setsUsuarioPC(sHostUser); this.datosCliente.setsNamePC(sHostName); this.datosCliente.setsIPPC(sHostIp); this.datosCliente.setsMacAddressPC(sPrimerMacAddress); //this.cargarLicenciaCliente(this.datosCliente); } public void bugActualizarReferenciaActual(SubPreguntaEvaluacion subpreguntaevaluacion,SubPreguntaEvaluacion subpreguntaevaluacionAux) throws Exception { //ARCHITECTURE //EL ID NEGATIVO GUARDADO EN ORIGINAL SIRVE PARA VERIFICAR Y ACTUALIZAR EL REGISTRO NUEVO (ID,VERSIONROW) this.setCamposBaseDesdeOriginalSubPreguntaEvaluacion(subpreguntaevaluacion); //POR BUG: EL OBJETO ACTUAL SE PERDIA, POR LO QUE SE GUARDA TAMBIEN VALORES EN AUX Y LUEGO DESPUES DEL MENSAJE SE HACE REFERENCIA EL OBJETO ACTUAL AL AUX subpreguntaevaluacionAux.setId(subpreguntaevaluacion.getId()); subpreguntaevaluacionAux.setVersionRow(subpreguntaevaluacion.getVersionRow()); } public void ejecutarMantenimiento(MaintenanceType maintenanceType)throws Exception { try { //this.startProcessSubPreguntaEvaluacion(); int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); //PUEDE SER -1 CUANDO SE ELIMINA EN GUARDAR CAMBIOS if(intSelectedRow>=0 && maintenanceType!=MaintenanceType.GUARDARCAMBIOS) { //SE PIEDE INDICE SELECTED CON FILA TOTALES, ASEGURARSE QUE OBJETO ACTUAL ESTE EN FORMULARIO //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE ||Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL_TABLA) { //this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); } this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } //LUEGO DE TRAER DATOS CORRESPONDIENTES QUE COINCIDA LISTA TABLA QUITO FILA TOTALES if(this.conTotales) { //MEJOR LO DEJO, SI EXISTE EXCEPCION SE PIEDE FILA TOTALES Y ORDEN INDICE FILA ACTUAL //this.quitarFilaTotales(); } this.cargarDatosCliente(); this.datosDeep=new DatosDeep(); //SE CAMBIA ESTADOS CON ERROR, ENTONCES SE EJECUTA ANTES //this.invalidValues = subpreguntaevaluacionValidator.getInvalidValues(this.subpreguntaevaluacion); //if(this.invalidValues==null || this.invalidValues.length<=0) { subpreguntaevaluacionLogic.setDatosCliente(datosCliente); subpreguntaevaluacionLogic.setIsConDeep(false); if(maintenanceType==MaintenanceType.NUEVO) { subpreguntaevaluacionAux=new SubPreguntaEvaluacion(); subpreguntaevaluacionAux.setIsNew(true); subpreguntaevaluacionAux.setIsChanged(true); subpreguntaevaluacionAux.setSubPreguntaEvaluacionOriginal(this.subpreguntaevaluacion); subpreguntaevaluacionAux.setId(this.subpreguntaevaluacion.getId()); subpreguntaevaluacionAux.setVersionRow(this.subpreguntaevaluacion.getVersionRow()); subpreguntaevaluacionAux.setid_empresa(this.subpreguntaevaluacion.getid_empresa()); subpreguntaevaluacionAux.setid_sucursal(this.subpreguntaevaluacion.getid_sucursal()); subpreguntaevaluacionAux.setid_pregunta_evaluacion(this.subpreguntaevaluacion.getid_pregunta_evaluacion()); subpreguntaevaluacionAux.setid_ejercicio(this.subpreguntaevaluacion.getid_ejercicio()); subpreguntaevaluacionAux.setid_periodo(this.subpreguntaevaluacion.getid_periodo()); subpreguntaevaluacionAux.setorden(this.subpreguntaevaluacion.getorden()); subpreguntaevaluacionAux.setpregunta(this.subpreguntaevaluacion.getpregunta()); subpreguntaevaluacionAux.setporcentaje_si(this.subpreguntaevaluacion.getporcentaje_si()); subpreguntaevaluacionAux.setcon_factura(this.subpreguntaevaluacion.getcon_factura()); subpreguntaevaluacionAux.setcon_orden_compra(this.subpreguntaevaluacion.getcon_orden_compra()); subpreguntaevaluacionAux.setcon_completo(this.subpreguntaevaluacion.getcon_completo()); subpreguntaevaluacionAux.setcon_a_tiempo(this.subpreguntaevaluacion.getcon_a_tiempo()); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //NO ENTENDIBLE PORQUE PONER //if(this.subpreguntaevaluacionSessionBean.getEstaModoGuardarRelaciones() // || this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { actualizarLista(subpreguntaevaluacionAux,subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); //} } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { actualizarLista(subpreguntaevaluacionAux,subpreguntaevaluacions); } //ARCHITECTURE if(!isGuardarCambiosEnLote && !this.subpreguntaevaluacionSessionBean.getEstaModoGuardarRelaciones() && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.saveSubPreguntaEvaluacions();//WithConnection //subpreguntaevaluacionLogic.getSetVersionRowSubPreguntaEvaluacions();//WithConnection } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE //POR BUG: EL OBJETO ACTUAL SE PERDIA, POR LO QUE SE GUARDA TAMBIEN VALORES EN AUX Y LUEGO DESPUES DEL MENSAJE SE HACE REFERENCIA EL OBJETO ACTUAL AL AUX this.bugActualizarReferenciaActual(this.subpreguntaevaluacion,subpreguntaevaluacionAux); this.refrescarForeignKeysDescripcionesSubPreguntaEvaluacion(); } else { //CUANDO ES MANTENIMIENTO MAESTRO DETALLE if(this.subpreguntaevaluacionSessionBean.getEstaModoGuardarRelaciones()) { //GUARDAR RELACIONES //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.getDetalleEvaluacionProveedors().addAll(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorsEliminados); } else if(Constantes.ISUSAEJBREMOTE ||Constantes.ISUSAEJBHOME) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedors.addAll(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorsEliminados); } //ARCHITECTURE if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { //QUITAR FILA TOTAL //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.conTotales) {/*this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.quitarFilaTotales();*/} } else if(Constantes.ISUSAEJBREMOTE ||Constantes.ISUSAEJBHOME) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.conTotales) {/*this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.quitarFilaTotales();*/} } //ARCHITECTURE //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.saveSubPreguntaEvaluacionRelaciones(subpreguntaevaluacionAux,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.getDetalleEvaluacionProveedors());//WithConnection //subpreguntaevaluacionLogic.getSetVersionRowSubPreguntaEvaluacions();//WithConnection } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE //POR BUG: EL OBJETO ACTUAL SE PERDIA, POR LO QUE SE GUARDA TAMBIEN VALORES EN AUX Y LUEGO DESPUES DEL MENSAJE SE HACE REFERENCIA EL OBJETO ACTUAL AL AUX this.bugActualizarReferenciaActual(this.subpreguntaevaluacion,subpreguntaevaluacionAux); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.setDetalleEvaluacionProveedors(new ArrayList<DetalleEvaluacionProveedor>()); } else if(Constantes.ISUSAEJBREMOTE ||Constantes.ISUSAEJBHOME) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedors= new ArrayList<DetalleEvaluacionProveedor>(); } //ARCHITECTURE } else { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.conTotales) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.quitarFilaTotales();} subpreguntaevaluacionAux.setDetalleEvaluacionProveedors(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.getDetalleEvaluacionProveedors()); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { if(this.subpreguntaevaluacionSessionBean.getEstaModoGuardarRelaciones() || this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { actualizarLista(subpreguntaevaluacionAux,subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { actualizarLista(subpreguntaevaluacionAux,subpreguntaevaluacions); } //ARCHITECTURE //AQUI EL ID NEGATIVO ES EL ID BUSCADO, YA QUE NO SE GENERA OTRO EN LA DB POR INGRESAR UNO NUEVO //POR BUG: EL OBJETO ACTUAL SE PERDIA, POR LO QUE SE GUARDA TAMBIEN VALORES EN AUX Y LUEGO DESPUES DEL MENSAJE SE HACE REFERENCIA EL OBJETO ACTUAL AL AUX //this.bugActualizarReferenciaActual(this.subpreguntaevaluacion,subpreguntaevaluacionAux); } } } } else if(maintenanceType==MaintenanceType.ACTUALIZAR) { subpreguntaevaluacionAux=new SubPreguntaEvaluacion(); //PUEDE QUE SE ACTUALIZE ALGUN REGISTRO NUEVO if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado() || (this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado() && this.subpreguntaevaluacion.getId()>=0)) { subpreguntaevaluacionAux.setIsNew(false); } subpreguntaevaluacionAux.setIsDeleted(false); subpreguntaevaluacionAux.setId(this.subpreguntaevaluacion.getId()); subpreguntaevaluacionAux.setVersionRow(this.subpreguntaevaluacion.getVersionRow()); subpreguntaevaluacionAux.setid_empresa(this.subpreguntaevaluacion.getid_empresa()); subpreguntaevaluacionAux.setid_sucursal(this.subpreguntaevaluacion.getid_sucursal()); subpreguntaevaluacionAux.setid_pregunta_evaluacion(this.subpreguntaevaluacion.getid_pregunta_evaluacion()); subpreguntaevaluacionAux.setid_ejercicio(this.subpreguntaevaluacion.getid_ejercicio()); subpreguntaevaluacionAux.setid_periodo(this.subpreguntaevaluacion.getid_periodo()); subpreguntaevaluacionAux.setorden(this.subpreguntaevaluacion.getorden()); subpreguntaevaluacionAux.setpregunta(this.subpreguntaevaluacion.getpregunta()); subpreguntaevaluacionAux.setporcentaje_si(this.subpreguntaevaluacion.getporcentaje_si()); subpreguntaevaluacionAux.setcon_factura(this.subpreguntaevaluacion.getcon_factura()); subpreguntaevaluacionAux.setcon_orden_compra(this.subpreguntaevaluacion.getcon_orden_compra()); subpreguntaevaluacionAux.setcon_completo(this.subpreguntaevaluacion.getcon_completo()); subpreguntaevaluacionAux.setcon_a_tiempo(this.subpreguntaevaluacion.getcon_a_tiempo()); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { actualizarLista(subpreguntaevaluacionAux,subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { actualizarLista(subpreguntaevaluacionAux,subpreguntaevaluacions); } //ARCHITECTURE if(!isGuardarCambiosEnLote && !this.subpreguntaevaluacionSessionBean.getEstaModoGuardarRelaciones() && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.saveSubPreguntaEvaluacions();//WithConnection //subpreguntaevaluacionLogic.getSetVersionRowSubPreguntaEvaluacions();//WithConnection } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE //TALVEZ ESTA DEMAS POR SER UPDATE //POR BUG: EL OBJETO ACTUAL SE PERDIA, POR LO QUE SE GUARDA TAMBIEN VALORES EN AUX Y LUEGO DESPUES DEL MENSAJE SE HACE REFERENCIA EL OBJETO ACTUAL AL AUX this.bugActualizarReferenciaActual(this.subpreguntaevaluacion,subpreguntaevaluacionAux); this.refrescarForeignKeysDescripcionesSubPreguntaEvaluacion(); } else { //CUANDO ES MANTENIMIENTO MAESTRO DETALLE if(this.subpreguntaevaluacionSessionBean.getEstaModoGuardarRelaciones()) { //GUARDAR RELACIONES //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.getDetalleEvaluacionProveedors().addAll(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorsEliminados); } else if(Constantes.ISUSAEJBREMOTE ||Constantes.ISUSAEJBHOME) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedors.addAll(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorsEliminados); } //ARCHITECTURE if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { //QUITAR FILA TOTAL //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.conTotales) {/*this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.quitarFilaTotales();*/} } else if(Constantes.ISUSAEJBREMOTE ||Constantes.ISUSAEJBHOME) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.conTotales) {/*this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.quitarFilaTotales();*/} } //ARCHITECTURE //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.saveSubPreguntaEvaluacionRelaciones(subpreguntaevaluacionAux,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.getDetalleEvaluacionProveedors());//WithConnection //subpreguntaevaluacionLogic.getSetVersionRowSubPreguntaEvaluacions();//WithConnection } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE //TALVEZ ESTA DEMAS POR SER UPDATE //POR BUG: EL OBJETO ACTUAL SE PERDIA, POR LO QUE SE GUARDA TAMBIEN VALORES EN AUX Y LUEGO DESPUES DEL MENSAJE SE HACE REFERENCIA EL OBJETO ACTUAL AL AUX this.bugActualizarReferenciaActual(this.subpreguntaevaluacion,subpreguntaevaluacionAux); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.setDetalleEvaluacionProveedors(new ArrayList<DetalleEvaluacionProveedor>()); } else if(Constantes.ISUSAEJBREMOTE ||Constantes.ISUSAEJBHOME) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedors= new ArrayList<DetalleEvaluacionProveedor>(); } //ARCHITECTURE } else { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.conTotales) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.quitarFilaTotales();} subpreguntaevaluacionAux.setDetalleEvaluacionProveedors(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.getDetalleEvaluacionProveedors()); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { if(this.subpreguntaevaluacionSessionBean.getEstaModoGuardarRelaciones() || this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { actualizarLista(subpreguntaevaluacionAux,subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { actualizarLista(subpreguntaevaluacionAux,subpreguntaevaluacions); } //ARCHITECTURE //AQUI EL ID NEGATIVO ES EL ID BUSCADO, YA QUE NO SE GENERA OTRO EN LA DB POR INGRESAR UNO NUEVO //TALVEZ ESTA DEMAS POR SER UPDATE //POR BUG: EL OBJETO ACTUAL SE PERDIA, POR LO QUE SE GUARDA TAMBIEN VALORES EN AUX Y LUEGO DESPUES DEL MENSAJE SE HACE REFERENCIA EL OBJETO ACTUAL AL AUX //this.bugActualizarReferenciaActual(this.subpreguntaevaluacion,subpreguntaevaluacionAux); } } } } else if(maintenanceType==MaintenanceType.ELIMINAR) { subpreguntaevaluacionAux=new SubPreguntaEvaluacion(); subpreguntaevaluacionAux.setIsNew(false); subpreguntaevaluacionAux.setIsChanged(false); subpreguntaevaluacionAux.setIsDeleted(true); subpreguntaevaluacionAux.setId(this.subpreguntaevaluacion.getId()); subpreguntaevaluacionAux.setVersionRow(this.subpreguntaevaluacion.getVersionRow()); subpreguntaevaluacionAux.setid_empresa(this.subpreguntaevaluacion.getid_empresa()); subpreguntaevaluacionAux.setid_sucursal(this.subpreguntaevaluacion.getid_sucursal()); subpreguntaevaluacionAux.setid_pregunta_evaluacion(this.subpreguntaevaluacion.getid_pregunta_evaluacion()); subpreguntaevaluacionAux.setid_ejercicio(this.subpreguntaevaluacion.getid_ejercicio()); subpreguntaevaluacionAux.setid_periodo(this.subpreguntaevaluacion.getid_periodo()); subpreguntaevaluacionAux.setorden(this.subpreguntaevaluacion.getorden()); subpreguntaevaluacionAux.setpregunta(this.subpreguntaevaluacion.getpregunta()); subpreguntaevaluacionAux.setporcentaje_si(this.subpreguntaevaluacion.getporcentaje_si()); subpreguntaevaluacionAux.setcon_factura(this.subpreguntaevaluacion.getcon_factura()); subpreguntaevaluacionAux.setcon_orden_compra(this.subpreguntaevaluacion.getcon_orden_compra()); subpreguntaevaluacionAux.setcon_completo(this.subpreguntaevaluacion.getcon_completo()); subpreguntaevaluacionAux.setcon_a_tiempo(this.subpreguntaevaluacion.getcon_a_tiempo()); if(this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { //ELEMENTO ACTUAL NO SE HA INGRESADO AL SISTEMA, NO SE PUEDE ELIMINAR ALGO QUE NO EXISTE if(this.subpreguntaevaluacionAux.getId()>=0) { this.subpreguntaevaluacionsEliminados.add(subpreguntaevaluacionAux); } } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { actualizarLista(subpreguntaevaluacionAux,subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { actualizarLista(subpreguntaevaluacionAux,subpreguntaevaluacions); } //ARCHITECTURE if(!isGuardarCambiosEnLote && !this.subpreguntaevaluacionSessionBean.getEstaModoGuardarRelaciones() && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.saveSubPreguntaEvaluacions();//WithConnection //subpreguntaevaluacionLogic.getSetVersionRowSubPreguntaEvaluacions();//WithConnection } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } else { //CUANDO ES MANTENIMIENTO MAESTRO DETALLE if(this.subpreguntaevaluacionSessionBean.getEstaModoGuardarRelaciones()) { //GUARDAR RELACIONES //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.getDetalleEvaluacionProveedors().addAll(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorsEliminados); } else if(Constantes.ISUSAEJBREMOTE ||Constantes.ISUSAEJBHOME) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedors.addAll(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorsEliminados); } //ARCHITECTURE if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { //QUITAR FILA TOTAL //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.conTotales) {/*this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.quitarFilaTotales();*/} } else if(Constantes.ISUSAEJBREMOTE ||Constantes.ISUSAEJBHOME) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.conTotales) {/*this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.quitarFilaTotales();*/} } //ARCHITECTURE //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.saveSubPreguntaEvaluacionRelaciones(subpreguntaevaluacionAux,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.getDetalleEvaluacionProveedors());//WithConnection //subpreguntaevaluacionLogic.getSetVersionRowSubPreguntaEvaluacions();//WithConnection } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.setDetalleEvaluacionProveedors(new ArrayList<DetalleEvaluacionProveedor>()); } else if(Constantes.ISUSAEJBREMOTE ||Constantes.ISUSAEJBHOME) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedors= new ArrayList<DetalleEvaluacionProveedor>(); } //ARCHITECTURE } } else { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.conTotales) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.quitarFilaTotales();} subpreguntaevaluacionAux.setDetalleEvaluacionProveedors(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.getDetalleEvaluacionProveedors()); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { if(this.subpreguntaevaluacionSessionBean.getEstaModoGuardarRelaciones() || this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { actualizarLista(subpreguntaevaluacionAux,subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { actualizarLista(subpreguntaevaluacionAux,subpreguntaevaluacions); } //ARCHITECTURE } } } else if(maintenanceType==MaintenanceType.GUARDARCAMBIOS) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().addAll(this.subpreguntaevaluacionsEliminados); subpreguntaevaluacionLogic.saveSubPreguntaEvaluacions();//WithConnection //subpreguntaevaluacionLogic.getSetVersionRowSubPreguntaEvaluacions();//WithConnection } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE this.refrescarForeignKeysDescripcionesSubPreguntaEvaluacion(); this.subpreguntaevaluacionsEliminados= new ArrayList<SubPreguntaEvaluacion>(); } if(this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { this.crearFilaTotales(); } if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && if(!this.isPostAccionSinMensaje) { JOptionPane.showMessageDialog(this,"Sub Pregunta Evaluacion GUARDADO CORRECTAMENTE","MANTENIMIENTO DE Sub Pregunta Evaluacion",JOptionPane.INFORMATION_MESSAGE); if(maintenanceType==MaintenanceType.NUEVO || maintenanceType==MaintenanceType.ACTUALIZAR) { //CUANDO ES NUEVO SE PIERDE REFERENCIA NO SE PORQUE this.subpreguntaevaluacion=subpreguntaevaluacionAux; } } } this.isErrorGuardar=false; this.inicializarInvalidValues(); /* } else { this.mostrarInvalidValues(); } */ } catch(Exception e) { this.isErrorGuardar=true; this.crearFilaTotales(); throw e; } finally { //this.finishProcessSubPreguntaEvaluacion(); } } public void actualizarRelaciones(SubPreguntaEvaluacion subpreguntaevaluacionLocal) throws Exception { if(this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLocal.setDetalleEvaluacionProveedors(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.getDetalleEvaluacionProveedors()); } else { subpreguntaevaluacionLocal.setDetalleEvaluacionProveedors(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedors); } } } public void actualizarRelacionFkPadreActual(SubPreguntaEvaluacion subpreguntaevaluacionLocal) throws Exception { if(this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { if(this.jInternalFrameParent.getClass().equals(EmpresaDetalleFormJInternalFrame.class)) { EmpresaBeanSwingJInternalFrame empresaBeanSwingJInternalFrameLocal=(EmpresaBeanSwingJInternalFrame) ((EmpresaDetalleFormJInternalFrame) this.jInternalFrameParent).jInternalFrameParent; empresaBeanSwingJInternalFrameLocal.setVariablesFormularioToObjetoActualTodoEmpresa(empresaBeanSwingJInternalFrameLocal.getempresa(),true); empresaBeanSwingJInternalFrameLocal.actualizarLista(empresaBeanSwingJInternalFrameLocal.empresa,this.empresasForeignKey); empresaBeanSwingJInternalFrameLocal.actualizarRelaciones(empresaBeanSwingJInternalFrameLocal.empresa); subpreguntaevaluacionLocal.setEmpresa(empresaBeanSwingJInternalFrameLocal.empresa); this.addItemDefectoCombosForeignKeyEmpresa(); this.cargarCombosFrameEmpresasForeignKey("Formulario"); this.setActualEmpresaForeignKey(empresaBeanSwingJInternalFrameLocal.empresa.getId(),false,"Formulario"); } else if(this.jInternalFrameParent.getClass().equals(SucursalDetalleFormJInternalFrame.class)) { SucursalBeanSwingJInternalFrame sucursalBeanSwingJInternalFrameLocal=(SucursalBeanSwingJInternalFrame) ((SucursalDetalleFormJInternalFrame) this.jInternalFrameParent).jInternalFrameParent; sucursalBeanSwingJInternalFrameLocal.setVariablesFormularioToObjetoActualTodoSucursal(sucursalBeanSwingJInternalFrameLocal.getsucursal(),true); sucursalBeanSwingJInternalFrameLocal.actualizarLista(sucursalBeanSwingJInternalFrameLocal.sucursal,this.sucursalsForeignKey); sucursalBeanSwingJInternalFrameLocal.actualizarRelaciones(sucursalBeanSwingJInternalFrameLocal.sucursal); subpreguntaevaluacionLocal.setSucursal(sucursalBeanSwingJInternalFrameLocal.sucursal); this.addItemDefectoCombosForeignKeySucursal(); this.cargarCombosFrameSucursalsForeignKey("Formulario"); this.setActualSucursalForeignKey(sucursalBeanSwingJInternalFrameLocal.sucursal.getId(),false,"Formulario"); } else if(this.jInternalFrameParent.getClass().equals(PreguntaEvaluacionDetalleFormJInternalFrame.class)) { PreguntaEvaluacionBeanSwingJInternalFrame preguntaevaluacionBeanSwingJInternalFrameLocal=(PreguntaEvaluacionBeanSwingJInternalFrame) ((PreguntaEvaluacionDetalleFormJInternalFrame) this.jInternalFrameParent).jInternalFrameParent; preguntaevaluacionBeanSwingJInternalFrameLocal.setVariablesFormularioToObjetoActualTodoPreguntaEvaluacion(preguntaevaluacionBeanSwingJInternalFrameLocal.getpreguntaevaluacion(),true); preguntaevaluacionBeanSwingJInternalFrameLocal.actualizarLista(preguntaevaluacionBeanSwingJInternalFrameLocal.preguntaevaluacion,this.preguntaevaluacionsForeignKey); preguntaevaluacionBeanSwingJInternalFrameLocal.actualizarRelaciones(preguntaevaluacionBeanSwingJInternalFrameLocal.preguntaevaluacion); subpreguntaevaluacionLocal.setPreguntaEvaluacion(preguntaevaluacionBeanSwingJInternalFrameLocal.preguntaevaluacion); this.addItemDefectoCombosForeignKeyPreguntaEvaluacion(); this.cargarCombosFramePreguntaEvaluacionsForeignKey("Formulario"); this.setActualPreguntaEvaluacionForeignKey(preguntaevaluacionBeanSwingJInternalFrameLocal.preguntaevaluacion.getId(),false,"Formulario"); } else if(this.jInternalFrameParent.getClass().equals(EjercicioDetalleFormJInternalFrame.class)) { EjercicioBeanSwingJInternalFrame ejercicioBeanSwingJInternalFrameLocal=(EjercicioBeanSwingJInternalFrame) ((EjercicioDetalleFormJInternalFrame) this.jInternalFrameParent).jInternalFrameParent; ejercicioBeanSwingJInternalFrameLocal.setVariablesFormularioToObjetoActualTodoEjercicio(ejercicioBeanSwingJInternalFrameLocal.getejercicio(),true); ejercicioBeanSwingJInternalFrameLocal.actualizarLista(ejercicioBeanSwingJInternalFrameLocal.ejercicio,this.ejerciciosForeignKey); ejercicioBeanSwingJInternalFrameLocal.actualizarRelaciones(ejercicioBeanSwingJInternalFrameLocal.ejercicio); subpreguntaevaluacionLocal.setEjercicio(ejercicioBeanSwingJInternalFrameLocal.ejercicio); this.addItemDefectoCombosForeignKeyEjercicio(); this.cargarCombosFrameEjerciciosForeignKey("Formulario"); this.setActualEjercicioForeignKey(ejercicioBeanSwingJInternalFrameLocal.ejercicio.getId(),false,"Formulario"); } else if(this.jInternalFrameParent.getClass().equals(PeriodoDetalleFormJInternalFrame.class)) { PeriodoBeanSwingJInternalFrame periodoBeanSwingJInternalFrameLocal=(PeriodoBeanSwingJInternalFrame) ((PeriodoDetalleFormJInternalFrame) this.jInternalFrameParent).jInternalFrameParent; periodoBeanSwingJInternalFrameLocal.setVariablesFormularioToObjetoActualTodoPeriodo(periodoBeanSwingJInternalFrameLocal.getperiodo(),true); periodoBeanSwingJInternalFrameLocal.actualizarLista(periodoBeanSwingJInternalFrameLocal.periodo,this.periodosForeignKey); periodoBeanSwingJInternalFrameLocal.actualizarRelaciones(periodoBeanSwingJInternalFrameLocal.periodo); subpreguntaevaluacionLocal.setPeriodo(periodoBeanSwingJInternalFrameLocal.periodo); this.addItemDefectoCombosForeignKeyPeriodo(); this.cargarCombosFramePeriodosForeignKey("Formulario"); this.setActualPeriodoForeignKey(periodoBeanSwingJInternalFrameLocal.periodo.getId(),false,"Formulario"); } } } public Boolean validarSubPreguntaEvaluacionActual() throws Exception { Boolean estaValidado=false; this.inicializarInvalidValues(); /* int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE ||Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE */ this.invalidValues = subpreguntaevaluacionValidator.getInvalidValues(this.subpreguntaevaluacion); if(this.invalidValues==null || this.invalidValues.length<=0) { estaValidado=true; } else { this.mostrarInvalidValues(); } return estaValidado; } public void actualizarLista(SubPreguntaEvaluacion subpreguntaevaluacion,List<SubPreguntaEvaluacion> subpreguntaevaluacions) throws Exception { try { SubPreguntaEvaluacionConstantesFunciones.actualizarLista(subpreguntaevaluacion,subpreguntaevaluacions,this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()); } catch(Exception e) { throw e; } } public void actualizarSelectedLista(SubPreguntaEvaluacion subpreguntaevaluacion,List<SubPreguntaEvaluacion> subpreguntaevaluacions) throws Exception { try { SubPreguntaEvaluacionConstantesFunciones.actualizarSelectedLista(subpreguntaevaluacion,subpreguntaevaluacions); } catch(Exception e) { throw e; } } public Boolean tieneElementosSeleccionados() throws Exception { Boolean tiene=false; List<SubPreguntaEvaluacion> subpreguntaevaluacionsLocal=null; try { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionsLocal=this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions(); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacionsLocal=this.subpreguntaevaluacions; } //ARCHITECTURE for(SubPreguntaEvaluacion subpreguntaevaluacionLocal:subpreguntaevaluacionsLocal) { if(this.permiteMantenimiento(subpreguntaevaluacionLocal) && subpreguntaevaluacionLocal.getIsSelected()) { tiene=true; break; } } } catch(Exception e) { throw e; } return tiene; } public void mostrarInvalidValues() throws Exception { String sMensaje=""; for (InvalidValue invalidValue : this.invalidValues) { sMensaje+="\r\n"+SubPreguntaEvaluacionConstantesFunciones.getSubPreguntaEvaluacionLabelDesdeNombre(invalidValue.getPropertyName())+"->"+invalidValue.getMessage(); //MOSTRAR CAMPOS INVALIDOS if(invalidValue.getPropertyName().equals(SubPreguntaEvaluacionConstantesFunciones.IDEMPRESA)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelid_empresaSubPreguntaEvaluacion,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(SubPreguntaEvaluacionConstantesFunciones.IDSUCURSAL)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelid_sucursalSubPreguntaEvaluacion,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(SubPreguntaEvaluacionConstantesFunciones.IDPREGUNTAEVALUACION)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelid_pregunta_evaluacionSubPreguntaEvaluacion,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(SubPreguntaEvaluacionConstantesFunciones.IDEJERCICIO)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelid_ejercicioSubPreguntaEvaluacion,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(SubPreguntaEvaluacionConstantesFunciones.IDPERIODO)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelid_periodoSubPreguntaEvaluacion,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(SubPreguntaEvaluacionConstantesFunciones.ORDEN)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelordenSubPreguntaEvaluacion,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(SubPreguntaEvaluacionConstantesFunciones.PREGUNTA)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelpreguntaSubPreguntaEvaluacion,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(SubPreguntaEvaluacionConstantesFunciones.PORCENTAJESI)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelporcentaje_siSubPreguntaEvaluacion,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(SubPreguntaEvaluacionConstantesFunciones.CONFACTURA)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelcon_facturaSubPreguntaEvaluacion,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(SubPreguntaEvaluacionConstantesFunciones.CONORDENCOMPRA)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelcon_orden_compraSubPreguntaEvaluacion,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(SubPreguntaEvaluacionConstantesFunciones.CONCOMPLETO)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelcon_completoSubPreguntaEvaluacion,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(SubPreguntaEvaluacionConstantesFunciones.CONATIEMPO)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelcon_a_tiempoSubPreguntaEvaluacion,invalidValue.getMessage());} } if(!sMensaje.equals("")) { //JOptionPane.showMessageDialog(this,sMensaje,"VALIDACION ",JOptionPane.ERROR_MESSAGE); throw new Exception(sMensaje); } /* System.out.println(invalidValue); System.out.println("message=" + invalidValue.getMessage()); System.out.println("propertyName=" + invalidValue.getPropertyName()); System.out.println("propertyPath=" + invalidValue.getPropertyPath()); System.out.println("value=" + invalidValue.getValue()); */ } public void inicializarInvalidValues() throws Exception { String sMensaje=""; if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //MOSTRAR CAMPOS INVALIDOS FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelid_empresaSubPreguntaEvaluacion,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelid_sucursalSubPreguntaEvaluacion,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelid_pregunta_evaluacionSubPreguntaEvaluacion,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelid_ejercicioSubPreguntaEvaluacion,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelid_periodoSubPreguntaEvaluacion,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelordenSubPreguntaEvaluacion,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelpreguntaSubPreguntaEvaluacion,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelporcentaje_siSubPreguntaEvaluacion,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelcon_facturaSubPreguntaEvaluacion,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelcon_orden_compraSubPreguntaEvaluacion,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelcon_completoSubPreguntaEvaluacion,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelcon_a_tiempoSubPreguntaEvaluacion,""); } } public void actualizarObjetoPadreFk(String sTipo) throws Exception { if(sTipo.equals("XXXAuxiliar")) { } else if(sTipo.equals("DetalleEvaluacionProveedor")) { if(this.subpreguntaevaluacion==null) { this.subpreguntaevaluacion= new SubPreguntaEvaluacion(); } if(this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { //&& this.isEsNuevoSubPreguntaEvaluacion this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true);//false this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.getdetalleevaluacionproveedor().setSubPreguntaEvaluacion(this.subpreguntaevaluacion); } return; } } public void nuevoPreparar() throws Exception { this.nuevoPreparar(false); } public void nuevoPreparar(Boolean esNuevoGuardarCambios) throws Exception { this.iIdNuevoSubPreguntaEvaluacion--; this.subpreguntaevaluacionAux=new SubPreguntaEvaluacion(); this.subpreguntaevaluacionAux.setId(this.iIdNuevoSubPreguntaEvaluacion); this.subpreguntaevaluacionAux.setIsChanged(true); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().add(this.subpreguntaevaluacionAux); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacions.add(this.subpreguntaevaluacionAux); } //ARCHITECTURE this.subpreguntaevaluacion=this.subpreguntaevaluacionAux; if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL_TABLA) { this.setVariablesObjetoActualToFormularioSubPreguntaEvaluacion(this.subpreguntaevaluacion); this.setVariablesObjetoActualToFormularioForeignKeySubPreguntaEvaluacion(this.subpreguntaevaluacion); } //this.setDefaultControlesSubPreguntaEvaluacion(); this.inicializarInvalidValues(); //SELECCIONA ITEM DEFECTO-->SET O SELECTED INDEX this.setItemDefectoCombosForeignKeySubPreguntaEvaluacion(); //INICIALIZA VARIABLES COMBOS GLOBALES A FORMULARIO(ParametroGeneralUsuario) this.setVariablesGlobalesCombosForeignKeySubPreguntaEvaluacion(); //INICIALIZA VARIABLES COMBOS GLOBALES AUXILIARES A FORMULARIO(Anio,Mes) //this.setVariablesGlobalesAuxiliaresCombosForeignKeySubPreguntaEvaluacion(); //SI TIENE FOREIGN KEY CON CAMPO esDefecto=true, SE ACTUALIZA A OBJETO ACTUAL this.setVariablesForeignKeyObjetoBeanDefectoActualToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacionBean,this.subpreguntaevaluacion,false,false); //ACTUALIZA VALORES PARA EL OBJETO ACTUAL ANTES DE ENVIARLO A ACTUALIZAR this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); ArrayList<Classe> classes=new ArrayList<Classe>(); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.actualizarObjetoPadreFk(SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } if(this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { classes=SubPreguntaEvaluacionConstantesFunciones.getClassesRelationshipsOfSubPreguntaEvaluacion(new ArrayList<Classe>(),DeepLoadType.NONE); } this.classesActual=new ArrayList<Classe>(); this.classesActual.addAll(classes); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionReturnGeneral=subpreguntaevaluacionLogic.procesarEventosSubPreguntaEvaluacionsWithConnection(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,EventoGlobalTipo.FORM_RECARGAR,ControlTipo.FORM,EventoTipo.LOAD,EventoSubTipo.NEW,"FORM",this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions(),this.subpreguntaevaluacion,this.subpreguntaevaluacionParameterGeneral,this.isEsNuevoSubPreguntaEvaluacion,classes);//this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacion() } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE //ACTUALIZA VARIABLES DEFECTO DESDE LOGIC A RETURN GENERAL Y LUEGO A BEAN //this.setVariablesObjetoReturnGeneralToBeanSubPreguntaEvaluacion(this.subpreguntaevaluacionReturnGeneral,this.subpreguntaevaluacionBean,false); if(this.subpreguntaevaluacionReturnGeneral.getConRecargarPropiedades()) { //INICIALIZA VARIABLES COMBOS NORMALES (FK) this.setVariablesObjetoActualToFormularioForeignKeySubPreguntaEvaluacion(this.subpreguntaevaluacionReturnGeneral.getSubPreguntaEvaluacion()); //INICIALIZA VARIABLES NORMALES A FORMULARIO(SIN FK) this.setVariablesObjetoActualToFormularioSubPreguntaEvaluacion(this.subpreguntaevaluacionReturnGeneral.getSubPreguntaEvaluacion()); } if(this.subpreguntaevaluacionReturnGeneral.getConRecargarRelaciones()) { //INICIALIZA VARIABLES RELACIONES A FORMULARIO this.setVariablesRelacionesObjetoActualToFormularioSubPreguntaEvaluacion(this.subpreguntaevaluacionReturnGeneral.getSubPreguntaEvaluacion(),classes);//this.subpreguntaevaluacionBean); } //ACTUALIZA VARIABLES FORMULARIO A OBJETO ACTUAL (PARA NUEVO TABLA O GUARDAR CAMBIOS if(esNuevoGuardarCambios) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,false); } //INICIALIZA VARIABLES COMBOS DEFAULT DEL PROYECTO(|DEFAULT para FK) //this.setVariablesDefaultCombosForeignKeySubPreguntaEvaluacion(); //INICIALIZA VARIABLES COMBOS PARAMETRO DEL PROYECTO(|VALORPARAM Era para ParametroModulo, ahora en logic) //this.setVariablesParametroCombosForeignKeySubPreguntaEvaluacion(); if(!esNuevoGuardarCambios) { //INICIALIZA VARIABLES POR OPCION MENU this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.RecargarFormSubPreguntaEvaluacion(this,"NUEVO_PREPARAR","",this.arrDatoGeneral); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingSubPreguntaEvaluacion(false); if(subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { //DEBERIA YA ESTAR CARGADO LOS COMBOS Y SI SE NECESITA ALGO MAS SE DEBE CREAR FUNCION LIMITADA //SI DEBE TRAER Y RESETEAR TABLA if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorSessionBean.getEsGuardarRelacionado() && DetalleEvaluacionProveedorJInternalFrame.ESTA_CARGADO_PORPARTE) { this.jButtonDetalleEvaluacionProveedorActionPerformed(null,-1,false,true,null); } } //SI ES MANUAL if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingManualSubPreguntaEvaluacion(); } this.actualizarVisualTableDatosSubPreguntaEvaluacion(); this.jTableDatosSubPreguntaEvaluacion.setRowSelectionInterval(this.getIndiceNuevoSubPreguntaEvaluacion(), this.getIndiceNuevoSubPreguntaEvaluacion()); this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); this.actualizarEstadoCeldasBotonesSubPreguntaEvaluacion("a", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); } } public void habilitarDeshabilitarControlesSubPreguntaEvaluacion(Boolean isHabilitar) throws Exception { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldordenSubPreguntaEvaluacion.setEnabled(isHabilitar && this.subpreguntaevaluacionConstantesFunciones.activarordenSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextAreapreguntaSubPreguntaEvaluacion.setEnabled(isHabilitar && this.subpreguntaevaluacionConstantesFunciones.activarpreguntaSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldporcentaje_siSubPreguntaEvaluacion.setEnabled(isHabilitar && this.subpreguntaevaluacionConstantesFunciones.activarporcentaje_siSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_facturaSubPreguntaEvaluacion.setEnabled(isHabilitar && this.subpreguntaevaluacionConstantesFunciones.activarcon_facturaSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_orden_compraSubPreguntaEvaluacion.setEnabled(isHabilitar && this.subpreguntaevaluacionConstantesFunciones.activarcon_orden_compraSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_completoSubPreguntaEvaluacion.setEnabled(isHabilitar && this.subpreguntaevaluacionConstantesFunciones.activarcon_completoSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_a_tiempoSubPreguntaEvaluacion.setEnabled(isHabilitar && this.subpreguntaevaluacionConstantesFunciones.activarcon_a_tiempoSubPreguntaEvaluacion); // this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion.setEnabled(isHabilitar && this.subpreguntaevaluacionConstantesFunciones.activarid_empresaSubPreguntaEvaluacion);// this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion.setEnabled(isHabilitar && this.subpreguntaevaluacionConstantesFunciones.activarid_sucursalSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.setEnabled(isHabilitar && this.subpreguntaevaluacionConstantesFunciones.activarid_pregunta_evaluacionSubPreguntaEvaluacion);// this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.setEnabled(isHabilitar && this.subpreguntaevaluacionConstantesFunciones.activarid_ejercicioSubPreguntaEvaluacion);// this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.setEnabled(isHabilitar && this.subpreguntaevaluacionConstantesFunciones.activarid_periodoSubPreguntaEvaluacion); }; public void setDefaultControlesSubPreguntaEvaluacion() throws Exception { }; public void habilitarDeshabilitarTipoMantenimientoSubPreguntaEvaluacion(Boolean esRelaciones) throws Exception { if(esRelaciones) { //this.subpreguntaevaluacionSessionBean.setConGuardarRelaciones(true); this.subpreguntaevaluacionSessionBean.setEstaModoGuardarRelaciones(true); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTabbedPaneRelacionesSubPreguntaEvaluacion.setVisible(true); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorSessionBean.setEsGuardarRelacionado(true); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.getContentPane().setVisible(true); } } else { //this.subpreguntaevaluacionSessionBean.setConGuardarRelaciones(false); this.subpreguntaevaluacionSessionBean.setEstaModoGuardarRelaciones(false); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTabbedPaneRelacionesSubPreguntaEvaluacion.setVisible(false); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorSessionBean.setEsGuardarRelacionado(false); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.getContentPane().setVisible(false); } } }; public int getIndiceNuevoSubPreguntaEvaluacion() throws Exception { int iIndice=0; Boolean existe=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()) { if(subpreguntaevaluacionAux.getId().equals(this.iIdNuevoSubPreguntaEvaluacion)) { existe=true; break; } iIndice++; } } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:this.subpreguntaevaluacions) { if(subpreguntaevaluacionAux.getId().equals(this.iIdNuevoSubPreguntaEvaluacion)) { existe=true; break; } iIndice++; } } //ARCHITECTURE if(!existe) { //SI NO EXISTE TOMA LA ULTIMA FILA iIndice=iIndice-1; } return iIndice; } public int getIndiceActualSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion,Integer iIndiceActual) throws Exception { Integer iIndice=0; Boolean existe=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()) { if(subpreguntaevaluacionAux.getId().equals(subpreguntaevaluacion.getId())) { existe=true; break; } iIndice++; } } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:this.subpreguntaevaluacions) { if(subpreguntaevaluacionAux.getId().equals(subpreguntaevaluacion.getId())) { existe=true; break; } iIndice++; } } //ARCHITECTURE if(!existe) { //SI NO EXISTE TOMA LA ULTIMA FILA iIndice=iIndiceActual; } return iIndice; } public void setCamposBaseDesdeOriginalSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacionOriginal) throws Exception { Boolean existe=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()) { if(subpreguntaevaluacionAux.getSubPreguntaEvaluacionOriginal().getId().equals(subpreguntaevaluacionOriginal.getId())) { existe=true; subpreguntaevaluacionOriginal.setId(subpreguntaevaluacionAux.getId()); subpreguntaevaluacionOriginal.setVersionRow(subpreguntaevaluacionAux.getVersionRow()); break; } } } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:this.subpreguntaevaluacions) { if(subpreguntaevaluacionAux.getSubPreguntaEvaluacionOriginal().getId().equals(subpreguntaevaluacionOriginal.getId())) { existe=true; subpreguntaevaluacionOriginal.setId(subpreguntaevaluacionAux.getId()); subpreguntaevaluacionOriginal.setVersionRow(subpreguntaevaluacionAux.getVersionRow()); break; } } } //ARCHITECTURE if(!existe) { //SI NO EXISTE TOMA LA ULTIMA FILA } } public void cancelarNuevosSubPreguntaEvaluacion(Boolean esParaCancelar) throws Exception { subpreguntaevaluacionsAux=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionAux=new SubPreguntaEvaluacion(); if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { if(Constantes.ISUSAEJBLOGICLAYER) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()) { if(subpreguntaevaluacionAux.getId()<0) { subpreguntaevaluacionsAux.add(subpreguntaevaluacionAux); } } this.iIdNuevoSubPreguntaEvaluacion=0L; this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().removeAll(subpreguntaevaluacionsAux); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:this.subpreguntaevaluacions) { if(subpreguntaevaluacionAux.getId()<0) { subpreguntaevaluacionsAux.add(subpreguntaevaluacionAux); } } this.iIdNuevoSubPreguntaEvaluacion=0L; this.subpreguntaevaluacions.removeAll(subpreguntaevaluacionsAux); } } else { if(Constantes.ISUSAEJBLOGICLAYER) { if(esParaCancelar && this.isEsNuevoSubPreguntaEvaluacion && this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().size()>0 ) { subpreguntaevaluacionAux=this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().get(this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().size() - 1); if(subpreguntaevaluacionAux.getId()<0) { this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().remove(subpreguntaevaluacionAux); } } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { if(esParaCancelar && this.isEsNuevoSubPreguntaEvaluacion && this.subpreguntaevaluacions.size()>0) { subpreguntaevaluacionAux=this.subpreguntaevaluacions.get(this.subpreguntaevaluacions.size() - 1); if(subpreguntaevaluacionAux.getId()<0) { this.subpreguntaevaluacions.remove(subpreguntaevaluacionAux); } } } } } public void cancelarNuevoSubPreguntaEvaluacion(Boolean esParaCancelar) throws Exception { if(Constantes.ISUSAEJBLOGICLAYER) { if(subpreguntaevaluacion.getId()<0) { this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().remove(this.subpreguntaevaluacion); } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { if(subpreguntaevaluacion.getId()<0) { this.subpreguntaevaluacions.remove(this.subpreguntaevaluacion); } } } public void setEstadosInicialesSubPreguntaEvaluacion(List<SubPreguntaEvaluacion> subpreguntaevaluacionsAux) throws Exception { SubPreguntaEvaluacionConstantesFunciones.setEstadosInicialesSubPreguntaEvaluacion(subpreguntaevaluacionsAux); } public void setEstadosInicialesSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacionAux) throws Exception { SubPreguntaEvaluacionConstantesFunciones.setEstadosInicialesSubPreguntaEvaluacion(subpreguntaevaluacionAux); } public void nuevo() throws Exception { try { //ESTA VALIDADO EN FUNCION ACTUALIZAR //if(this.validarSubPreguntaEvaluacionActual()) { this.ejecutarMantenimiento(MaintenanceType.NUEVO); this.actualizarEstadoCeldasBotonesSubPreguntaEvaluacion("n", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); //} } catch(Exception e) { throw e; //FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void actualizar() throws Exception { try { if(this.validarSubPreguntaEvaluacionActual()) { if(!this.isEsNuevoSubPreguntaEvaluacion) { this.ejecutarMantenimiento(MaintenanceType.ACTUALIZAR); this.actualizarEstadoCeldasBotonesSubPreguntaEvaluacion("n", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); } else { this.nuevo(); this.isEsNuevoSubPreguntaEvaluacion=false; } //SE CANCELA AL FINAL DEL PROCESO JBUTTONACTUALIZAR //this.cancelar(false); } } catch(Exception e) { throw e; //FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void eliminar() throws Exception { try { if(this.validarSubPreguntaEvaluacionActual()) { if(JOptionPane.showConfirmDialog(this, "ESTA SEGURO DE ELIMINAR EL/LA Sub Pregunta Evaluacion ?", "MANTENIMIENTO DE Sub Pregunta Evaluacion", JOptionPane.OK_CANCEL_OPTION) == 0) { this.ejecutarMantenimiento(MaintenanceType.ELIMINAR); this.actualizarEstadoCeldasBotonesSubPreguntaEvaluacion("n", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); } } } catch(Exception e) { throw e; //FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void guardarCambios() throws Exception { try { this.ejecutarMantenimiento(MaintenanceType.GUARDARCAMBIOS); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void seleccionarAsignar(SubPreguntaEvaluacion subpreguntaevaluacion) throws Exception { SubPreguntaEvaluacionConstantesFunciones.seleccionarAsignar(this.subpreguntaevaluacion,subpreguntaevaluacion); } public void seleccionar() throws Exception { try { //ACTUALIZO EL PERMISO ACTUALIZAR CON EL PERMISO ACTUALIZAR ORIGINAL ESTE PERMISO SE UTILIZA PARA EL NUEVO TAMBIEN this.isPermisoActualizarSubPreguntaEvaluacion=this.isPermisoActualizarOriginalSubPreguntaEvaluacion; this.seleccionarAsignar(subpreguntaevaluacion); this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); SubPreguntaEvaluacionConstantesFunciones.quitarEspaciosSubPreguntaEvaluacion(this.subpreguntaevaluacion,this.arrDatoGeneral); this.actualizarEstadoCeldasBotonesSubPreguntaEvaluacion("ae", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void seleccionarBusqueda(Long id) throws Exception { try { this.subpreguntaevaluacionSessionBean.setsFuncionBusquedaRapida(this.subpreguntaevaluacionSessionBean.getsFuncionBusquedaRapida().replace("TO_REPLACE", id.toString())); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void cancelar() throws Exception { this.cancelar(true); } public void cancelar(Boolean esParaCancelar) throws Exception { try { //SE UTILIZA COLUMNA ELIMINAR EN TABLA if(this.isEsNuevoSubPreguntaEvaluacion) { //NO CANCELA TODOS NUEVOS POR FUNCIONALIDAD GUARDAR CAMBIOS //this.cancelarNuevosSubPreguntaEvaluacion(esParaCancelar); this.cancelarNuevoSubPreguntaEvaluacion(esParaCancelar); } this.subpreguntaevaluacion=new SubPreguntaEvaluacion(); this.inicializarSubPreguntaEvaluacion(); this.actualizarEstadoCeldasBotonesSubPreguntaEvaluacion("n", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void inicializarSubPreguntaEvaluacion() throws Exception { try { SubPreguntaEvaluacionConstantesFunciones.inicializarSubPreguntaEvaluacion(this.subpreguntaevaluacion); } catch(Exception e) { throw e; } } public void anteriores()throws Exception { try { //this.iNumeroPaginacionPagina=this.iNumeroPaginacionPagina-this.iNumeroPaginacion; if(this.iNumeroPaginacionPagina-this.iNumeroPaginacion<this.iNumeroPaginacion) { this.iNumeroPaginacionPagina=0; } else { this.iNumeroPaginacionPagina=this.iNumeroPaginacionPagina-this.iNumeroPaginacion; } this.procesarBusqueda(this.sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void siguientes()throws Exception { try { if(this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().size()>0) { this.iNumeroPaginacionPagina=this.iNumeroPaginacionPagina+this.iNumeroPaginacion; } this.procesarBusqueda(this.sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void generarReporteSubPreguntaEvaluacions(String sAccionBusqueda,List<SubPreguntaEvaluacion> subpreguntaevaluacionsParaReportes) throws Exception { //HttpSession httpSession = httpServletRequest.getSession(); Long iIdUsuarioSesion=0L; if(usuarioActual==null) { this.usuarioActual=new Usuario(); } iIdUsuarioSesion=usuarioActual.getId(); String sPathReportes=""; InputStream reportFile=null; InputStream imageFile=null; imageFile=AuxiliarImagenes.class.getResourceAsStream("LogoReporte.jpg"); String sPathReporteFinal=""; if(!esReporteAccionProceso) { if(!this.sTipoReporte.equals("RELACIONES")) {//!isEsReporteRelaciones if(!this.esReporteDinamico) { sPathReporteFinal="SubPreguntaEvaluacion"+this.sTipoReporteExtra+"Design.jasper"; reportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal); } else { sPathReporteFinal=this.sPathReporteDinamico; reportFile = new FileInputStream(sPathReporteFinal); } } else { sPathReporteFinal="SubPreguntaEvaluacionMasterRelaciones"+this.sTipoReporteExtra+"Design.jasper"; reportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal); //sPathReportes=reportFile.getPath().replace("SubPreguntaEvaluacionMasterRelacionesDesign.jasper", ""); } } else { sPathReporteFinal="SubPreguntaEvaluacion"+this.sTipoReporteExtra+"Design.jasper"; reportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal); } if(reportFile==null) { throw new JRRuntimeException(sPathReporteFinal+" no existe"); } String sUsuario=""; if(usuarioActual!=null) { sUsuario=usuarioActual.getuser_name(); } Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("usuario", sUsuario); parameters.put("titulo", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual)); parameters.put("subtitulo", "Reporte De Sub Pregunta Evaluaciones"); parameters.put("busquedapor", SubPreguntaEvaluacionConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte); if(this.sTipoReporte.equals("RELACIONES")) {//isEsReporteRelaciones parameters.put("SUBREPORT_DIR", sPathReportes); } parameters.put("con_grafico", this.conGraficoReporte); JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile); this.cargarDatosCliente(); ArrayList<Classe> classes=new ArrayList<Classe>(); if(this.sTipoReporte.equals("RELACIONES")) {//isEsReporteRelaciones classes.add(new Classe(DetalleEvaluacionProveedor.class)); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { try { SubPreguntaEvaluacionLogic subpreguntaevaluacionLogicAuxiliar=new SubPreguntaEvaluacionLogic(); subpreguntaevaluacionLogicAuxiliar.setDatosCliente(subpreguntaevaluacionLogic.getDatosCliente()); subpreguntaevaluacionLogicAuxiliar.setSubPreguntaEvaluacions(subpreguntaevaluacionsParaReportes); subpreguntaevaluacionLogicAuxiliar.cargarRelacionesLoteForeignKeySubPreguntaEvaluacionWithConnection(); //deepLoadsWithConnection(false, DeepLoadType.INCLUDE, classes, ""); subpreguntaevaluacionsParaReportes=subpreguntaevaluacionLogicAuxiliar.getSubPreguntaEvaluacions(); //subpreguntaevaluacionLogic.getNewConnexionToDeep(); //for (SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionsParaReportes) { // subpreguntaevaluacionLogic.deepLoad(subpreguntaevaluacion, false, DeepLoadType.INCLUDE, classes); //} //subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } catch(Exception e) { throw e; } finally { //subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE InputStream reportFileDetalleEvaluacionProveedor = AuxiliarReportes.class.getResourceAsStream("DetalleEvaluacionProveedorDetalleRelacionesDesign.jasper"); parameters.put("subreport_detalleevaluacionproveedor", reportFileDetalleEvaluacionProveedor); } else { //FK DEBERIA TRAERSE DE ANTEMANO } //CLASSES PARA REPORTES OBJETOS RELACIONADOS if(!this.sTipoReporte.equals("RELACIONES")) {//!isEsReporteRelaciones classes=new ArrayList<Classe>(); } JRBeanArrayDataSource jrbeanArrayDataSourceSubPreguntaEvaluacion=null; if(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals("")) { SubPreguntaEvaluacionConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra; } else { SubPreguntaEvaluacionConstantesFunciones.S_TIPOREPORTE_EXTRA=""; } jrbeanArrayDataSourceSubPreguntaEvaluacion=new JRBeanArrayDataSource(SubPreguntaEvaluacionJInternalFrame.TraerSubPreguntaEvaluacionBeans(subpreguntaevaluacionsParaReportes,classes).toArray()); jasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceSubPreguntaEvaluacion); String sPathDest=Constantes.SUNIDAD_ARCHIVOS+":/"+Constantes.SCONTEXTSERVER+"/"+SubPreguntaEvaluacionConstantesFunciones.SCHEMA+"/reportes"; File filePathDest = new File(sPathDest); if(!filePathDest.exists()) { filePathDest.mkdirs(); } String sDestFileName=sPathDest+"/"+SubPreguntaEvaluacionConstantesFunciones.CLASSNAME; if(this.sTipoArchivoReporte=="VISUALIZAR") { JasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ; jasperViewer.setVisible(true) ; } else if(this.sTipoArchivoReporte=="HTML"||this.sTipoArchivoReporte=="PDF"||this.sTipoArchivoReporte=="XML") { //JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(SubPreguntaEvaluacionBean.TraerSubPreguntaEvaluacionBeans(subpreguntaevaluacionsParaReportes).toArray())); if(this.sTipoArchivoReporte=="HTML") { sDestFileName+=".html"; JasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName); } else if(this.sTipoArchivoReporte=="PDF") { sDestFileName+=".pdf"; JasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName); } else { sDestFileName+=".xml"; JasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false); } } else if(this.sTipoArchivoReporte=="WORD"||this.sTipoArchivoReporte=="EXCEL") { if(this.sTipoArchivoReporte=="WORD") { sDestFileName+=".rtf"; JRRtfExporter exporter = new JRRtfExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName); exporter.exportReport(); } else { sDestFileName+=".xls"; JRXlsExporter exporterXls = new JRXlsExporter(); exporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName); exporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE); exporterXls.exportReport(); } } else if(this.sTipoArchivoReporte=="EXCEL2"||this.sTipoArchivoReporte=="EXCEL2_2") { //sDestFileName+=".xlsx"; if(this.sTipoReporte.equals("NORMAL")) { this.generarExcelReporteSubPreguntaEvaluacions(sAccionBusqueda,sTipoArchivoReporte,subpreguntaevaluacionsParaReportes); } else if(this.sTipoReporte.equals("FORMULARIO")){ this.generarExcelReporteVerticalSubPreguntaEvaluacions(sAccionBusqueda,sTipoArchivoReporte,subpreguntaevaluacionsParaReportes,false); } else if(this.sTipoReporte.equals("DINAMICO")){ if(this.sTipoReporteDinamico.equals("NORMAL")) { this.jButtonGenerarExcelReporteDinamicoSubPreguntaEvaluacionActionPerformed(null); //this.generarExcelReporteSubPreguntaEvaluacions(sAccionBusqueda,sTipoArchivoReporte,subpreguntaevaluacionsParaReportes); } else if(this.sTipoReporteDinamico.equals("FORMULARIO")){ this.generarExcelReporteVerticalSubPreguntaEvaluacions(sAccionBusqueda,sTipoArchivoReporte,subpreguntaevaluacionsParaReportes,true); } else if(this.sTipoReporteDinamico.equals("RELACIONES")){ this.generarExcelReporteRelacionesSubPreguntaEvaluacions(sAccionBusqueda,sTipoArchivoReporte,subpreguntaevaluacionsParaReportes,true); } } else if(this.sTipoReporte.equals("RELACIONES")){ this.generarExcelReporteRelacionesSubPreguntaEvaluacions(sAccionBusqueda,sTipoArchivoReporte,subpreguntaevaluacionsParaReportes,false); } } if(this.sTipoArchivoReporte=="HTML"||this.sTipoArchivoReporte=="PDF"||this.sTipoArchivoReporte=="XML"||this.sTipoArchivoReporte=="WORD"||this.sTipoArchivoReporte=="EXCEL") { JOptionPane.showMessageDialog(this,"REPORTE "+sDestFileName+" GENERADO SATISFACTORIAMENTE","REPORTES ",JOptionPane.INFORMATION_MESSAGE); } } public void generarExcelReporteSubPreguntaEvaluacions(String sAccionBusqueda,String sTipoArchivoReporte,List<SubPreguntaEvaluacion> subpreguntaevaluacionsParaReportes) throws Exception { Workbook workbook = null; String sPath=this.parametroGeneralUsuario.getpath_exportar()+"subpreguntaevaluacion"; if(sTipoArchivoReporte=="EXCEL2") { workbook = new HSSFWorkbook(); sPath+=".xls"; } else if(sTipoArchivoReporte=="EXCEL2_2") { workbook = new XSSFWorkbook(); sPath+=".xlsx"; } Sheet sheet = workbook.createSheet("SubPreguntaEvaluacions"); int iRow = 0; int iCell = 0; Row row =null; Cell cell=null; row = sheet.createRow(iRow++); this.generarExcelReporteHeaderSubPreguntaEvaluacion("NORMAL",row,workbook); CellStyle cellStyleData = Funciones2.getStyleTitulo(workbook,"ZEBRA"); CellStyle cellStyleDataAux=null; int i=0; for(SubPreguntaEvaluacion subpreguntaevaluacion : subpreguntaevaluacionsParaReportes) { row = sheet.createRow(iRow++); iCell = 0; cellStyleDataAux=null; if(i%2==0) { cellStyleDataAux=cellStyleData; } SubPreguntaEvaluacionConstantesFunciones.generarExcelReporteDataSubPreguntaEvaluacion("NORMAL",row,workbook,subpreguntaevaluacion,cellStyleDataAux); /* Cell cell0 = row.createCell(0); cell0.setCellValue(country.getName()); Cell cell1 = row.createCell(1); cell1.setCellValue(country.getShortCode()); */ i++; } FileOutputStream fileOutputStream = new FileOutputStream(sPath); workbook.write(fileOutputStream); fileOutputStream.close(); Constantes2.S_PATH_ULTIMO_ARCHIVO=sPath; if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && JOptionPane.showMessageDialog(this,"EXPORTADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Sub Pregunta Evaluacion",JOptionPane.INFORMATION_MESSAGE); } } public void generarExcelReporteHeaderSubPreguntaEvaluacion(String sTipo,Row row,Workbook workbook) { SubPreguntaEvaluacionConstantesFunciones.generarExcelReporteHeaderSubPreguntaEvaluacion(sTipo,row,workbook); /* Cell cell=null; int iCell=0; CellStyle cellStyle = workbook.createCellStyle(); cellStyle.setFillBackgroundColor(IndexedColors.GREEN.getIndex()); cellStyle.setFillPattern(CellStyle.ALIGN_FILL); */ } public void generarExcelReporteVerticalSubPreguntaEvaluacions(String sAccionBusqueda,String sTipoArchivoReporte,List<SubPreguntaEvaluacion> subpreguntaevaluacionsParaReportes,Boolean paraDinamico) throws Exception { Workbook workbook = null; String sPath=this.parametroGeneralUsuario.getpath_exportar()+"subpreguntaevaluacion_vertical"; if(sTipoArchivoReporte=="EXCEL2") { workbook = new HSSFWorkbook(); sPath+=".xls"; } else if(sTipoArchivoReporte=="EXCEL2_2") { workbook = new XSSFWorkbook(); sPath+=".xlsx"; } Sheet sheet = workbook.createSheet("SubPreguntaEvaluacions"); int iRow = 0; int iRowLast = 0; int iCell = 0; Row row =null; Cell cell=null; row = sheet.createRow(iRow++); CellStyle cellStyle = Funciones2.getStyleTitulo(workbook,"ZEBRA");; CellStyle cellStyleTitulo = Funciones2.getStyleTitulo(workbook,"PRINCIPAL_VERTICAL"); for(SubPreguntaEvaluacion subpreguntaevaluacion : subpreguntaevaluacionsParaReportes) { row = sheet.createRow(iRow++); iRowLast=iRow - 1; cell = row.createCell(0); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.getSubPreguntaEvaluacionDescripcion(subpreguntaevaluacion)); cell.setCellStyle(cellStyleTitulo); sheet.addMergedRegion(new CellRangeAddress(iRowLast,iRowLast,0,2)); if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEMPRESA))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEMPRESA); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(subpreguntaevaluacion.getempresa_descripcion()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDSUCURSAL))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDSUCURSAL); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(subpreguntaevaluacion.getsucursal_descripcion()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPREGUNTAEVALUACION))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPREGUNTAEVALUACION); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(subpreguntaevaluacion.getpreguntaevaluacion_descripcion()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEJERCICIO))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEJERCICIO); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(subpreguntaevaluacion.getejercicio_descripcion()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPERIODO))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPERIODO); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(subpreguntaevaluacion.getperiodo_descripcion()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(subpreguntaevaluacion.getorden()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(subpreguntaevaluacion.getpregunta()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(subpreguntaevaluacion.getporcentaje_si()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(Funciones2.getDescripcionBoolean(subpreguntaevaluacion.getcon_factura())); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(Funciones2.getDescripcionBoolean(subpreguntaevaluacion.getcon_orden_compra())); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(Funciones2.getDescripcionBoolean(subpreguntaevaluacion.getcon_completo())); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(Funciones2.getDescripcionBoolean(subpreguntaevaluacion.getcon_a_tiempo())); } } FileOutputStream fileOutputStream = new FileOutputStream(sPath); workbook.write(fileOutputStream); fileOutputStream.close(); Constantes2.S_PATH_ULTIMO_ARCHIVO=sPath; if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && JOptionPane.showMessageDialog(this,"EXPORTADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Sub Pregunta Evaluacion",JOptionPane.INFORMATION_MESSAGE); } } public void generarExcelReporteRelacionesSubPreguntaEvaluacions(String sAccionBusqueda,String sTipoArchivoReporte,List<SubPreguntaEvaluacion> subpreguntaevaluacionsParaReportes,Boolean paraDinamico) throws Exception { ArrayList<Classe> classes=new ArrayList<Classe>(); List<SubPreguntaEvaluacion> subpreguntaevaluacionsRespaldo=null; classes=SubPreguntaEvaluacionConstantesFunciones.getClassesRelationshipsOfSubPreguntaEvaluacion(new ArrayList<Classe>(),DeepLoadType.NONE,false); this.datosDeep=new DatosDeep(); this.datosDeep.setIsDeep(false); this.datosDeep.setDeepLoadType(DeepLoadType.INCLUDE); this.datosDeep.setClases(classes); this.datosCliente.setDatosDeepParametros(false, DeepLoadType.INCLUDE, classes, ""); this.datosCliente.setIsConDeep(true); this.datosCliente.setIsConExportar(false); this.subpreguntaevaluacionLogic.setDatosCliente(this.datosCliente); this.subpreguntaevaluacionLogic.setDatosDeep(this.datosDeep); this.subpreguntaevaluacionLogic.setIsConDeep(true); subpreguntaevaluacionsRespaldo=this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions(); this.subpreguntaevaluacionLogic.setSubPreguntaEvaluacions(subpreguntaevaluacionsParaReportes); this.subpreguntaevaluacionLogic.deepLoadsWithConnection(false, DeepLoadType.INCLUDE, classes,""); subpreguntaevaluacionsParaReportes=this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions(); this.subpreguntaevaluacionLogic.setSubPreguntaEvaluacions(subpreguntaevaluacionsRespaldo); Workbook workbook = null; String sPath=this.parametroGeneralUsuario.getpath_exportar()+"subpreguntaevaluacion_relacion"; if(sTipoArchivoReporte=="EXCEL2") { workbook = new HSSFWorkbook(); sPath+=".xls"; } else if(sTipoArchivoReporte=="EXCEL2_2") { workbook = new XSSFWorkbook(); sPath+=".xlsx"; } Sheet sheet = workbook.createSheet("SubPreguntaEvaluacions"); int iRow = 0; int iRowLast = 0; int iCell = 0; Row row =null; Cell cell=null; row = sheet.createRow(iRow++); this.generarExcelReporteHeaderSubPreguntaEvaluacion("NORMAL",row,workbook); int i=0; int i2=0; CellStyle cellStyleData = Funciones2.getStyleTitulo(workbook,"ZEBRA"); CellStyle cellStyleDataTitulo = Funciones2.getStyleTitulo(workbook,"PRINCIPAL"); CellStyle cellStyleDataZebra = Funciones2.getStyleTitulo(workbook,"ZEBRA"); CellStyle cellStyleDataAux =null; CellStyle cellStyleDataAuxHijo =null; for(SubPreguntaEvaluacion subpreguntaevaluacion : subpreguntaevaluacionsParaReportes) { if(i!=0) { row = sheet.createRow(iRow++); this.generarExcelReporteHeaderSubPreguntaEvaluacion("NORMAL",row,workbook); } cellStyleDataAux=null; if(i%2==0) { //cellStyleDataAux=cellStyleData; } row = sheet.createRow(iRow++); SubPreguntaEvaluacionConstantesFunciones.generarExcelReporteDataSubPreguntaEvaluacion("NORMAL",row,workbook,subpreguntaevaluacion,cellStyleDataAux); //DetalleEvaluacionProveedor if(!paraDinamico || (paraDinamico && this.existeRelacionReporteDinamico(DetalleEvaluacionProveedorConstantesFunciones.SCLASSWEBTITULO))) { if(subpreguntaevaluacion.getDetalleEvaluacionProveedors()!=null && subpreguntaevaluacion.getDetalleEvaluacionProveedors().size()>0) { row = sheet.createRow(iRow++); iCell=1;iRowLast=iRow-1; cell = row.createCell(iCell++);cell.setCellStyle(cellStyleDataTitulo);sheet.addMergedRegion(new CellRangeAddress(iRowLast,iRowLast,1,5)); cell.setCellValue(DetalleEvaluacionProveedorConstantesFunciones.SCLASSWEBTITULO); row = sheet.createRow(iRow++); DetalleEvaluacionProveedorConstantesFunciones.generarExcelReporteHeaderDetalleEvaluacionProveedor("RELACIONADO",row,workbook); } if(subpreguntaevaluacion.getDetalleEvaluacionProveedors()!=null) { i2=0; for(DetalleEvaluacionProveedor detalleevaluacionproveedor : subpreguntaevaluacion.getDetalleEvaluacionProveedors()) { row = sheet.createRow(iRow++); cellStyleDataAuxHijo=null; if(i2%2==0) { cellStyleDataAuxHijo=cellStyleData; } DetalleEvaluacionProveedorConstantesFunciones.generarExcelReporteDataDetalleEvaluacionProveedor("RELACIONADO",row,workbook,detalleevaluacionproveedor,cellStyleDataAuxHijo); i2++; } } } i++; } /* row = sheet.createRow(iRow++); iRowLast=iRow - 1; cell = row.createCell(0); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.getSubPreguntaEvaluacionDescripcion(subpreguntaevaluacion)); cell.setCellStyle(cellStyleTitulo); sheet.addMergedRegion(new CellRangeAddress(iRowLast,iRowLast,0,2)); */ FileOutputStream fileOutputStream = new FileOutputStream(sPath); workbook.write(fileOutputStream); fileOutputStream.close(); Constantes2.S_PATH_ULTIMO_ARCHIVO=sPath; if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && JOptionPane.showMessageDialog(this,"EXPORTADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Sub Pregunta Evaluacion",JOptionPane.INFORMATION_MESSAGE); } } public Boolean existeColumnaReporteDinamico(String sColumna) { Boolean existe=false; Reporte reporte=new Reporte(); for(int index:this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListColumnasSelectReporte().getSelectedIndices()) { reporte=(Reporte)this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListColumnasSelectReporte().getModel().getElementAt(index); if(sColumna.equals(reporte.getsCodigo())) { existe=true; break; } } return existe; } public Boolean existeRelacionReporteDinamico(String sColumna) { Boolean existe=false; Reporte reporte=new Reporte(); for(int index:this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListRelacionesSelectReporte().getSelectedIndices()) { reporte=(Reporte)this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListRelacionesSelectReporte().getModel().getElementAt(index); if(sColumna.equals(reporte.getsCodigo())) { existe=true; break; } } return existe; } public void startProcessSubPreguntaEvaluacion() throws Exception { this.startProcessSubPreguntaEvaluacion(true); } public void startProcessSubPreguntaEvaluacion(Boolean conSplash) throws Exception { //FuncionesSwing.enableDisablePanels(false,this.jTabbedPaneBusquedasSubPreguntaEvaluacion ,this.jPanelParametrosReportesSubPreguntaEvaluacion, this.jScrollPanelDatosSubPreguntaEvaluacion,this.jPanelPaginacionSubPreguntaEvaluacion, this.jScrollPanelDatosEdicionSubPreguntaEvaluacion, this.jPanelAccionesSubPreguntaEvaluacion,this.jPanelAccionesFormularioSubPreguntaEvaluacion,this.jmenuBarSubPreguntaEvaluacion,this.jmenuBarDetalleSubPreguntaEvaluacion,this.jTtoolBarSubPreguntaEvaluacion,this.jTtoolBarDetalleSubPreguntaEvaluacion); final JTabbedPane jTabbedPaneBusquedasSubPreguntaEvaluacion=this.jTabbedPaneBusquedasSubPreguntaEvaluacion; final JPanel jPanelParametrosReportesSubPreguntaEvaluacion=this.jPanelParametrosReportesSubPreguntaEvaluacion; //final JScrollPane jScrollPanelDatosSubPreguntaEvaluacion=this.jScrollPanelDatosSubPreguntaEvaluacion; final JTable jTableDatosSubPreguntaEvaluacion=this.jTableDatosSubPreguntaEvaluacion; final JPanel jPanelPaginacionSubPreguntaEvaluacion=this.jPanelPaginacionSubPreguntaEvaluacion; //final JScrollPane jScrollPanelDatosEdicionSubPreguntaEvaluacion=this.jScrollPanelDatosEdicionSubPreguntaEvaluacion; final JPanel jPanelAccionesSubPreguntaEvaluacion=this.jPanelAccionesSubPreguntaEvaluacion; JPanel jPanelCamposAuxiliarSubPreguntaEvaluacion=new JPanelMe(); JPanel jPanelAccionesFormularioAuxiliarSubPreguntaEvaluacion=new JPanelMe(); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { jPanelCamposAuxiliarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelCamposSubPreguntaEvaluacion; jPanelAccionesFormularioAuxiliarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelAccionesFormularioSubPreguntaEvaluacion; } final JPanel jPanelCamposSubPreguntaEvaluacion=jPanelCamposAuxiliarSubPreguntaEvaluacion; final JPanel jPanelAccionesFormularioSubPreguntaEvaluacion=jPanelAccionesFormularioAuxiliarSubPreguntaEvaluacion; final JMenuBar jmenuBarSubPreguntaEvaluacion=this.jmenuBarSubPreguntaEvaluacion; final JToolBar jTtoolBarSubPreguntaEvaluacion=this.jTtoolBarSubPreguntaEvaluacion; JMenuBar jmenuBarDetalleAuxiliarSubPreguntaEvaluacion=new JMenuBar(); JToolBar jTtoolBarDetalleAuxiliarSubPreguntaEvaluacion=new JToolBar(); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { jmenuBarDetalleAuxiliarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jmenuBarDetalleSubPreguntaEvaluacion; jTtoolBarDetalleAuxiliarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTtoolBarDetalleSubPreguntaEvaluacion; } final JMenuBar jmenuBarDetalleSubPreguntaEvaluacion=jmenuBarDetalleAuxiliarSubPreguntaEvaluacion; final JToolBar jTtoolBarDetalleSubPreguntaEvaluacion=jTtoolBarDetalleAuxiliarSubPreguntaEvaluacion; if(Constantes2.CON_PROCESO_HILO) { Thread threadRunnableProcess; ProcessRunnable processRunnable; processRunnable=new ProcessRunnable(); processRunnable.setsTipo("START"); processRunnable.setDesktop(jDesktopPane); processRunnable.setModuloActual(moduloActual); processRunnable.setModuloUsuarioSeleccionado(moduloActual); processRunnable.setOpcionActual(opcionActual); processRunnable.setParametroGeneralSg(parametroGeneralSg); processRunnable.setParametroGeneralUsuario(parametroGeneralUsuario); processRunnable.setResumenUsuarioActual(resumenUsuarioActual); processRunnable.setUsuarioActual(usuarioActual); processRunnable.jTabbedPaneBusquedas=jTabbedPaneBusquedasSubPreguntaEvaluacion; processRunnable.jPanelParametrosReportes=jPanelParametrosReportesSubPreguntaEvaluacion; processRunnable.jTableDatos=jTableDatosSubPreguntaEvaluacion; processRunnable.jPanelCampos=jPanelCamposSubPreguntaEvaluacion; processRunnable.jPanelPaginacion=jPanelPaginacionSubPreguntaEvaluacion; processRunnable.jPanelAcciones=jPanelAccionesSubPreguntaEvaluacion; processRunnable.jPanelAccionesFormulario=jPanelAccionesFormularioSubPreguntaEvaluacion; processRunnable.jmenuBar=jmenuBarSubPreguntaEvaluacion; processRunnable.jmenuBarDetalle=jmenuBarDetalleSubPreguntaEvaluacion; processRunnable.jTtoolBar=jTtoolBarSubPreguntaEvaluacion; processRunnable.jTtoolBarDetalle=jTtoolBarDetalleSubPreguntaEvaluacion; processRunnable.jInternalFrameBase=this; //processRunnable.CargarObjetosRendimientoCriticoModuloInventario(); threadRunnableProcess=new Thread(processRunnable);//.start(); threadRunnableProcess.start(); } else { FuncionesSwing.enableDisablePanels(false,jTabbedPaneBusquedasSubPreguntaEvaluacion ,jPanelParametrosReportesSubPreguntaEvaluacion,jTableDatosSubPreguntaEvaluacion, /*jScrollPanelDatosSubPreguntaEvaluacion,*/jPanelCamposSubPreguntaEvaluacion,jPanelPaginacionSubPreguntaEvaluacion, /*jScrollPanelDatosEdicionSubPreguntaEvaluacion,*/ jPanelAccionesSubPreguntaEvaluacion,jPanelAccionesFormularioSubPreguntaEvaluacion,jmenuBarSubPreguntaEvaluacion,jmenuBarDetalleSubPreguntaEvaluacion,jTtoolBarSubPreguntaEvaluacion,jTtoolBarDetalleSubPreguntaEvaluacion); startProcess();//this. } /* if(conSplash) { SwingUtilities.invokeLater(new Runnable() { public void run() { try { FuncionesSwing.enableDisablePanels(false,jTabbedPaneBusquedasSubPreguntaEvaluacion ,jPanelParametrosReportesSubPreguntaEvaluacion, jScrollPanelDatosSubPreguntaEvaluacion,jPanelPaginacionSubPreguntaEvaluacion, jScrollPanelDatosEdicionSubPreguntaEvaluacion, jPanelAccionesSubPreguntaEvaluacion,jPanelAccionesFormularioSubPreguntaEvaluacion,jmenuBarSubPreguntaEvaluacion,jmenuBarDetalleSubPreguntaEvaluacion,jTtoolBarSubPreguntaEvaluacion,jTtoolBarDetalleSubPreguntaEvaluacion); startProcess();//this. } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); } */ } public void finishProcessSubPreguntaEvaluacion() {// throws Exception this.finishProcessSubPreguntaEvaluacion(true); } public void finishProcessSubPreguntaEvaluacion(Boolean conSplash) {// throws Exception //FuncionesSwing.enableDisablePanels(true,this.jTabbedPaneBusquedasSubPreguntaEvaluacion ,this.jPanelParametrosReportesSubPreguntaEvaluacion, this.jScrollPanelDatosSubPreguntaEvaluacion,this.jPanelPaginacionSubPreguntaEvaluacion, this.jScrollPanelDatosEdicionSubPreguntaEvaluacion, this.jPanelAccionesSubPreguntaEvaluacion,this.jPanelAccionesFormularioSubPreguntaEvaluacion,this.jmenuBarSubPreguntaEvaluacion,this.jmenuBarDetalleSubPreguntaEvaluacion,this.jTtoolBarSubPreguntaEvaluacion,this.jTtoolBarDetalleSubPreguntaEvaluacion); final JTabbedPane jTabbedPaneBusquedasSubPreguntaEvaluacion=this.jTabbedPaneBusquedasSubPreguntaEvaluacion; final JPanel jPanelParametrosReportesSubPreguntaEvaluacion=this.jPanelParametrosReportesSubPreguntaEvaluacion; //final JScrollPane jScrollPanelDatosSubPreguntaEvaluacion=this.jScrollPanelDatosSubPreguntaEvaluacion; final JTable jTableDatosSubPreguntaEvaluacion=this.jTableDatosSubPreguntaEvaluacion; final JPanel jPanelPaginacionSubPreguntaEvaluacion=this.jPanelPaginacionSubPreguntaEvaluacion; //final JScrollPane jScrollPanelDatosEdicionSubPreguntaEvaluacion=this.jScrollPanelDatosEdicionSubPreguntaEvaluacion; final JPanel jPanelAccionesSubPreguntaEvaluacion=this.jPanelAccionesSubPreguntaEvaluacion; JPanel jPanelCamposAuxiliarSubPreguntaEvaluacion=new JPanel(); JPanel jPanelAccionesFormularioAuxiliarSubPreguntaEvaluacion=new JPanel(); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { jPanelCamposAuxiliarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelCamposSubPreguntaEvaluacion; jPanelAccionesFormularioAuxiliarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelAccionesFormularioSubPreguntaEvaluacion; } final JPanel jPanelCamposSubPreguntaEvaluacion=jPanelCamposAuxiliarSubPreguntaEvaluacion; final JPanel jPanelAccionesFormularioSubPreguntaEvaluacion=jPanelAccionesFormularioAuxiliarSubPreguntaEvaluacion; final JMenuBar jmenuBarSubPreguntaEvaluacion=this.jmenuBarSubPreguntaEvaluacion; final JToolBar jTtoolBarSubPreguntaEvaluacion=this.jTtoolBarSubPreguntaEvaluacion; JMenuBar jmenuBarDetalleAuxiliarSubPreguntaEvaluacion=new JMenuBar(); JToolBar jTtoolBarDetalleAuxiliarSubPreguntaEvaluacion=new JToolBar(); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { jmenuBarDetalleAuxiliarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jmenuBarDetalleSubPreguntaEvaluacion; jTtoolBarDetalleAuxiliarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTtoolBarDetalleSubPreguntaEvaluacion; } final JMenuBar jmenuBarDetalleSubPreguntaEvaluacion=jmenuBarDetalleAuxiliarSubPreguntaEvaluacion; final JToolBar jTtoolBarDetalleSubPreguntaEvaluacion=jTtoolBarDetalleAuxiliarSubPreguntaEvaluacion; if(Constantes2.CON_PROCESO_HILO) { Thread threadRunnableProcess; ProcessRunnable processRunnable; processRunnable=new ProcessRunnable(); processRunnable.setsTipo("END"); processRunnable.setDesktop(jDesktopPane); processRunnable.setModuloActual(moduloActual); processRunnable.setModuloUsuarioSeleccionado(moduloActual); processRunnable.setOpcionActual(opcionActual); processRunnable.setParametroGeneralSg(parametroGeneralSg); processRunnable.setParametroGeneralUsuario(parametroGeneralUsuario); processRunnable.setResumenUsuarioActual(resumenUsuarioActual); processRunnable.setUsuarioActual(usuarioActual); processRunnable.jTabbedPaneBusquedas=jTabbedPaneBusquedasSubPreguntaEvaluacion; processRunnable.jPanelParametrosReportes=jPanelParametrosReportesSubPreguntaEvaluacion; processRunnable.jTableDatos=jTableDatosSubPreguntaEvaluacion; processRunnable.jPanelCampos=jPanelCamposSubPreguntaEvaluacion; processRunnable.jPanelPaginacion=jPanelPaginacionSubPreguntaEvaluacion; processRunnable.jPanelAcciones=jPanelAccionesSubPreguntaEvaluacion; processRunnable.jPanelAccionesFormulario=jPanelAccionesFormularioSubPreguntaEvaluacion; processRunnable.jmenuBar=jmenuBarSubPreguntaEvaluacion; processRunnable.jmenuBarDetalle=jmenuBarDetalleSubPreguntaEvaluacion; processRunnable.jTtoolBar=jTtoolBarSubPreguntaEvaluacion; processRunnable.jTtoolBarDetalle=jTtoolBarDetalleSubPreguntaEvaluacion; processRunnable.jInternalFrameBase=this; //processRunnable.CargarObjetosRendimientoCriticoModuloInventario(); threadRunnableProcess=new Thread(processRunnable);//.start(); threadRunnableProcess.start(); } else { if(conSplash) { SwingUtilities.invokeLater(new RunnableProceso(true,this,jTabbedPaneBusquedasSubPreguntaEvaluacion ,jPanelParametrosReportesSubPreguntaEvaluacion, jTableDatosSubPreguntaEvaluacion,/*jScrollPanelDatosSubPreguntaEvaluacion,*/jPanelCamposSubPreguntaEvaluacion,jPanelPaginacionSubPreguntaEvaluacion, /*jScrollPanelDatosEdicionSubPreguntaEvaluacion,*/ jPanelAccionesSubPreguntaEvaluacion,jPanelAccionesFormularioSubPreguntaEvaluacion,jmenuBarSubPreguntaEvaluacion,jmenuBarDetalleSubPreguntaEvaluacion,jTtoolBarSubPreguntaEvaluacion,jTtoolBarDetalleSubPreguntaEvaluacion)); } } } /* public void habilitarDeshabilitarControlesSubPreguntaEvaluacion(Boolean esHabilitar,Boolean conDetalle) { this.habilitarDeshabilitarToolBarSubPreguntaEvaluacion(esHabilitar,conDetalle); this.habilitarDeshabilitarMenuSubPreguntaEvaluacion(esHabilitar,conDetalle); } public void habilitarDeshabilitarToolBarSubPreguntaEvaluacion(Boolean esHabilitar,Boolean conDetalle) { FuncionesSwing.enableDisableComponents(this.jTtoolBarSubPreguntaEvaluacion,esHabilitar,1,1); if(conDetalle) { FuncionesSwing.enableDisableComponents(this.jTtoolBarDetalleSubPreguntaEvaluacion,esHabilitar,1,1); } } public void habilitarDeshabilitarMenuSubPreguntaEvaluacion(Boolean esHabilitar,Boolean conDetalle) { FuncionesSwing.enableDisableComponents(this.jmenuBarSubPreguntaEvaluacion,esHabilitar,1,1); if(conDetalle) { FuncionesSwing.enableDisableComponents(this.jmenuBarDetalleSubPreguntaEvaluacion,esHabilitar,1,1); } } */ public void procesarBusqueda(String sAccionBusqueda) throws Exception { String finalQueryPaginacion=this.subpreguntaevaluacionConstantesFunciones.getsFinalQuerySubPreguntaEvaluacion(); String finalQueryPaginacionTodos=this.subpreguntaevaluacionConstantesFunciones.getsFinalQuerySubPreguntaEvaluacion(); Boolean esBusqueda=false; this.actualizarVariablesTipoReporte(true,false,false,""); /* this.sTipoReporteExtra=""; this.esReporteDinamico=false; this.sPathReporteDinamico=""; */ if(!sAccionBusqueda.equals("Todos")) { esBusqueda=true; } this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); ArrayList<String> arrColumnasGlobalesNo=SubPreguntaEvaluacionConstantesFunciones.getArrayColumnasGlobalesNoSubPreguntaEvaluacion(this.arrDatoGeneral); ArrayList<String> arrColumnasGlobales=SubPreguntaEvaluacionConstantesFunciones.getArrayColumnasGlobalesSubPreguntaEvaluacion(this.arrDatoGeneral,arrColumnasGlobalesNo); String finalQueryGlobal=""; finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,!esBusqueda,esBusqueda,arrColumnasGlobales,SubPreguntaEvaluacionConstantesFunciones.TABLENAME); String sOrderBy=""; sOrderBy=Funciones2.getFinalQueryOrderBy(this.arrOrderBy); if(!sOrderBy.equals("")) { finalQueryPaginacion=sOrderBy; finalQueryPaginacionTodos=sOrderBy; } //INICIALIZA ELIMINADOS this.subpreguntaevaluacionsEliminados= new ArrayList<SubPreguntaEvaluacion>(); if(!this.isEntroOnLoad) { this.onLoad(); }/* else { this.isEntroOnLoad=false; }*/ try { //this.startProcessSubPreguntaEvaluacion(); ///*SubPreguntaEvaluacionSessionBean*/this.subpreguntaevaluacionSessionBean=new SubPreguntaEvaluacionSessionBean(); if(this.subpreguntaevaluacionSessionBean==null) { this.subpreguntaevaluacionSessionBean=new SubPreguntaEvaluacionSessionBean(); } //ACTUALIZA EL TAMANIO DE PAGINACION DESDE EL COMBO if(this.sTipoPaginacion!=null && !this.sTipoPaginacion.equals("")) { if(!this.sTipoPaginacion.equals("TODOS")) { this.iNumeroPaginacion=Integer.parseInt(this.sTipoPaginacion); } else { this.iNumeroPaginacion=-1; this.iNumeroPaginacionPagina=-1; } } else { if(this.iNumeroPaginacion==null || (this.iNumeroPaginacion!=null && this.iNumeroPaginacion<=0)) { this.iNumeroPaginacion=SubPreguntaEvaluacionConstantesFunciones.INUMEROPAGINACION; } } this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); this.cargarDatosCliente(); ArrayList<Classe> classes=new ArrayList<Classe>(); classes=SubPreguntaEvaluacionConstantesFunciones.getClassesForeignKeysOfSubPreguntaEvaluacion(new ArrayList<Classe>(),DeepLoadType.NONE); this.datosDeep=new DatosDeep(); this.datosDeep.setIsDeep(false); this.datosDeep.setDeepLoadType(DeepLoadType.INCLUDE); this.datosDeep.setClases(classes); this.datosCliente.setDatosDeepParametros(false, DeepLoadType.INCLUDE, classes, ""); this.datosCliente.setIsConDeep(true); if(false) {//this.conExportar this.datosCliente.setIsConExportar(true); this.datosCliente.setDatosExportarParametros(Funciones2.getTipoExportar(this.parametroGeneralUsuario),this.parametroGeneralUsuario.getcon_exportar_cabecera(),Funciones2.getTipoDelimiter(this.parametroGeneralUsuario),this.parametroGeneralUsuario.getpath_exportar()+"/subpreguntaevaluacion."+Funciones2.getTipoExtensionArchivoExportar(this.parametroGeneralUsuario)); } else { this.datosCliente.setIsConExportar(false); } subpreguntaevaluacionsAux= new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionLogic.setDatosCliente(this.datosCliente); subpreguntaevaluacionLogic.setDatosDeep(this.datosDeep); subpreguntaevaluacionLogic.setIsConDeep(true); subpreguntaevaluacionLogic.getSubPreguntaEvaluacionDataAccess().setIsForForeingsKeysDataRelationships(true); if(sAccionBusqueda.equals("Todos") || sAccionBusqueda.equals("Query")) { if(sAccionBusqueda.equals("Todos")) { //FALTA:PARA BUSQUEDAS POR CAMPO EN FORMULARIO //this.sFinalQueryGeneral=""; } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { finalQueryGlobal=Funciones.GetFinalQueryAppendBusqueda(finalQueryGlobal, this.sFinalQueryGeneral,finalQueryPaginacionTodos ); subpreguntaevaluacionLogic.getTodosSubPreguntaEvaluacions(finalQueryGlobal,pagination); //subpreguntaevaluacionLogic.getTodosSubPreguntaEvaluacionsWithConnection(finalQueryGlobal,pagination); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE if(subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()==null|| subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().size()==0) { } if(false && sTipoArchivoReporte!=""&&sTipoArchivoReporte!=null) {//this.isTipoArchivoReporte if(false) {//isMostrarTodosResultadosReporte this.pagination.setiFirstResult(-1); this.pagination.setiMaxResults(-1); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionsAux= new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsAux.addAll(subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacionsAux= new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsAux.addAll(subpreguntaevaluacions); } //ARCHITECTURE //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.getTodosSubPreguntaEvaluacions(finalQueryGlobal+"",this.pagination); //subpreguntaevaluacionLogic.getTodosSubPreguntaEvaluacionsWithConnection(finalQueryGlobal+"",this.pagination); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } this.generarReporteSubPreguntaEvaluacions("Todos",subpreguntaevaluacionLogic.getSubPreguntaEvaluacions() ); if(false) {//isMostrarTodosResultadosReporte //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.setSubPreguntaEvaluacions(new ArrayList<SubPreguntaEvaluacion>()); subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().addAll(subpreguntaevaluacionsAux); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacions=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacions.addAll(subpreguntaevaluacionsAux); } //ARCHITECTURE this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); } } } else if(sAccionBusqueda.equals("PorId")) { Long idSubPreguntaEvaluacion=0L; if(this.idActual!=null && this.idActual!=0L) { idSubPreguntaEvaluacion=this.idActual; } else if(this.idSubPreguntaEvaluacionActual!=null && this.idSubPreguntaEvaluacionActual!=0L) { idSubPreguntaEvaluacion=idSubPreguntaEvaluacionActual; } this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndicePorId(idSubPreguntaEvaluacion); this.subpreguntaevaluacions=new ArrayList<SubPreguntaEvaluacion>(); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.getEntity(idSubPreguntaEvaluacion); //subpreguntaevaluacionLogic.getEntityWithConnection(idSubPreguntaEvaluacion); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.setSubPreguntaEvaluacions(new ArrayList<SubPreguntaEvaluacion>()); subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().add(subpreguntaevaluacionLogic.getSubPreguntaEvaluacion()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacions=new ArrayList<SubPreguntaEvaluacion>(); this.subpreguntaevaluacions.add(subpreguntaevaluacion); } if(subpreguntaevaluacionLogic.getSubPreguntaEvaluacion()==null) { } } else if(sAccionBusqueda.equals("FK_IdEjercicio")) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdEjercicio(id_ejercicioFK_IdEjercicio); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { finalQueryGlobal=Funciones.GetFinalQueryAppendBusqueda(finalQueryGlobal, this.sFinalQueryGeneral,finalQueryPaginacion); subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdEjercicio(finalQueryGlobal,pagination,id_ejercicioFK_IdEjercicio); } else if(Constantes.ISUSAEJBREMOTE) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdEjercicio(id_ejercicioFK_IdEjercicio); } else if(Constantes.ISUSAEJBHOME) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdEjercicio(id_ejercicioFK_IdEjercicio); } //ARCHITECTURE Boolean isNoExiste=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { isNoExiste=subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()==null||subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().size()==0; } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { isNoExiste=subpreguntaevaluacions==null|| subpreguntaevaluacions.size()==0; } //ARCHITECTURE if(false && sTipoArchivoReporte!=""&&sTipoArchivoReporte!=null) {//this.isTipoArchivoReporte if(false) {//isMostrarTodosResultadosReporte this.pagination.setiFirstResult(-1); this.pagination.setiMaxResults(-1); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionsAux=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsAux.addAll(subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacionsAux=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsAux.addAll(subpreguntaevaluacions); } //ARCHITECTURE //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { finalQueryGlobal=Funciones.GetFinalQueryAppendBusqueda(finalQueryGlobal, this.sFinalQueryGeneral,""); subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdEjercicio(finalQueryGlobal,pagination,id_ejercicioFK_IdEjercicio); } else if(Constantes.ISUSAEJBREMOTE) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdEjercicio(id_ejercicioFK_IdEjercicio); } else if(Constantes.ISUSAEJBHOME) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdEjercicio(id_ejercicioFK_IdEjercicio); } //ARCHITECTURE } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { generarReporteSubPreguntaEvaluacions("FK_IdEjercicio",subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { generarReporteSubPreguntaEvaluacions("FK_IdEjercicio",subpreguntaevaluacions); } //ARCHITECTURE if(false) {//isMostrarTodosResultadosReporte this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.setSubPreguntaEvaluacions(new ArrayList<SubPreguntaEvaluacion>()); subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().addAll(subpreguntaevaluacionsAux); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacions=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacions.addAll(subpreguntaevaluacionsAux); } //ARCHITECTURE } } } else if(sAccionBusqueda.equals("FK_IdEmpresa")) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdEmpresa(id_empresaFK_IdEmpresa); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { finalQueryGlobal=Funciones.GetFinalQueryAppendBusqueda(finalQueryGlobal, this.sFinalQueryGeneral,finalQueryPaginacion); subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdEmpresa(finalQueryGlobal,pagination,id_empresaFK_IdEmpresa); } else if(Constantes.ISUSAEJBREMOTE) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdEmpresa(id_empresaFK_IdEmpresa); } else if(Constantes.ISUSAEJBHOME) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdEmpresa(id_empresaFK_IdEmpresa); } //ARCHITECTURE Boolean isNoExiste=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { isNoExiste=subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()==null||subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().size()==0; } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { isNoExiste=subpreguntaevaluacions==null|| subpreguntaevaluacions.size()==0; } //ARCHITECTURE if(false && sTipoArchivoReporte!=""&&sTipoArchivoReporte!=null) {//this.isTipoArchivoReporte if(false) {//isMostrarTodosResultadosReporte this.pagination.setiFirstResult(-1); this.pagination.setiMaxResults(-1); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionsAux=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsAux.addAll(subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacionsAux=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsAux.addAll(subpreguntaevaluacions); } //ARCHITECTURE //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { finalQueryGlobal=Funciones.GetFinalQueryAppendBusqueda(finalQueryGlobal, this.sFinalQueryGeneral,""); subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdEmpresa(finalQueryGlobal,pagination,id_empresaFK_IdEmpresa); } else if(Constantes.ISUSAEJBREMOTE) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdEmpresa(id_empresaFK_IdEmpresa); } else if(Constantes.ISUSAEJBHOME) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdEmpresa(id_empresaFK_IdEmpresa); } //ARCHITECTURE } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { generarReporteSubPreguntaEvaluacions("FK_IdEmpresa",subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { generarReporteSubPreguntaEvaluacions("FK_IdEmpresa",subpreguntaevaluacions); } //ARCHITECTURE if(false) {//isMostrarTodosResultadosReporte this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.setSubPreguntaEvaluacions(new ArrayList<SubPreguntaEvaluacion>()); subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().addAll(subpreguntaevaluacionsAux); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacions=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacions.addAll(subpreguntaevaluacionsAux); } //ARCHITECTURE } } } else if(sAccionBusqueda.equals("FK_IdPeriodo")) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdPeriodo(id_periodoFK_IdPeriodo); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { finalQueryGlobal=Funciones.GetFinalQueryAppendBusqueda(finalQueryGlobal, this.sFinalQueryGeneral,finalQueryPaginacion); subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdPeriodo(finalQueryGlobal,pagination,id_periodoFK_IdPeriodo); } else if(Constantes.ISUSAEJBREMOTE) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdPeriodo(id_periodoFK_IdPeriodo); } else if(Constantes.ISUSAEJBHOME) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdPeriodo(id_periodoFK_IdPeriodo); } //ARCHITECTURE Boolean isNoExiste=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { isNoExiste=subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()==null||subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().size()==0; } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { isNoExiste=subpreguntaevaluacions==null|| subpreguntaevaluacions.size()==0; } //ARCHITECTURE if(false && sTipoArchivoReporte!=""&&sTipoArchivoReporte!=null) {//this.isTipoArchivoReporte if(false) {//isMostrarTodosResultadosReporte this.pagination.setiFirstResult(-1); this.pagination.setiMaxResults(-1); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionsAux=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsAux.addAll(subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacionsAux=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsAux.addAll(subpreguntaevaluacions); } //ARCHITECTURE //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { finalQueryGlobal=Funciones.GetFinalQueryAppendBusqueda(finalQueryGlobal, this.sFinalQueryGeneral,""); subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdPeriodo(finalQueryGlobal,pagination,id_periodoFK_IdPeriodo); } else if(Constantes.ISUSAEJBREMOTE) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdPeriodo(id_periodoFK_IdPeriodo); } else if(Constantes.ISUSAEJBHOME) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdPeriodo(id_periodoFK_IdPeriodo); } //ARCHITECTURE } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { generarReporteSubPreguntaEvaluacions("FK_IdPeriodo",subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { generarReporteSubPreguntaEvaluacions("FK_IdPeriodo",subpreguntaevaluacions); } //ARCHITECTURE if(false) {//isMostrarTodosResultadosReporte this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.setSubPreguntaEvaluacions(new ArrayList<SubPreguntaEvaluacion>()); subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().addAll(subpreguntaevaluacionsAux); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacions=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacions.addAll(subpreguntaevaluacionsAux); } //ARCHITECTURE } } } else if(sAccionBusqueda.equals("FK_IdPreguntaEvaluacion")) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdPreguntaEvaluacion(id_pregunta_evaluacionFK_IdPreguntaEvaluacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { finalQueryGlobal=Funciones.GetFinalQueryAppendBusqueda(finalQueryGlobal, this.sFinalQueryGeneral,finalQueryPaginacion); subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdPreguntaEvaluacion(finalQueryGlobal,pagination,id_pregunta_evaluacionFK_IdPreguntaEvaluacion); } else if(Constantes.ISUSAEJBREMOTE) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdPreguntaEvaluacion(id_pregunta_evaluacionFK_IdPreguntaEvaluacion); } else if(Constantes.ISUSAEJBHOME) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdPreguntaEvaluacion(id_pregunta_evaluacionFK_IdPreguntaEvaluacion); } //ARCHITECTURE Boolean isNoExiste=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { isNoExiste=subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()==null||subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().size()==0; } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { isNoExiste=subpreguntaevaluacions==null|| subpreguntaevaluacions.size()==0; } //ARCHITECTURE if(false && sTipoArchivoReporte!=""&&sTipoArchivoReporte!=null) {//this.isTipoArchivoReporte if(false) {//isMostrarTodosResultadosReporte this.pagination.setiFirstResult(-1); this.pagination.setiMaxResults(-1); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionsAux=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsAux.addAll(subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacionsAux=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsAux.addAll(subpreguntaevaluacions); } //ARCHITECTURE //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { finalQueryGlobal=Funciones.GetFinalQueryAppendBusqueda(finalQueryGlobal, this.sFinalQueryGeneral,""); subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdPreguntaEvaluacion(finalQueryGlobal,pagination,id_pregunta_evaluacionFK_IdPreguntaEvaluacion); } else if(Constantes.ISUSAEJBREMOTE) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdPreguntaEvaluacion(id_pregunta_evaluacionFK_IdPreguntaEvaluacion); } else if(Constantes.ISUSAEJBHOME) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdPreguntaEvaluacion(id_pregunta_evaluacionFK_IdPreguntaEvaluacion); } //ARCHITECTURE } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { generarReporteSubPreguntaEvaluacions("FK_IdPreguntaEvaluacion",subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { generarReporteSubPreguntaEvaluacions("FK_IdPreguntaEvaluacion",subpreguntaevaluacions); } //ARCHITECTURE if(false) {//isMostrarTodosResultadosReporte this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.setSubPreguntaEvaluacions(new ArrayList<SubPreguntaEvaluacion>()); subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().addAll(subpreguntaevaluacionsAux); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacions=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacions.addAll(subpreguntaevaluacionsAux); } //ARCHITECTURE } } } else if(sAccionBusqueda.equals("FK_IdSucursal")) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdSucursal(id_sucursalFK_IdSucursal); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { finalQueryGlobal=Funciones.GetFinalQueryAppendBusqueda(finalQueryGlobal, this.sFinalQueryGeneral,finalQueryPaginacion); subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdSucursal(finalQueryGlobal,pagination,id_sucursalFK_IdSucursal); } else if(Constantes.ISUSAEJBREMOTE) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdSucursal(id_sucursalFK_IdSucursal); } else if(Constantes.ISUSAEJBHOME) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdSucursal(id_sucursalFK_IdSucursal); } //ARCHITECTURE Boolean isNoExiste=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { isNoExiste=subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()==null||subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().size()==0; } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { isNoExiste=subpreguntaevaluacions==null|| subpreguntaevaluacions.size()==0; } //ARCHITECTURE if(false && sTipoArchivoReporte!=""&&sTipoArchivoReporte!=null) {//this.isTipoArchivoReporte if(false) {//isMostrarTodosResultadosReporte this.pagination.setiFirstResult(-1); this.pagination.setiMaxResults(-1); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionsAux=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsAux.addAll(subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacionsAux=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsAux.addAll(subpreguntaevaluacions); } //ARCHITECTURE //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { finalQueryGlobal=Funciones.GetFinalQueryAppendBusqueda(finalQueryGlobal, this.sFinalQueryGeneral,""); subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdSucursal(finalQueryGlobal,pagination,id_sucursalFK_IdSucursal); } else if(Constantes.ISUSAEJBREMOTE) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdSucursal(id_sucursalFK_IdSucursal); } else if(Constantes.ISUSAEJBHOME) { this.sDetalleReporte=SubPreguntaEvaluacionConstantesFunciones.getDetalleIndiceFK_IdSucursal(id_sucursalFK_IdSucursal); } //ARCHITECTURE } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { generarReporteSubPreguntaEvaluacions("FK_IdSucursal",subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { generarReporteSubPreguntaEvaluacions("FK_IdSucursal",subpreguntaevaluacions); } //ARCHITECTURE if(false) {//isMostrarTodosResultadosReporte this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.setSubPreguntaEvaluacions(new ArrayList<SubPreguntaEvaluacion>()); subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().addAll(subpreguntaevaluacionsAux); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacions=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacions.addAll(subpreguntaevaluacionsAux); } //ARCHITECTURE } } } this.redimensionarTablaDatos(); //this.refrescarForeignKeysDescripcionesSubPreguntaEvaluacion(); if(this.conTotales) { this.crearFilaTotales(); } } catch (JRException e) { throw e; } catch(Exception e) { throw e; } finally { //this.finishProcessSubPreguntaEvaluacion(); } } public void redimensionarTablaDatos() throws Exception { int iSizeTabla=0; iSizeTabla=this.getSizeTablaDatos(); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { iSizeTabla=subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().size(); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { iSizeTabla=subpreguntaevaluacions.size(); } */ //ARCHITECTURE this.redimensionarTablaDatos(iSizeTabla); } public Integer getSizeTablaDatos() throws Exception { Integer iSizeTabla=0; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { iSizeTabla=subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().size(); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { iSizeTabla=subpreguntaevaluacions.size(); } //ARCHITECTURE return iSizeTabla; } public Boolean permiteMantenimiento(SubPreguntaEvaluacion subpreguntaevaluacion) { Boolean permite=true; if(this.subpreguntaevaluacion.getsType().equals(Constantes2.S_TOTALES)) { permite=false; } return permite; } public void traerValoresTablaTotales() throws Exception { } public void traerValoresTablaOrderBy() throws Exception { if(Constantes.ISUSAEJBLOGICLAYER) { this.arrOrderBy=SubPreguntaEvaluacionConstantesFunciones.getOrderByListaSubPreguntaEvaluacion(); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.arrOrderBy=SubPreguntaEvaluacionConstantesFunciones.getOrderByListaSubPreguntaEvaluacion(); } } public Boolean existeFilaTotales() throws Exception { Boolean existe=false; if(Constantes.ISUSAEJBLOGICLAYER) { for(SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()) { if(subpreguntaevaluacion.getsType().equals(Constantes2.S_TOTALES)) { subpreguntaevaluacionTotales=subpreguntaevaluacion; existe=true; break; } } } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { for(SubPreguntaEvaluacion subpreguntaevaluacion:this.subpreguntaevaluacions) { if(subpreguntaevaluacion.getsType().equals(Constantes2.S_TOTALES)) { subpreguntaevaluacionTotales=subpreguntaevaluacion; existe=true; break; } } } return existe; } public void crearFilaTotales() throws Exception { Boolean existe=false; existe=this.existeFilaTotales(); if(!existe) { //SI NO ES UNO A UNO SE CREA FILA TOTALES this.subpreguntaevaluacionAux=new SubPreguntaEvaluacion(); this.subpreguntaevaluacionAux.setsType(Constantes2.S_TOTALES); this.subpreguntaevaluacionAux.setIsNew(false); this.subpreguntaevaluacionAux.setIsChanged(false); this.subpreguntaevaluacionAux.setIsDeleted(false); if(Constantes.ISUSAEJBLOGICLAYER) { SubPreguntaEvaluacionConstantesFunciones.TotalizarValoresFilaSubPreguntaEvaluacion(this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions(),this.subpreguntaevaluacionAux); this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().add(this.subpreguntaevaluacionAux); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { SubPreguntaEvaluacionConstantesFunciones.TotalizarValoresFilaSubPreguntaEvaluacion(this.subpreguntaevaluacions,this.subpreguntaevaluacionAux); this.subpreguntaevaluacions.add(this.subpreguntaevaluacionAux); } } } public void quitarFilaTotales() throws Exception { subpreguntaevaluacionTotales=new SubPreguntaEvaluacion(); Boolean existe=false; if(Constantes.ISUSAEJBLOGICLAYER) { existe=this.existeFilaTotales(); if(existe) { this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().remove(subpreguntaevaluacionTotales); } } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { existe=this.existeFilaTotales(); if(existe) { this.subpreguntaevaluacions.remove(subpreguntaevaluacionTotales); } } } public void actualizarFilaTotales() throws Exception { subpreguntaevaluacionTotales=new SubPreguntaEvaluacion(); Boolean existe=false; if(Constantes.ISUSAEJBLOGICLAYER) { for(SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()) { if(subpreguntaevaluacion.getsType().equals(Constantes2.S_TOTALES)) { subpreguntaevaluacionTotales=subpreguntaevaluacion; existe=true; break; } } if(existe) { SubPreguntaEvaluacionConstantesFunciones.TotalizarValoresFilaSubPreguntaEvaluacion(this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions(),subpreguntaevaluacionTotales); } } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { for(SubPreguntaEvaluacion subpreguntaevaluacion:this.subpreguntaevaluacions) { if(subpreguntaevaluacion.getsType().equals(Constantes2.S_TOTALES)) { subpreguntaevaluacionTotales=subpreguntaevaluacion; existe=true; break; } } if(existe) { SubPreguntaEvaluacionConstantesFunciones.TotalizarValoresFilaSubPreguntaEvaluacion(this.subpreguntaevaluacions,subpreguntaevaluacionTotales); } } } public void recargarInformacion()throws Exception { try { sAccionBusqueda="Todos"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void getSubPreguntaEvaluacionsFK_IdEjercicio()throws Exception { try { sAccionBusqueda="FK_IdEjercicio"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } } public void getSubPreguntaEvaluacionsFK_IdEmpresa()throws Exception { try { sAccionBusqueda="FK_IdEmpresa"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } } public void getSubPreguntaEvaluacionsFK_IdPeriodo()throws Exception { try { sAccionBusqueda="FK_IdPeriodo"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } } public void getSubPreguntaEvaluacionsFK_IdPreguntaEvaluacion()throws Exception { try { sAccionBusqueda="FK_IdPreguntaEvaluacion"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } } public void getSubPreguntaEvaluacionsFK_IdSucursal()throws Exception { try { sAccionBusqueda="FK_IdSucursal"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } } public void getSubPreguntaEvaluacionsFK_IdEjercicio(String sFinalQuery,Long id_ejercicio)throws Exception { try { this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdEjercicio(sFinalQuery,this.pagination,id_ejercicio); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } catch(Exception e) { throw e; } } public void getSubPreguntaEvaluacionsFK_IdEmpresa(String sFinalQuery,Long id_empresa)throws Exception { try { this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdEmpresa(sFinalQuery,this.pagination,id_empresa); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } catch(Exception e) { throw e; } } public void getSubPreguntaEvaluacionsFK_IdPeriodo(String sFinalQuery,Long id_periodo)throws Exception { try { this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdPeriodo(sFinalQuery,this.pagination,id_periodo); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } catch(Exception e) { throw e; } } public void getSubPreguntaEvaluacionsFK_IdPreguntaEvaluacion(String sFinalQuery,Long id_pregunta_evaluacion)throws Exception { try { this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdPreguntaEvaluacion(sFinalQuery,this.pagination,id_pregunta_evaluacion); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } catch(Exception e) { throw e; } } public void getSubPreguntaEvaluacionsFK_IdSucursal(String sFinalQuery,Long id_sucursal)throws Exception { try { this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLogic.getSubPreguntaEvaluacionsFK_IdSucursal(sFinalQuery,this.pagination,id_sucursal); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } catch(Exception e) { throw e; } } public void onLoad()throws Exception { try { isEntroOnLoad=true; //INTENTA TRAER DATOS DE BUSQUEDA ANTERIOR this.traerDatosBusquedaDesdeSession(); //SINO SE CUMPLE VIENE DE PADRE FOREIGN O BUSQUEDA ANTIGUA if(this.sAccionBusqueda.equals("")) { this.sAccionBusqueda="Todos"; } this.procesarBusqueda(sAccionBusqueda); } catch (Exception e) { throw e; } } public void inicializarPermisosSubPreguntaEvaluacion() { this.isPermisoTodoSubPreguntaEvaluacion=false; this.isPermisoNuevoSubPreguntaEvaluacion=false; this.isPermisoActualizarSubPreguntaEvaluacion=false; this.isPermisoActualizarOriginalSubPreguntaEvaluacion=false; this.isPermisoEliminarSubPreguntaEvaluacion=false; this.isPermisoGuardarCambiosSubPreguntaEvaluacion=false; this.isPermisoConsultaSubPreguntaEvaluacion=false; this.isPermisoBusquedaSubPreguntaEvaluacion=false; this.isPermisoReporteSubPreguntaEvaluacion=false; this.isPermisoOrdenSubPreguntaEvaluacion=false; this.isPermisoPaginacionMedioSubPreguntaEvaluacion=false; this.isPermisoPaginacionAltoSubPreguntaEvaluacion=false; this.isPermisoPaginacionTodoSubPreguntaEvaluacion=false; this.isPermisoCopiarSubPreguntaEvaluacion=false; this.isPermisoVerFormSubPreguntaEvaluacion=false; this.isPermisoDuplicarSubPreguntaEvaluacion=false; this.isPermisoOrdenSubPreguntaEvaluacion=false; } public void setPermisosUsuarioSubPreguntaEvaluacion(Boolean isPermiso) { this.isPermisoTodoSubPreguntaEvaluacion=isPermiso; this.isPermisoNuevoSubPreguntaEvaluacion=isPermiso; this.isPermisoActualizarSubPreguntaEvaluacion=isPermiso; this.isPermisoActualizarOriginalSubPreguntaEvaluacion=isPermiso; this.isPermisoEliminarSubPreguntaEvaluacion=isPermiso; this.isPermisoGuardarCambiosSubPreguntaEvaluacion=isPermiso; this.isPermisoConsultaSubPreguntaEvaluacion=isPermiso; this.isPermisoBusquedaSubPreguntaEvaluacion=isPermiso; this.isPermisoReporteSubPreguntaEvaluacion=isPermiso; this.isPermisoOrdenSubPreguntaEvaluacion=isPermiso; this.isPermisoPaginacionMedioSubPreguntaEvaluacion=isPermiso; this.isPermisoPaginacionAltoSubPreguntaEvaluacion=isPermiso; this.isPermisoPaginacionTodoSubPreguntaEvaluacion=isPermiso; this.isPermisoCopiarSubPreguntaEvaluacion=isPermiso; this.isPermisoVerFormSubPreguntaEvaluacion=isPermiso; this.isPermisoDuplicarSubPreguntaEvaluacion=isPermiso; this.isPermisoOrdenSubPreguntaEvaluacion=isPermiso; } public void setPermisosMantenimientoUsuarioSubPreguntaEvaluacion(Boolean isPermiso) { //this.isPermisoTodoSubPreguntaEvaluacion=isPermiso; this.isPermisoNuevoSubPreguntaEvaluacion=isPermiso; this.isPermisoActualizarSubPreguntaEvaluacion=isPermiso; this.isPermisoActualizarOriginalSubPreguntaEvaluacion=isPermiso; this.isPermisoEliminarSubPreguntaEvaluacion=isPermiso; this.isPermisoGuardarCambiosSubPreguntaEvaluacion=isPermiso; //this.isPermisoConsultaSubPreguntaEvaluacion=isPermiso; //this.isPermisoBusquedaSubPreguntaEvaluacion=isPermiso; //this.isPermisoReporteSubPreguntaEvaluacion=isPermiso; //this.isPermisoOrdenSubPreguntaEvaluacion=isPermiso; //this.isPermisoPaginacionMedioSubPreguntaEvaluacion=isPermiso; //this.isPermisoPaginacionAltoSubPreguntaEvaluacion=isPermiso; //this.isPermisoPaginacionTodoSubPreguntaEvaluacion=isPermiso; //this.isPermisoCopiarSubPreguntaEvaluacion=isPermiso; //this.isPermisoDuplicarSubPreguntaEvaluacion=isPermiso; //this.isPermisoOrdenSubPreguntaEvaluacion=isPermiso; } public void inicializarSetPermisosUsuarioSubPreguntaEvaluacionClasesRelacionadas() throws Exception { ArrayList<String> arrPaginas=new ArrayList<String>(); ArrayList<Opcion> opcionsFinal=new ArrayList<Opcion>(); arrPaginas.add(DetalleEvaluacionProveedorConstantesFunciones.SNOMBREOPCION); if(SubPreguntaEvaluacionJInternalFrame.CON_LLAMADA_SIMPLE) { this.opcionsRelacionadas.addAll(this.sistemaReturnGeneral.getOpcionsRelacionadas()); } else { if(Constantes.ISUSAEJBLOGICLAYER) { opcionsFinal=sistemaLogicAdditional.tienePermisosOpcionesEnPaginaWeb(this.usuarioActual, Constantes.LIDSISTEMAACTUAL, arrPaginas); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } this.opcionsRelacionadas.addAll(opcionsFinal); } this.isTienePermisosDetalleEvaluacionProveedor=false; this.isTienePermisosDetalleEvaluacionProveedor=this.verificarGetPermisosUsuarioOpcionSubPreguntaEvaluacionClaseRelacionada(this.opcionsRelacionadas,DetalleEvaluacionProveedorConstantesFunciones.SNOMBREOPCION); } public Boolean tienePermisosUsuarioEnPaginaWebSubPreguntaEvaluacion(String sPagina) throws Exception { Boolean tienePermisos=false; if(Constantes.ISUSAEJBLOGICLAYER) { tienePermisos=sistemaLogicAdditional.tienePermisosEnPaginaWeb(this.usuarioActual, Constantes.LIDSISTEMAACTUAL, sPagina); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } return tienePermisos; } public void inicializarSetPermisosUsuarioSubPreguntaEvaluacionClasesRelacionadas(Boolean conPermiso) throws Exception { this.isTienePermisosDetalleEvaluacionProveedor=conPermiso; } public Boolean verificarGetPermisosUsuarioSubPreguntaEvaluacionClaseRelacionada(ArrayList<String> arrPaginasFinal,String sPaginaActual) throws Exception { Boolean verificado=false; verificado=Funciones2.verificarGetPermisosUsuarioClaseRelacionada(arrPaginasFinal,sPaginaActual); return verificado; } public Boolean verificarGetPermisosUsuarioOpcionSubPreguntaEvaluacionClaseRelacionada(List<Opcion> opcionsFinal,String sPaginaActual) throws Exception { Boolean verificado=false; verificado=Funciones2.verificarGetPermisosUsuarioOpcionClaseRelacionada(opcionsFinal,sPaginaActual); return verificado; } public void actualizarTabsSetPermisosUsuarioSubPreguntaEvaluacionClasesRelacionadas() throws Exception { if(!this.isTienePermisosDetalleEvaluacionProveedor && this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTabbedPaneRelacionesSubPreguntaEvaluacion.remove(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.getContentPane()); } } public void setPermisosUsuarioSubPreguntaEvaluacion() throws Exception { PerfilOpcion perfilOpcionUsuario=new PerfilOpcion(); Long idOpcion=this.opcionActual.getId(); if(SubPreguntaEvaluacionJInternalFrame.CON_LLAMADA_SIMPLE) { perfilOpcionUsuario=this.sistemaReturnGeneral.getPerfilOpcion(); } else { if(this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { idOpcion=0L; } if(Constantes.ISUSAEJBLOGICLAYER) { perfilOpcionUsuario=sistemaLogicAdditional.traerPermisosPaginaWebPerfilOpcion(this.usuarioActual, Constantes.LIDSISTEMAACTUAL, SubPreguntaEvaluacionConstantesFunciones.SNOMBREOPCION,idOpcion); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } } if(perfilOpcionUsuario!=null && perfilOpcionUsuario.getId()>0) { this.isPermisoNuevoSubPreguntaEvaluacion=perfilOpcionUsuario.getingreso()||perfilOpcionUsuario.gettodo(); this.isPermisoActualizarSubPreguntaEvaluacion=perfilOpcionUsuario.getmodificacion()||perfilOpcionUsuario.gettodo(); this.isPermisoActualizarOriginalSubPreguntaEvaluacion=this.isPermisoActualizarSubPreguntaEvaluacion; this.isPermisoEliminarSubPreguntaEvaluacion=perfilOpcionUsuario.geteliminacion()||perfilOpcionUsuario.gettodo(); this.isPermisoGuardarCambiosSubPreguntaEvaluacion=perfilOpcionUsuario.getguardar_cambios()||perfilOpcionUsuario.gettodo(); this.isPermisoConsultaSubPreguntaEvaluacion=perfilOpcionUsuario.getconsulta()||perfilOpcionUsuario.gettodo(); this.isPermisoBusquedaSubPreguntaEvaluacion=perfilOpcionUsuario.getbusqueda()||perfilOpcionUsuario.gettodo(); this.isPermisoTodoSubPreguntaEvaluacion=perfilOpcionUsuario.gettodo()||perfilOpcionUsuario.gettodo(); this.isPermisoReporteSubPreguntaEvaluacion=perfilOpcionUsuario.getreporte()||perfilOpcionUsuario.gettodo(); this.isPermisoOrdenSubPreguntaEvaluacion=perfilOpcionUsuario.getorden()||perfilOpcionUsuario.gettodo(); this.isPermisoPaginacionMedioSubPreguntaEvaluacion=perfilOpcionUsuario.getpaginacion_medio()||perfilOpcionUsuario.gettodo(); this.isPermisoPaginacionAltoSubPreguntaEvaluacion=perfilOpcionUsuario.getpaginacion_alto()||perfilOpcionUsuario.gettodo(); this.isPermisoPaginacionTodoSubPreguntaEvaluacion=perfilOpcionUsuario.getpaginacion_todo()||perfilOpcionUsuario.gettodo(); this.isPermisoCopiarSubPreguntaEvaluacion=perfilOpcionUsuario.getcopiar()||perfilOpcionUsuario.gettodo(); this.isPermisoVerFormSubPreguntaEvaluacion=true;//perfilOpcionUsuario.getver_form()||perfilOpcionUsuario.gettodo(); this.isPermisoDuplicarSubPreguntaEvaluacion=perfilOpcionUsuario.getduplicar()||perfilOpcionUsuario.gettodo(); this.isPermisoOrdenSubPreguntaEvaluacion=perfilOpcionUsuario.getorden()||perfilOpcionUsuario.gettodo(); if(this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { this.opcionActual.setId(perfilOpcionUsuario.getid_opcion()); this.jTableDatosSubPreguntaEvaluacion.setToolTipText(this.jTableDatosSubPreguntaEvaluacion.getToolTipText()+"_"+perfilOpcionUsuario.getid_opcion()); } } else { this.setPermisosUsuarioSubPreguntaEvaluacion(false); } //SI SE NECESITA PONER TODOS LOS PERMISOS POR DEFECTO // } public void setAccionesUsuarioSubPreguntaEvaluacion(Boolean esParaAccionesFormulario) throws Exception { Reporte reporte=null; if(!esParaAccionesFormulario) { this.accions=new ArrayList<Accion>(); if(SubPreguntaEvaluacionJInternalFrame.CON_LLAMADA_SIMPLE) { this.accions=this.sistemaReturnGeneral.getAccions(); } else { if(Constantes.ISUSAEJBLOGICLAYER) { this.accions=sistemaLogicAdditional.getAccionesUsuario(this.usuarioActual,this.opcionActual,false); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } } if(this.accions.size()>0) { for(Accion accion:this.accions) { reporte=new Reporte(); reporte.setsCodigo(accion.getcodigo()); reporte.setsDescripcion(accion.getnombre()); this.tiposAcciones.add(reporte); } } reporte=new Reporte(); reporte.setsCodigo(""); reporte.setsDescripcion(""); this.tiposAcciones.add(reporte); } else { //ACCIONES FORMULARIO this.accionsFormulario=new ArrayList<Accion>(); if(SubPreguntaEvaluacionJInternalFrame.CON_LLAMADA_SIMPLE) { this.accionsFormulario=this.sistemaReturnGeneral.getAccionsFormulario(); } else { if(Constantes.ISUSAEJBLOGICLAYER) { this.accionsFormulario=sistemaLogicAdditional.getAccionesUsuario(this.usuarioActual,this.opcionActual,true); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } } if(this.accionsFormulario.size()>0) { for(Accion accion:this.accionsFormulario) { reporte=new Reporte(); reporte.setsCodigo(accion.getcodigo()); reporte.setsDescripcion(accion.getnombre()); this.tiposAccionesFormulario.add(reporte); } } reporte=new Reporte(); reporte.setsCodigo(""); reporte.setsDescripcion(""); this.tiposAccionesFormulario.add(reporte); } } public void setRelacionesUsuarioSubPreguntaEvaluacion() throws Exception { Reporte reporte=null; if(this.isTienePermisosDetalleEvaluacionProveedor && this.subpreguntaevaluacionConstantesFunciones.mostrarDetalleEvaluacionProveedorSubPreguntaEvaluacion && !SubPreguntaEvaluacionConstantesFunciones.ISGUARDARREL) { reporte=new Reporte(); reporte.setsCodigo("Detalle Evaluacion Proveedor"); reporte.setsDescripcion("Detalle Evaluacion Proveedor"); this.tiposRelaciones.add(reporte); } //<NAME> Collections.sort(this.tiposRelaciones, new ReporteComparator()); /* reporte=new Reporte(); reporte.setsCodigo(accion.getcodigo()); reporte.setsDescripcion(accion.getnombre()); this.tiposRelaciones.add(reporte); */ } @SuppressWarnings({ "unchecked", "rawtypes" } ) public void inicializarCombosForeignKeySubPreguntaEvaluacionListas()throws Exception { try { this.empresasForeignKey=new ArrayList(); this.sucursalsForeignKey=new ArrayList(); this.preguntaevaluacionsForeignKey=new ArrayList(); this.ejerciciosForeignKey=new ArrayList(); this.periodosForeignKey=new ArrayList(); } catch(Exception e) { throw e; } } public void cargarCombosTodosForeignKeySubPreguntaEvaluacionListas(Boolean cargarCombosDependencia)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; String sFinalQueryCombo=""; Modulo moduloActualAux=new Modulo(); if(SubPreguntaEvaluacionJInternalFrame.ISLOAD_FKLOTE) { this.cargarCombosLoteForeignKeySubPreguntaEvaluacionListas(false); } else { this.cargarCombosForeignKeyEmpresaListas(cargarCombosDependencia,sFinalQueryCombo); this.cargarCombosForeignKeySucursalListas(cargarCombosDependencia,sFinalQueryCombo); this.cargarCombosForeignKeyPreguntaEvaluacionListas(cargarCombosDependencia,sFinalQueryCombo); this.cargarCombosForeignKeyEjercicioListas(cargarCombosDependencia,sFinalQueryCombo); this.cargarCombosForeignKeyPeriodoListas(cargarCombosDependencia,sFinalQueryCombo); } } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyEmpresaListas(Boolean cargarCombosDependencia,String sFinalQuery)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; Modulo moduloActualAux=new Modulo(); if((this.empresasForeignKey==null||this.empresasForeignKey.size()<=0)) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=EmpresaConstantesFunciones.getArrayColumnasGlobalesEmpresa(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,EmpresaConstantesFunciones.TABLENAME); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, sFinalQuery); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, ""); finalQueryGlobal+=EmpresaConstantesFunciones.SFINALQUERY; this.cargarCombosEmpresasForeignKeyLista(finalQueryGlobal); } } catch(Exception e) { throw e; } } public void cargarCombosForeignKeySucursalListas(Boolean cargarCombosDependencia,String sFinalQuery)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; Modulo moduloActualAux=new Modulo(); if((this.sucursalsForeignKey==null||this.sucursalsForeignKey.size()<=0)) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=SucursalConstantesFunciones.getArrayColumnasGlobalesSucursal(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,SucursalConstantesFunciones.TABLENAME); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, sFinalQuery); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, ""); finalQueryGlobal+=SucursalConstantesFunciones.SFINALQUERY; this.cargarCombosSucursalsForeignKeyLista(finalQueryGlobal); } } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyPreguntaEvaluacionListas(Boolean cargarCombosDependencia,String sFinalQuery)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; Modulo moduloActualAux=new Modulo(); if((this.preguntaevaluacionsForeignKey==null||this.preguntaevaluacionsForeignKey.size()<=0)) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=PreguntaEvaluacionConstantesFunciones.getArrayColumnasGlobalesPreguntaEvaluacion(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,PreguntaEvaluacionConstantesFunciones.TABLENAME); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, sFinalQuery); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, ""); finalQueryGlobal+=PreguntaEvaluacionConstantesFunciones.SFINALQUERY; this.cargarCombosPreguntaEvaluacionsForeignKeyLista(finalQueryGlobal); } } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyEjercicioListas(Boolean cargarCombosDependencia,String sFinalQuery)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; Modulo moduloActualAux=new Modulo(); if((this.ejerciciosForeignKey==null||this.ejerciciosForeignKey.size()<=0)) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=EjercicioConstantesFunciones.getArrayColumnasGlobalesEjercicio(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,EjercicioConstantesFunciones.TABLENAME); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, sFinalQuery); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, ""); finalQueryGlobal+=EjercicioConstantesFunciones.SFINALQUERY; this.cargarCombosEjerciciosForeignKeyLista(finalQueryGlobal); } } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyPeriodoListas(Boolean cargarCombosDependencia,String sFinalQuery)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; Modulo moduloActualAux=new Modulo(); if((this.periodosForeignKey==null||this.periodosForeignKey.size()<=0)) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=PeriodoConstantesFunciones.getArrayColumnasGlobalesPeriodo(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,PeriodoConstantesFunciones.TABLENAME); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, sFinalQuery); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, ""); finalQueryGlobal+=PeriodoConstantesFunciones.SFINALQUERY; this.cargarCombosPeriodosForeignKeyLista(finalQueryGlobal); } } catch(Exception e) { throw e; } } public void cargarCombosLoteForeignKeySubPreguntaEvaluacionListas(Boolean cargarCombosDependencia)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; Modulo moduloActualAux=new Modulo(); SubPreguntaEvaluacionParameterReturnGeneral subpreguntaevaluacionReturnGeneral=new SubPreguntaEvaluacionParameterReturnGeneral(); String finalQueryGlobalEmpresa=""; if(((this.empresasForeignKey==null||this.empresasForeignKey.size()<=0) && this.subpreguntaevaluacionConstantesFunciones.cargarid_empresaSubPreguntaEvaluacion) || (this.esRecargarFks && this.subpreguntaevaluacionConstantesFunciones.cargarid_empresaSubPreguntaEvaluacion)) { if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionEmpresa()) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=EmpresaConstantesFunciones.getArrayColumnasGlobalesEmpresa(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobalEmpresa=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,EmpresaConstantesFunciones.TABLENAME); finalQueryGlobalEmpresa=Funciones.GetFinalQueryAppend(finalQueryGlobalEmpresa, ""); finalQueryGlobalEmpresa+=EmpresaConstantesFunciones.SFINALQUERY; //this.cargarCombosEmpresasForeignKeyLista(finalQueryGlobal); } else { finalQueryGlobalEmpresa=" WHERE " + ConstantesSql.ID + "="+subpreguntaevaluacionSessionBean.getlidEmpresaActual(); } } else { finalQueryGlobalEmpresa="NONE"; } String finalQueryGlobalSucursal=""; if(((this.sucursalsForeignKey==null||this.sucursalsForeignKey.size()<=0) && this.subpreguntaevaluacionConstantesFunciones.cargarid_sucursalSubPreguntaEvaluacion) || (this.esRecargarFks && this.subpreguntaevaluacionConstantesFunciones.cargarid_sucursalSubPreguntaEvaluacion)) { if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionSucursal()) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=SucursalConstantesFunciones.getArrayColumnasGlobalesSucursal(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobalSucursal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,SucursalConstantesFunciones.TABLENAME); finalQueryGlobalSucursal=Funciones.GetFinalQueryAppend(finalQueryGlobalSucursal, ""); finalQueryGlobalSucursal+=SucursalConstantesFunciones.SFINALQUERY; //this.cargarCombosSucursalsForeignKeyLista(finalQueryGlobal); } else { finalQueryGlobalSucursal=" WHERE " + ConstantesSql.ID + "="+subpreguntaevaluacionSessionBean.getlidSucursalActual(); } } else { finalQueryGlobalSucursal="NONE"; } String finalQueryGlobalPreguntaEvaluacion=""; if(((this.preguntaevaluacionsForeignKey==null||this.preguntaevaluacionsForeignKey.size()<=0) && this.subpreguntaevaluacionConstantesFunciones.cargarid_pregunta_evaluacionSubPreguntaEvaluacion) || (this.esRecargarFks && this.subpreguntaevaluacionConstantesFunciones.cargarid_pregunta_evaluacionSubPreguntaEvaluacion)) { if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionPreguntaEvaluacion()) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=PreguntaEvaluacionConstantesFunciones.getArrayColumnasGlobalesPreguntaEvaluacion(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobalPreguntaEvaluacion=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,PreguntaEvaluacionConstantesFunciones.TABLENAME); finalQueryGlobalPreguntaEvaluacion=Funciones.GetFinalQueryAppend(finalQueryGlobalPreguntaEvaluacion, ""); finalQueryGlobalPreguntaEvaluacion+=PreguntaEvaluacionConstantesFunciones.SFINALQUERY; //this.cargarCombosPreguntaEvaluacionsForeignKeyLista(finalQueryGlobal); } else { finalQueryGlobalPreguntaEvaluacion=" WHERE " + ConstantesSql.ID + "="+subpreguntaevaluacionSessionBean.getlidPreguntaEvaluacionActual(); } } else { finalQueryGlobalPreguntaEvaluacion="NONE"; } String finalQueryGlobalEjercicio=""; if(((this.ejerciciosForeignKey==null||this.ejerciciosForeignKey.size()<=0) && this.subpreguntaevaluacionConstantesFunciones.cargarid_ejercicioSubPreguntaEvaluacion) || (this.esRecargarFks && this.subpreguntaevaluacionConstantesFunciones.cargarid_ejercicioSubPreguntaEvaluacion)) { if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionEjercicio()) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=EjercicioConstantesFunciones.getArrayColumnasGlobalesEjercicio(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobalEjercicio=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,EjercicioConstantesFunciones.TABLENAME); finalQueryGlobalEjercicio=Funciones.GetFinalQueryAppend(finalQueryGlobalEjercicio, ""); finalQueryGlobalEjercicio+=EjercicioConstantesFunciones.SFINALQUERY; //this.cargarCombosEjerciciosForeignKeyLista(finalQueryGlobal); } else { finalQueryGlobalEjercicio=" WHERE " + ConstantesSql.ID + "="+subpreguntaevaluacionSessionBean.getlidEjercicioActual(); } } else { finalQueryGlobalEjercicio="NONE"; } String finalQueryGlobalPeriodo=""; if(((this.periodosForeignKey==null||this.periodosForeignKey.size()<=0) && this.subpreguntaevaluacionConstantesFunciones.cargarid_periodoSubPreguntaEvaluacion) || (this.esRecargarFks && this.subpreguntaevaluacionConstantesFunciones.cargarid_periodoSubPreguntaEvaluacion)) { if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionPeriodo()) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=PeriodoConstantesFunciones.getArrayColumnasGlobalesPeriodo(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobalPeriodo=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,PeriodoConstantesFunciones.TABLENAME); finalQueryGlobalPeriodo=Funciones.GetFinalQueryAppend(finalQueryGlobalPeriodo, ""); finalQueryGlobalPeriodo+=PeriodoConstantesFunciones.SFINALQUERY; //this.cargarCombosPeriodosForeignKeyLista(finalQueryGlobal); } else { finalQueryGlobalPeriodo=" WHERE " + ConstantesSql.ID + "="+subpreguntaevaluacionSessionBean.getlidPeriodoActual(); } } else { finalQueryGlobalPeriodo="NONE"; } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionReturnGeneral=subpreguntaevaluacionLogic.cargarCombosLoteForeignKeySubPreguntaEvaluacion(finalQueryGlobalEmpresa,finalQueryGlobalSucursal,finalQueryGlobalPreguntaEvaluacion,finalQueryGlobalEjercicio,finalQueryGlobalPeriodo);//WithConnection } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE if(!finalQueryGlobalEmpresa.equals("NONE")) { this.empresasForeignKey=subpreguntaevaluacionReturnGeneral.getempresasForeignKey(); } if(!finalQueryGlobalSucursal.equals("NONE")) { this.sucursalsForeignKey=subpreguntaevaluacionReturnGeneral.getsucursalsForeignKey(); } if(!finalQueryGlobalPreguntaEvaluacion.equals("NONE")) { this.preguntaevaluacionsForeignKey=subpreguntaevaluacionReturnGeneral.getpreguntaevaluacionsForeignKey(); } if(!finalQueryGlobalEjercicio.equals("NONE")) { this.ejerciciosForeignKey=subpreguntaevaluacionReturnGeneral.getejerciciosForeignKey(); } if(!finalQueryGlobalPeriodo.equals("NONE")) { this.periodosForeignKey=subpreguntaevaluacionReturnGeneral.getperiodosForeignKey(); } } catch(Exception e) { throw e; } } public void addItemDefectoCombosTodosForeignKeySubPreguntaEvaluacion()throws Exception { try { this.addItemDefectoCombosForeignKeyEmpresa(); this.addItemDefectoCombosForeignKeySucursal(); this.addItemDefectoCombosForeignKeyPreguntaEvaluacion(); this.addItemDefectoCombosForeignKeyEjercicio(); this.addItemDefectoCombosForeignKeyPeriodo(); } catch(Exception e) { throw e; } } public void addItemDefectoCombosForeignKeyEmpresa()throws Exception { try { if(this.subpreguntaevaluacionSessionBean==null) { this.subpreguntaevaluacionSessionBean=new SubPreguntaEvaluacionSessionBean(); } if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionEmpresa()) { Empresa empresa=new Empresa(); EmpresaConstantesFunciones.setEmpresaDescripcion(empresa,Constantes.SMENSAJE_ESCOJA_OPCION); empresa.setId(null); if(!EmpresaConstantesFunciones.ExisteEnLista(this.empresasForeignKey,empresa,true)) { this.empresasForeignKey.add(0,empresa); } } } catch(Exception e) { throw e; } } public void addItemDefectoCombosForeignKeySucursal()throws Exception { try { if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionSucursal()) { Sucursal sucursal=new Sucursal(); SucursalConstantesFunciones.setSucursalDescripcion(sucursal,Constantes.SMENSAJE_ESCOJA_OPCION); sucursal.setId(null); if(!SucursalConstantesFunciones.ExisteEnLista(this.sucursalsForeignKey,sucursal,true)) { this.sucursalsForeignKey.add(0,sucursal); } } } catch(Exception e) { throw e; } } public void addItemDefectoCombosForeignKeyPreguntaEvaluacion()throws Exception { try { if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionPreguntaEvaluacion()) { PreguntaEvaluacion preguntaevaluacion=new PreguntaEvaluacion(); PreguntaEvaluacionConstantesFunciones.setPreguntaEvaluacionDescripcion(preguntaevaluacion,Constantes.SMENSAJE_ESCOJA_OPCION); preguntaevaluacion.setId(null); if(!PreguntaEvaluacionConstantesFunciones.ExisteEnLista(this.preguntaevaluacionsForeignKey,preguntaevaluacion,true)) { this.preguntaevaluacionsForeignKey.add(0,preguntaevaluacion); } } } catch(Exception e) { throw e; } } public void addItemDefectoCombosForeignKeyEjercicio()throws Exception { try { if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionEjercicio()) { Ejercicio ejercicio=new Ejercicio(); EjercicioConstantesFunciones.setEjercicioDescripcion(ejercicio,Constantes.SMENSAJE_ESCOJA_OPCION); ejercicio.setId(null); if(!EjercicioConstantesFunciones.ExisteEnLista(this.ejerciciosForeignKey,ejercicio,true)) { this.ejerciciosForeignKey.add(0,ejercicio); } } } catch(Exception e) { throw e; } } public void addItemDefectoCombosForeignKeyPeriodo()throws Exception { try { if(!this.subpreguntaevaluacionSessionBean.getisBusquedaDesdeForeignKeySesionPeriodo()) { Periodo periodo=new Periodo(); PeriodoConstantesFunciones.setPeriodoDescripcion(periodo,Constantes.SMENSAJE_ESCOJA_OPCION); periodo.setId(null); if(!PeriodoConstantesFunciones.ExisteEnLista(this.periodosForeignKey,periodo,true)) { this.periodosForeignKey.add(0,periodo); } } } catch(Exception e) { throw e; } } public void initActionsCombosTodosForeignKeySubPreguntaEvaluacion()throws Exception { try { } catch(Exception e) { throw e; } } public void initActionsCombosTodosForeignKeySubPreguntaEvaluacion(String sFormularioTipoBusqueda)throws Exception { try { } catch(Exception e) { throw e; } } public void setVariablesGlobalesCombosForeignKeySubPreguntaEvaluacion()throws Exception { try { if(this.parametroGeneralUsuario!=null && this.parametroGeneralUsuario.getId()>0) { this.setActualEmpresaForeignKey(this.parametroGeneralUsuario.getid_empresa(),false,"Formulario"); this.setActualSucursalForeignKey(this.parametroGeneralUsuario.getid_sucursal(),false,"Formulario"); this.setActualEjercicioForeignKey(this.parametroGeneralUsuario.getid_ejercicio(),false,"Formulario"); this.setActualPeriodoForeignKey(this.parametroGeneralUsuario.getid_periodo(),false,"Formulario"); } //INICIALIZA VARIABLES COMBOS GLOBALES AUXILIARES A FORMULARIO(Anio,Mes) this.setVariablesGlobalesAuxiliaresCombosForeignKeySubPreguntaEvaluacion(); } catch(Exception e) { throw e; } } public void setVariablesObjetoActualToFormularioForeignKeySubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion)throws Exception { try { this.setActualPreguntaEvaluacionForeignKey(subpreguntaevaluacion.getid_pregunta_evaluacion(),false,"Formulario"); } catch(Exception e) { throw e; } } public void setVariablesObjetoActualToListasForeignKeySubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion,String sTipoEvento)throws Exception { try { } catch(Exception e) { throw e; } } /* public void setVariablesCombosFromBeanForeignKeySubPreguntaEvaluacion()throws Exception { try { this.setActualPreguntaEvaluacionForeignKey(this.subpreguntaevaluacionConstantesFunciones.getid_pregunta_evaluacion(),false,"Formulario"); } catch(Exception e) { throw e; } } */ public void setVariablesGlobalesAuxiliaresCombosForeignKeySubPreguntaEvaluacion()throws Exception { try { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { Ejercicio ejercicioActual=(Ejercicio)this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.getSelectedItem(); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { Periodo periodoActual=(Periodo)this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.getSelectedItem(); } } catch(Exception e) { throw e; } } public void setVariablesDefaultCombosForeignKeySubPreguntaEvaluacion()throws Exception { try { } catch(Exception e) { throw e; } } public void setVariablesParametroCombosForeignKeySubPreguntaEvaluacion()throws Exception { try { } catch(Exception e) { throw e; } } public void cargarCombosParametroSubPreguntaEvaluacion()throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; //this.cargarDatosCliente(); } catch(Exception e) { throw e; } } public void cargarCombosFrameForeignKeySubPreguntaEvaluacion()throws Exception { try { this.cargarCombosFrameEmpresasForeignKey("Todos"); this.cargarCombosFrameSucursalsForeignKey("Todos"); this.cargarCombosFramePreguntaEvaluacionsForeignKey("Todos"); this.cargarCombosFrameEjerciciosForeignKey("Todos"); this.cargarCombosFramePeriodosForeignKey("Todos"); } catch(Exception e) { throw e; } } public void cargarCombosFrameForeignKeySubPreguntaEvaluacion(String sFormularioTipoBusqueda)throws Exception { try { this.cargarCombosFrameEmpresasForeignKey(sFormularioTipoBusqueda); this.cargarCombosFrameSucursalsForeignKey(sFormularioTipoBusqueda); this.cargarCombosFramePreguntaEvaluacionsForeignKey(sFormularioTipoBusqueda); this.cargarCombosFrameEjerciciosForeignKey(sFormularioTipoBusqueda); this.cargarCombosFramePeriodosForeignKey(sFormularioTipoBusqueda); } catch(Exception e) { throw e; } } public void setItemDefectoCombosForeignKeySubPreguntaEvaluacion()throws Exception { try { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion.getItemCount()>0) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion.setSelectedIndex(0); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion.getItemCount()>0) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion.setSelectedIndex(0); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.getItemCount()>0) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.setSelectedIndex(0); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.getItemCount()>0) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.setSelectedIndex(0); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.getItemCount()>0) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.setSelectedIndex(0); } } catch(Exception e) { throw e; } } public SubPreguntaEvaluacionBeanSwingJInternalFrame() throws Exception { super(false,PaginaTipo.PRINCIPAL); } public SubPreguntaEvaluacionBeanSwingJInternalFrame(Boolean cargarRelaciones,PaginaTipo paginaTipo) throws Exception { super(cargarRelaciones,paginaTipo); } public SubPreguntaEvaluacionBeanSwingJInternalFrame(Boolean conGuardarRelaciones,Boolean esGuardarRelacionado,Boolean cargarRelaciones,PaginaTipo paginaTipo) throws Exception { super(cargarRelaciones,paginaTipo); this.subpreguntaevaluacionSessionBean=new SubPreguntaEvaluacionSessionBean(); this.subpreguntaevaluacionConstantesFunciones=new SubPreguntaEvaluacionConstantesFunciones(); this.subpreguntaevaluacionBean=new SubPreguntaEvaluacion();//(this.subpreguntaevaluacionConstantesFunciones); this.subpreguntaevaluacionReturnGeneral=new SubPreguntaEvaluacionParameterReturnGeneral(); this.subpreguntaevaluacionSessionBean.setConGuardarRelaciones(conGuardarRelaciones); this.subpreguntaevaluacionSessionBean.setEsGuardarRelacionado(esGuardarRelacionado); } public SubPreguntaEvaluacionBeanSwingJInternalFrame(Boolean blncargarCombostrForeignKey,Boolean blnCargarInformacionInicial,JDesktopPane jdesktopPane,Usuario usuarioActual,ResumenUsuario resumenUsuarioActual,Modulo moduloActual,Opcion opcionActual,ParametroGeneralSg parametroGeneralSg,ParametroGeneralUsuario parametroGeneralUsuario,Boolean conGuardarRelaciones,Boolean esGuardarRelacionado,Boolean cargarRelaciones,Boolean cargarTodosDatos,PaginaTipo paginaTipo) throws Exception { this(blncargarCombostrForeignKey,blnCargarInformacionInicial,jdesktopPane,usuarioActual,resumenUsuarioActual,moduloActual,opcionActual,parametroGeneralSg,parametroGeneralUsuario,paginaTipo,conGuardarRelaciones,esGuardarRelacionado,cargarRelaciones,cargarTodosDatos); } public SubPreguntaEvaluacionBeanSwingJInternalFrame(Boolean blncargarCombostrForeignKey,Boolean blnCargarInformacionInicial,JDesktopPane jdesktopPane,Usuario usuarioActual,ResumenUsuario resumenUsuarioActual,Modulo moduloActual,Opcion opcionActual,ParametroGeneralSg parametroGeneralSg,ParametroGeneralUsuario parametroGeneralUsuario,Boolean cargarRelaciones,Boolean cargarTodosDatos,PaginaTipo paginaTipo) throws Exception { this(blncargarCombostrForeignKey,blnCargarInformacionInicial,jdesktopPane,usuarioActual,resumenUsuarioActual,moduloActual,opcionActual,parametroGeneralSg,parametroGeneralUsuario,paginaTipo,false,false,cargarRelaciones,cargarTodosDatos); } public SubPreguntaEvaluacionBeanSwingJInternalFrame(Boolean blncargarCombostrForeignKey,Boolean blnCargarInformacionInicial,JDesktopPane jdesktopPane,Usuario usuarioActual,ResumenUsuario resumenUsuarioActual,Modulo moduloActual,Opcion opcionActual,ParametroGeneralSg parametroGeneralSg,ParametroGeneralUsuario parametroGeneralUsuario,PaginaTipo paginaTipo,Boolean conGuardarRelaciones,Boolean esGuardarRelacionado,Boolean cargarRelaciones,Boolean cargarTodosDatos) throws Exception //Boolean esParaBusquedaForeignKey { super(jdesktopPane,conGuardarRelaciones,esGuardarRelacionado,cargarRelaciones,usuarioActual,resumenUsuarioActual,moduloActual,opcionActual,parametroGeneralSg,parametroGeneralUsuario,paginaTipo); try { this.permiteRecargarForm=false; this.startProcessSubPreguntaEvaluacion(true); Boolean esParaBusquedaForeignKey=false;//ANTES USADO COMO PARAMETRO DEL CONSTRUCTOR if(paginaTipo.equals(PaginaTipo.BUSQUEDA)) { esParaBusquedaForeignKey=true; } //SE ASIGNA EN CLASE PADRE /* this.parametroGeneralSg=parametroGeneralSg; this.parametroGeneralUsuario=parametroGeneralUsuario; this.usuarioActual=usuarioActual; this.moduloActual=moduloActual; */ long start_time=0; long end_time=0; if(Constantes2.ISDEVELOPING2) { start_time = System.currentTimeMillis(); } if(!cargarTodosDatos) { this.sAccionBusqueda="NINGUNO"; } this.subpreguntaevaluacionConstantesFunciones=new SubPreguntaEvaluacionConstantesFunciones(); this.subpreguntaevaluacionBean=new SubPreguntaEvaluacion();//this.subpreguntaevaluacionConstantesFunciones); this.subpreguntaevaluacionReturnGeneral=new SubPreguntaEvaluacionParameterReturnGeneral(); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.CargaInicialInicio(this, "NORMAL", null); this.setTitle(Funciones.GetTituloSistema(this.parametroGeneralSg,this.moduloActual,this.usuarioActual,"Sub Pregunta Evaluacion Mantenimiento",paginaTipo)); this.conTotales=false; this.conTotales=true; this.subpreguntaevaluacion=new SubPreguntaEvaluacion(); this.subpreguntaevaluacions = new ArrayList<SubPreguntaEvaluacion>(); this.subpreguntaevaluacionsAux = new ArrayList<SubPreguntaEvaluacion>(); if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic=new SubPreguntaEvaluacionLogic(); this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //this.subpreguntaevaluacionSessionBean.setConGuardarRelaciones(conGuardarRelaciones); //this.subpreguntaevaluacionSessionBean.setEsGuardarRelacionado(esGuardarRelacionado); this.jDesktopPane=jdesktopPane; if(this.jDesktopPane.getClass().equals(JDesktopPaneMe.class)) { this.constantes2=((JDesktopPaneMe)this.jDesktopPane).constantes2; } if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,this.jInternalFrameDetalleFormSubPreguntaEvaluacion); if(!this.conCargarMinimo) { if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion!=null) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion); } if(this.jInternalFrameImportacionSubPreguntaEvaluacion!=null) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,this.jInternalFrameImportacionSubPreguntaEvaluacion); } } if(!this.conCargarMinimo) { if(this.jInternalFrameOrderBySubPreguntaEvaluacion!=null) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,this.jInternalFrameOrderBySubPreguntaEvaluacion); } } } //DETALLE DATOS if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //this.conCargarFormDetalle) { this.jDesktopPane.add(this.jInternalFrameDetalleFormSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setVisible(false); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setSelected(false); } if(!this.conCargarMinimo) { //REPORTE DINAMICO if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion!=null) { this.jDesktopPane.add(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion); this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.setVisible(false); this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.setSelected(false); } //IMPORTACION if(this.jInternalFrameImportacionSubPreguntaEvaluacion!=null) { this.jDesktopPane.add(this.jInternalFrameImportacionSubPreguntaEvaluacion); this.jInternalFrameImportacionSubPreguntaEvaluacion.setVisible(false); this.jInternalFrameImportacionSubPreguntaEvaluacion.setSelected(false); } } if(!this.conCargarMinimo) { if(this.jInternalFrameOrderBySubPreguntaEvaluacion!=null) { this.jDesktopPane.add(this.jInternalFrameOrderBySubPreguntaEvaluacion); this.jInternalFrameOrderBySubPreguntaEvaluacion.setVisible(false); this.jInternalFrameOrderBySubPreguntaEvaluacion.setSelected(false); } } //this.esParaBusquedaForeignKey=false; this.esParaBusquedaForeignKey=esParaBusquedaForeignKey; this.invalidValues=new InvalidValue[0]; this.idSubPreguntaEvaluacionActual=0L; this.rowIndexActual=0; this.iNumeroPaginacionPagina=0; this.iNumeroPaginacion=SubPreguntaEvaluacionConstantesFunciones.INUMEROPAGINACION; this.pagination=new Pagination(); this.datosCliente=new DatosCliente(); this.lIdUsuarioSesion=0L; this.sTipoArchivoReporte=""; this.sTipoArchivoReporteDinamico=""; this.sTipoReporte=""; this.sTipoReporteDinamico=""; this.sTipoPaginacion=""; this.sTipoRelacion=""; this.sTipoAccion=""; this.sTipoAccionFormulario=""; this.sTipoSeleccionar=""; this.sDetalleReporte=""; this.sTipoReporteExtra=""; this.sValorCampoGeneral=""; this.sPathReporteDinamico=""; this.isMostrarNumeroPaginacion=false; this.isSeleccionarTodos=false; this.isSeleccionados=false; this.conGraficoReporte=false; this.isPostAccionNuevo=false; this.isPostAccionSinCerrar=false; this.isPostAccionSinMensaje=false; this.esReporteDinamico=false; this.esRecargarFks=false; this.esReporteAccionProceso=false; this.subpreguntaevaluacionReturnGeneral=new SubPreguntaEvaluacionParameterReturnGeneral(); this.subpreguntaevaluacionParameterGeneral=new SubPreguntaEvaluacionParameterReturnGeneral(); this.sistemaLogicAdditional=new SistemaLogicAdditional(); this.sistemaLogicAdditional.setConnexion(this.subpreguntaevaluacionLogic.getConnexion()); //VERIFICAR GLOBAL this.cargarDatosCliente(); if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { if(Constantes.ISUSAEJBLOGICLAYER) { if(!sistemaLogicAdditional.validarLicenciaCliente(this.datosCliente,this.moduloActual,this.usuarioActual)) { this.setVisible(false); throw new Exception(Mensajes.SERROR_CONTROLGLOBAL); } } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } } //VERIFICAR GLOBAL //VERIFICAR SESSION ACTUAL //this.cargarDatosCliente(); this.sistemaReturnGeneral=new SistemaParameterReturnGeneral(); SistemaParameterReturnGeneralAdditional.inicializarSinSeguridad(this.sistemaReturnGeneral); if(SubPreguntaEvaluacionJInternalFrame.CON_LLAMADA_SIMPLE) { if(this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { this.opcionActual.setId(0L); //idOpcion=0L; } ArrayList<String> arrPaginas=new ArrayList<String>(); ArrayList<Opcion> opcionsFinal=new ArrayList<Opcion>(); arrPaginas.add(DetalleEvaluacionProveedorConstantesFunciones.SNOMBREOPCION); if(Constantes.ISUSAEJBLOGICLAYER) { //this.sistemaReturnGeneral=sistemaLogicAdditional.validarCargarSesionUsuarioActualWithConnection(this.usuarioActual,this.datosCliente,this.resumenUsuarioActual,Constantes.LIDSISTEMAACTUAL,SubPreguntaEvaluacionConstantesFunciones.SNOMBREOPCION,this.opcionActual,this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado(),this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones(),arrPaginas); this.sistemaReturnGeneral=sistemaLogicAdditional.validarCargarSesionUsuarioActual(this.usuarioActual,this.datosCliente,this.resumenUsuarioActual,Constantes.LIDSISTEMAACTUAL,SubPreguntaEvaluacionConstantesFunciones.SNOMBREOPCION,this.opcionActual,this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado(),this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones(),arrPaginas); if(!this.sistemaReturnGeneral.getEsValidado()) { this.setVisible(false); throw new Exception(Mensajes.SERROR_SESIONACTUAL); } } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { //FALTA } } else { if(Constantes.ISUSAEJBLOGICLAYER) { if(!sistemaLogicAdditional.validarSesionUsuarioActual(this.usuarioActual,this.datosCliente,this.resumenUsuarioActual)) { this.setVisible(false); throw new Exception(Mensajes.SERROR_SESIONACTUAL); } } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } } //VERIFICAR SESSION ACTUAL this.sVisibilidadTablaBusquedas="table-row"; this.sVisibilidadTablaElementos="none"; this.sVisibilidadTablaAcciones="none"; this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion=false; this.isVisibilidadCeldaDuplicarSubPreguntaEvaluacion=true; this.isVisibilidadCeldaCopiarSubPreguntaEvaluacion=true; this.isVisibilidadCeldaVerFormSubPreguntaEvaluacion=true; this.isVisibilidadCeldaOrdenSubPreguntaEvaluacion=true; this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=false; this.isVisibilidadCeldaModificarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=false; this.isVisibilidadFK_IdEjercicio=true; this.isVisibilidadFK_IdEmpresa=true; this.isVisibilidadFK_IdPeriodo=true; this.isVisibilidadFK_IdPreguntaEvaluacion=true; this.isVisibilidadFK_IdSucursal=true; //ELEMENTOS TABLAS PARAMETOS //ELEMENTOS TABLAS PARAMETOS_FIN //this.actualizarEstadoCeldasBotonesSubPreguntaEvaluacion("n", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); this.inicializarPermisosSubPreguntaEvaluacion(); //INICIALIZAR FALSE, TALVEZ COMENTAR this.setPermisosUsuarioSubPreguntaEvaluacion(false); this.setPermisosUsuarioSubPreguntaEvaluacion(); //FUNCIONALIDAD_RELACIONADO if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado() || (this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado() && this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones())) { this.inicializarSetPermisosUsuarioSubPreguntaEvaluacionClasesRelacionadas(); } if(this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { this.actualizarTabsSetPermisosUsuarioSubPreguntaEvaluacionClasesRelacionadas(); } //SOLO SE EJECUTA LA PRIMERA VEZ, BINDINGS SI FUNCIONA if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { this.inicializarActualizarBindingBotonesPermisosSubPreguntaEvaluacion(); } else { this.inicializarActualizarBindingBotonesPermisosManualSubPreguntaEvaluacion(); } if(!this.isPermisoBusquedaSubPreguntaEvaluacion) { //BYDAN_BUSQUEDAS this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setVisible(false); } //FUNCIONALIDAD_RELACIONADO if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { this.tiposArchivosReportes=Funciones.getListTiposArchivosReportes(); this.tiposArchivosReportesDinamico=Funciones.getListTiposArchivosReportes(); this.tiposReportes=Funciones.getListTiposReportes(true); this.tiposReportesDinamico=Funciones.getListTiposReportesDinamico(true); this.tiposReportes.add(new Reporte("RELACIONES","RELACIONES")); this.tiposReportesDinamico.add(new Reporte("RELACIONES","RELACIONES")); this.tiposGraficosReportes=Funciones2.getListTiposGraficosReportes(); this.tiposPaginacion=Funciones2.getListTiposPaginacion(this.isPermisoPaginacionMedioSubPreguntaEvaluacion,this.isPermisoPaginacionMedioSubPreguntaEvaluacion,this.isPermisoPaginacionTodoSubPreguntaEvaluacion); this.tiposSeleccionar=Funciones2.getListTiposSeleccionar(); this.tiposSeleccionar.addAll(SubPreguntaEvaluacionConstantesFunciones.getTiposSeleccionarSubPreguntaEvaluacion()); this.tiposColumnasSelect=SubPreguntaEvaluacionConstantesFunciones.getTiposSeleccionarSubPreguntaEvaluacion(true); this.tiposRelacionesSelect=new ArrayList<Reporte>(); this.cargarTiposRelacionesSelectSubPreguntaEvaluacion(); //this.tiposRelacionesSelect=SubPreguntaEvaluacionConstantesFunciones.getTiposRelacionesSubPreguntaEvaluacion(true); } else { this.tiposArchivosReportes=new ArrayList<Reporte>(); this.tiposArchivosReportesDinamico=new ArrayList<Reporte>(); this.tiposReportes=new ArrayList<Reporte>(); this.tiposReportesDinamico=new ArrayList<Reporte>(); this.tiposGraficosReportes=new ArrayList<Reporte>(); this.tiposPaginacion=new ArrayList<Reporte>(); this.tiposSeleccionar=new ArrayList<Reporte>(); this.tiposColumnasSelect=new ArrayList<Reporte>(); this.tiposRelacionesSelect=new ArrayList<Reporte>(); } //FUNCIONALIDAD_RELACIONADO //if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { //SE ENCUENTRA MAS ADELANTE CON ACCIONES POR USUARIO //ACCIONES GENERALES Y POR USUARIO this.tiposRelaciones=Funciones2.getListTiposRelaciones(); this.setRelacionesUsuarioSubPreguntaEvaluacion(); this.tiposAcciones=Funciones2.getListTiposAcciones(true,false,true); this.setAccionesUsuarioSubPreguntaEvaluacion(false); this.tiposAccionesFormulario=Funciones2.getListTiposAccionesFormulario(true,false,true); this.setAccionesUsuarioSubPreguntaEvaluacion(true); this.inicializarActualizarBindingtiposArchivosReportesAccionesSubPreguntaEvaluacion() ; /* } else { this.tiposAcciones=new ArrayList<Reporte>(); this.tiposAccionesFormulario=new ArrayList<Reporte>(); } */ this.inicializarInvalidValues(); this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); this.arrOrderBy= new ArrayList<OrderBy>(); this.arrDatoGeneralMinimos= new ArrayList<DatoGeneralMinimo>(); this.traerValoresTablaOrderBy(); this.isGuardarCambiosEnLote=false; this.isCargarCombosDependencia=false; this.detalleevaluacionproveedorLogic=new DetalleEvaluacionProveedorLogic(); jasperPrint = null; //FK this.empresaLogic=new EmpresaLogic(); this.sucursalLogic=new SucursalLogic(); this.preguntaevaluacionLogic=new PreguntaEvaluacionLogic(); this.ejercicioLogic=new EjercicioLogic(); this.periodoLogic=new PeriodoLogic(); //PARAMETROS /* if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { hashtableEnv = Funciones.getHashtableEnv(); initialContext = new InitialContext(hashtableEnv); } */ /* if(Constantes.ISUSAEJBREMOTE) { subpreguntaevaluacionImplementable= (SubPreguntaEvaluacionImplementable) initialContext.lookup(Constantes.SEJBPACKAGE+Constantes.SEJBSEPARATOR+SubPreguntaEvaluacionConstantesFunciones.SEJBNAME+Constantes.SEJBSEPARATOR+Constantes.SEJBREMOTE); } else if(Constantes.ISUSAEJBHOME) { subpreguntaevaluacionImplementableHome= (SubPreguntaEvaluacionImplementableHome) initialContext.lookup(Constantes.SEJBPACKAGE+Constantes.SEJBSEPARATOR+SubPreguntaEvaluacionConstantesFunciones.SEJBNAME+Constantes.SEJBSEPARATOR+Constantes.SEJBLOCAL); } */ this.subpreguntaevaluacions= new ArrayList<SubPreguntaEvaluacion>(); this.subpreguntaevaluacionsEliminados= new ArrayList<SubPreguntaEvaluacion>(); this.isEsNuevoSubPreguntaEvaluacion=false; this.esParaAccionDesdeFormularioSubPreguntaEvaluacion=false; this.isEsMantenimientoRelacionesRelacionadoUnico=false; this.isEsMantenimientoRelaciones=false; this.isEsMantenimientoRelacionado=false; this.isContieneImagenes=false; //INICIALIZAR LISTAS FK this.empresasForeignKey=new ArrayList<Empresa>() ; this.sucursalsForeignKey=new ArrayList<Sucursal>() ; this.preguntaevaluacionsForeignKey=new ArrayList<PreguntaEvaluacion>() ; this.ejerciciosForeignKey=new ArrayList<Ejercicio>() ; this.periodosForeignKey=new ArrayList<Periodo>() ; if(blncargarCombostrForeignKey) { this.cargarCombosForeignKeySubPreguntaEvaluacion(this.isCargarCombosDependencia); } this.cargarCombosParametroSubPreguntaEvaluacion(); //FUNCIONALIDAD_RELACIONADO if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { this.onLoad(); } SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.RecargarVentanaSegunOpcion(this,opcionActual); /* if(blnCargarInformacionInicial) { this.recargarInformacion(); } */ //this.iNumeroPaginacionPagina=0; //this.iNumeroPaginacion=SubPreguntaEvaluacionConstantesFunciones.INUMEROPAGINACION; this.actualizarEstadoCeldasBotonesSubPreguntaEvaluacion("n", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); //SOLO LA PRIMERA VEZ HACE LOS BINDINGS, SOLO AHI FUNCIONA this.inicializarActualizarBindingSubPreguntaEvaluacion(true); //SE REDIMENSIONA SINO NO SE ACTUALIZA this.redimensionarTablaDatos(); this.initActions(); ; if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) {//if(this.conCargarFormDetalle) { this.cargarMenuRelaciones(); } //OBLIGA CARGAR DETALLE, MEJOR DESHABILITAR, FALTA TALVEZ PONER EN SELECCIONAR //MAYBE //this.updateControlesFormularioSubPreguntaEvaluacion(); if(!this.conCargarMinimo) { this.updateBusquedasFormularioSubPreguntaEvaluacion(); } SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.CargaInicial(this, "NORMAL", null); //SE REALIZA ESTO PARA QUE SE PUEDA RECORRER TAB SIN IMPORTAR ORDEN Boolean existeTabBusqueda=false; if(!this.conCargarMinimo) { //BYDAN_BUSQUEDAS for(int i=0; i<this.jTabbedPaneBusquedasSubPreguntaEvaluacion.getTabCount(); i++) { this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setSelectedIndex(i); if(!existeTabBusqueda) { existeTabBusqueda=true; } } if(existeTabBusqueda) { this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setSelectedIndex(0); } } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } if(Constantes2.ISDEVELOPING2) { end_time = System.currentTimeMillis(); String sTipo="Load Ventana"; Funciones2.getMensajeTiempoEjecucion(start_time, end_time, sTipo,false); } this.finishProcessSubPreguntaEvaluacion(true); this.dEnd=(double)System.currentTimeMillis(); this.dDif=this.dEnd - this.dStart; if(Constantes.ISDEVELOPING) { System.out.println("Tiempo(ms) Carga SubPreguntaEvaluacion: " + this.dDif); } this.permiteRecargarForm=true; } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void cargarTiposRelacionesSelectSubPreguntaEvaluacion() { Reporte reporte=new Reporte(); reporte=new Reporte(); reporte.setsCodigo(DetalleEvaluacionProveedorConstantesFunciones.SCLASSWEBTITULO); reporte.setsDescripcion(DetalleEvaluacionProveedorConstantesFunciones.SCLASSWEBTITULO); this.tiposRelacionesSelect.add(reporte); } public void jTabbedPaneChangeListenerGeneral(String sTipo,ChangeEvent evt) { Boolean procesaCargarParteTab=false; try { int iIndex=0; String sTitle=""; //TABBED PANE RELACIONES if(sTipo.equals("RelacionesSubPreguntaEvaluacion")) { iIndex=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTabbedPaneRelacionesSubPreguntaEvaluacion.getSelectedIndex(); sTitle=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTabbedPaneRelacionesSubPreguntaEvaluacion.getTitleAt(iIndex); Integer intSelectedRow = 0; intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(sTitle.equals("Detalle Evaluacion Proveedores")) { if(!DetalleEvaluacionProveedorJInternalFrame.ESTA_CARGADO_PORPARTE) { procesaCargarParteTab=true; this.startProcessSubPreguntaEvaluacion(); this.cargarParteTabPanelRelacionadaDetalleEvaluacionProveedor(iIndex,intSelectedRow); } } } //TABBED PANE RELACIONES FIN(EXTRA TAB) ; } catch(Exception e) { e.printStackTrace(); } finally { if(procesaCargarParteTab) { this.finishProcessSubPreguntaEvaluacion(); } } } public void cargarParteTabPanelRelacionadaDetalleEvaluacionProveedor(int iIndex,int intSelectedRow) throws Exception { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.cargarSessionConBeanSwingJInternalFrameDetalleEvaluacionProveedor(false,true,iIndex); this.jButtonDetalleEvaluacionProveedorActionPerformed(null,intSelectedRow,false,true,null); this.redimensionarTablaPanelRelacionadaDetalleEvaluacionProveedor(); //this.jTabbedPaneRelacionesSubPreguntaEvaluacion.updateUI(); //this.jTabbedPaneRelacionesSubPreguntaEvaluacion.removeTabAt(iIndex); //this.jTabbedPaneRelacionesSubPreguntaEvaluacion.setSelectedIndex(iIndex); } public void jButtonRelacionActionPerformedGeneral(String sTipo,ActionEvent evt) { try { if(sTipo.equals("DetalleEvaluacionProveedor")) { int row=this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); jButtonDetalleEvaluacionProveedorActionPerformed(evt,row,true,false,null); } } catch(Exception e) { e.printStackTrace(); } } public void cargarMenuRelaciones() { JMenuItem jmenuItem= new JMenuItem("General"); String sLabelMenu=""; if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { for(Reporte reporte:this.tiposRelaciones) { if(reporte.getsCodigo().equals("Detalle Evaluacion Proveedor")) { if(this.isTienePermisosDetalleEvaluacionProveedor && this.subpreguntaevaluacionConstantesFunciones.mostrarDetalleEvaluacionProveedorSubPreguntaEvaluacion && !SubPreguntaEvaluacionConstantesFunciones.ISGUARDARREL) { if(Constantes.ISDEVELOPING) { sLabelMenu="Detalle Evaluacion Proveedores"+"("+DetalleEvaluacionProveedorConstantesFunciones.CLASSNAME+")"; } jmenuItem = new JMenuItem(sLabelMenu); //jmenuItem.setMnemonic(KeyEvent.VK_S); //jmenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.ALT_MASK)); jmenuItem.setActionCommand("Detalle Evaluacion Proveedores"); if(subpreguntaevaluacionConstantesFunciones.resaltarDetalleEvaluacionProveedorSubPreguntaEvaluacion!=null) { jmenuItem.setBorderPainted(true); jmenuItem.setBorder(subpreguntaevaluacionConstantesFunciones.resaltarDetalleEvaluacionProveedorSubPreguntaEvaluacion); } jmenuItem.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activarDetalleEvaluacionProveedorSubPreguntaEvaluacion); jmenuItem.addActionListener (new MenuItemRelacionActionListener(this,"DetalleEvaluacionProveedor")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jmenuDetalleSubPreguntaEvaluacion.add(jmenuItem); } continue; } } } } public void cargarCombosForeignKeySubPreguntaEvaluacion(Boolean cargarCombosDependencia) throws Exception { this.cargarCombosForeignKeySubPreguntaEvaluacion(cargarCombosDependencia,true,true); } //CARGAR COMBOS EN LOTE public void cargarCombosForeignKeySubPreguntaEvaluacion(Boolean cargarCombosDependencia,Boolean conInitActions,Boolean conSetVariablesGlobales) throws Exception { this.cargarCombosTodosForeignKeySubPreguntaEvaluacionListas(cargarCombosDependencia); this.addItemDefectoCombosTodosForeignKeySubPreguntaEvaluacion(); this.cargarCombosFrameForeignKeySubPreguntaEvaluacion(); if(conInitActions) { this.initActionsCombosTodosForeignKeySubPreguntaEvaluacion(); } if(conSetVariablesGlobales) { this.setVariablesGlobalesCombosForeignKeySubPreguntaEvaluacion(); } } public void cargarCombosForeignKeyPreguntaEvaluacion(Boolean cargarCombosDependencia,Boolean conInitActions,Boolean conSetVariablesGlobales,String sFinalQueryCombo,String sFormularioTipoBusqueda) throws Exception { try { this.cargarCombosForeignKeyPreguntaEvaluacionListas(cargarCombosDependencia,sFinalQueryCombo); this.addItemDefectoCombosForeignKeyPreguntaEvaluacion(); this.cargarCombosFramePreguntaEvaluacionsForeignKey(sFormularioTipoBusqueda); if(conInitActions) { } this.recargarComboTablaPreguntaEvaluacion(this.preguntaevaluacionsForeignKey); } catch(Exception e) { throw e; } } public void jButtonNuevoSubPreguntaEvaluacionActionPerformed(ActionEvent evt,Boolean esRelaciones) throws Exception { try { EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.FORM_RECARGAR; String sTipo="NUEVO_NORMAL"; this.estaModoNuevo=true; if(this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { this.dStart=(double)System.currentTimeMillis(); } //if(this.esUsoDesdeHijo) { // eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; //} if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.FORM,EventoTipo.LOAD,EventoSubTipo.NEW,"FORM",this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(jTableDatosSubPreguntaEvaluacion.getRowCount()>=1) { jTableDatosSubPreguntaEvaluacion.removeRowSelectionInterval(0, jTableDatosSubPreguntaEvaluacion.getRowCount()-1); } this.isEsNuevoSubPreguntaEvaluacion=true; //ESTABLECE SI ES RELACIONADO O NO this.habilitarDeshabilitarTipoMantenimientoSubPreguntaEvaluacion(esRelaciones); this.nuevoPreparar(false); this.habilitarDeshabilitarControlesSubPreguntaEvaluacion(true); //this.subpreguntaevaluacion=new SubPreguntaEvaluacion(); //this.subpreguntaevaluacion.setIsChanged(true); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingBotonesSubPreguntaEvaluacion(false) ; //SI ES MANUAL //this.inicializarActualizarBindingBotonesManualSubPreguntaEvaluacion() ; if(SubPreguntaEvaluacionJInternalFrame.CON_DATOS_FRAME) { this.abrirFrameDetalleSubPreguntaEvaluacion(esRelaciones); } //Se Duplica, sin sentido //this.actualizarInformacion("EVENTO_NUEVO",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.FORM,EventoTipo.LOAD,EventoSubTipo.NEW,"FORM",this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { this.dEnd=(double)System.currentTimeMillis(); this.dDif=this.dEnd - this.dStart; if(Constantes.ISDEVELOPING) { System.out.println("Tiempo(ms) Nuevo Preparar SubPreguntaEvaluacion: " + this.dDif); } } //false para que pueda generar eventos this.estaModoNuevo=false; //Con this.estaModoNuevo=false;, se permite actualizar y usar eventos control al mismo tiempo (FuncionTipo.LAST) SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.LAST,ControlTipo.FORM,EventoTipo.CLIC,EventoSubTipo.NEW,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { this.estaModoNuevo=false; } } public void jButtonDuplicarSubPreguntaEvaluacionActionPerformed(ActionEvent evt,Boolean esRelaciones) throws Exception { try { Boolean soloDuplicarUno=false; Boolean conSeleccionarFilaTabla=false; this.estaModoNuevo=true; this.estaModoDuplicar=true; ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados=new ArrayList<SubPreguntaEvaluacion>(); int intSelectedRow =-1; Integer iNumRowsSeleccionados=0; int[] arrNumRowsSeleccionados=null; //NO SE TOMA EN CUENTA, SI LOS SELECCIONADOS if(conSeleccionarFilaTabla) { arrNumRowsSeleccionados=this.jTableDatosSubPreguntaEvaluacion.getSelectedRows(); iNumRowsSeleccionados=this.jTableDatosSubPreguntaEvaluacion.getSelectedRows().length; } subpreguntaevaluacionsSeleccionados=this.getSubPreguntaEvaluacionsSeleccionados(false); if((soloDuplicarUno && iNumRowsSeleccionados.equals(1)) || !soloDuplicarUno) { //LO HACE NUEVOPREPARAR //this.iIdNuevoSubPreguntaEvaluacion--; //SubPreguntaEvaluacion subpreguntaevaluacionAux= new SubPreguntaEvaluacion(); //subpreguntaevaluacionAux.setId(this.iIdNuevoSubPreguntaEvaluacion); //NO SE TOMA EN CUENTA, SI LOS SELECCIONADOS //SubPreguntaEvaluacion subpreguntaevaluacionOrigen=new SubPreguntaEvaluacion(); //for(Integer iNumRowSeleccionado:arrNumRowsSeleccionados) { for(SubPreguntaEvaluacion subpreguntaevaluacionOrigen : subpreguntaevaluacionsSeleccionados) { if(conSeleccionarFilaTabla) { if(!soloDuplicarUno) { //NO SE TOMA EN CUENTA, SI LOS SELECCIONADOS //intSelectedRow =iNumRowSeleccionado; } else { intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionOrigen =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacionOrigen =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } } this.aumentarTamanioFilaNuevaTablaSubPreguntaEvaluacion(); if(this.conTotales) { this.quitarFilaTotales(); } this.nuevoPreparar(true); this.subpreguntaevaluacion.setsType("DUPLICADO"); this.setCopiarVariablesObjetosSubPreguntaEvaluacion(subpreguntaevaluacionOrigen,this.subpreguntaevaluacion,true,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); //LO HACE NUEVOPREPARAR /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().add(this.subpreguntaevaluacionAux); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacions.add(this.subpreguntaevaluacionAux); } */ } this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); this.jTableDatosSubPreguntaEvaluacion.setRowSelectionInterval(this.getIndiceNuevoSubPreguntaEvaluacion(), this.getIndiceNuevoSubPreguntaEvaluacion()); int iLastRow = this.jTableDatosSubPreguntaEvaluacion.getRowCount () - 1; Rectangle rectangle = this.jTableDatosSubPreguntaEvaluacion.getCellRect(iLastRow, 0, true); this.jTableDatosSubPreguntaEvaluacion.scrollRectToVisible(rectangle); //FILA TOTALES if(this.conTotales) { this.crearFilaTotales(); this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); } } else { throw new Exception("DEBE ESTAR SELECCIONADO 1 REGISTRO"); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { this.estaModoNuevo=false; this.estaModoDuplicar=false; } } public void jButtonCopiarSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { Boolean conSeleccionarFilaTabla=false; Integer iNumRowsSeleccionados=0; int[] intSelectedRows =null; int intSelectedRow =0; this.estaModoCopiar=true; ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados=new ArrayList<SubPreguntaEvaluacion>(); SubPreguntaEvaluacion subpreguntaevaluacionOrigen=new SubPreguntaEvaluacion(); SubPreguntaEvaluacion subpreguntaevaluacionDestino=new SubPreguntaEvaluacion(); subpreguntaevaluacionsSeleccionados=this.getSubPreguntaEvaluacionsSeleccionados(false); if(conSeleccionarFilaTabla) { iNumRowsSeleccionados=this.jTableDatosSubPreguntaEvaluacion.getSelectedRows().length; } if(iNumRowsSeleccionados.equals(2) || subpreguntaevaluacionsSeleccionados.size()==2) { if(conSeleccionarFilaTabla) { intSelectedRows =this.jTableDatosSubPreguntaEvaluacion.getSelectedRows(); intSelectedRow = intSelectedRows[0]; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionOrigen =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacionOrigen =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE intSelectedRow = intSelectedRows[1]; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionDestino =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacionDestino =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE } subpreguntaevaluacionOrigen =subpreguntaevaluacionsSeleccionados.get(0); subpreguntaevaluacionDestino =subpreguntaevaluacionsSeleccionados.get(1); this.setCopiarVariablesObjetosSubPreguntaEvaluacion(subpreguntaevaluacionOrigen,subpreguntaevaluacionDestino,true,false); subpreguntaevaluacionDestino.setsType("DUPLICADO"); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { actualizarLista(subpreguntaevaluacionDestino,subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { actualizarLista(subpreguntaevaluacionDestino,subpreguntaevaluacions); } //ARCHITECTURE this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); //this.jTableDatosSubPreguntaEvaluacion.setRowSelectionInterval(this.getIndiceNuevoSubPreguntaEvaluacion(), this.getIndiceNuevoSubPreguntaEvaluacion()); int iLastRow = this.jTableDatosSubPreguntaEvaluacion.getRowCount () - 1; Rectangle rectangle = this.jTableDatosSubPreguntaEvaluacion.getCellRect(iLastRow, 0, true); this.jTableDatosSubPreguntaEvaluacion.scrollRectToVisible(rectangle); //FILA TOTALES if(this.conTotales) { //this.crearFilaTotales(); this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); } } else { throw new Exception("DEBEN ESTAR SELECCIONADOS 2 REGISTROS"); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { this.estaModoCopiar=false; } } public void jButtonVerFormSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setSelected(true); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jButtonMostrarOcultarSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { Boolean isVisible=this.jPanelParametrosReportesSubPreguntaEvaluacion.isVisible(); //BYDAN_BUSQUEDAS this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setVisible(!isVisible); this.jPanelParametrosReportesSubPreguntaEvaluacion.setVisible(!isVisible); this.jPanelPaginacionSubPreguntaEvaluacion.setVisible(!isVisible); this.jPanelAccionesSubPreguntaEvaluacion.setVisible(!isVisible); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jButtonCerrarSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { this.closingInternalFrameSubPreguntaEvaluacion(); //if(this.jInternalFrameParent==null) { //this.dispose(); /*} else { this.setVisible(false); this.setSelected(false); }*/ } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jButtonCerrarReporteDinamicoSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { this.cerrarFrameReporteDinamicoSubPreguntaEvaluacion(); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jButtonCerrarImportacionSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { this.cerrarFrameImportacionSubPreguntaEvaluacion(); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jButtonAbrirOrderBySubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { this.abrirInicializarFrameOrderBySubPreguntaEvaluacion(); this.abrirFrameOrderBySubPreguntaEvaluacion(); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jButtonCerrarOrderBySubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { this.cerrarFrameOrderBySubPreguntaEvaluacion(); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void abrirFrameDetalleSubPreguntaEvaluacion(Boolean esRelaciones) throws Exception { try { //CAUSA PROBLEMAS, SE ADICIONA EN CONSTRUCTOR, LUEGO SOLO VISIBLE true y false //this.jDesktopPane.add(jInternalFrameDetalleFormSubPreguntaEvaluacion); if(!esRelaciones) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.isMaximum()) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setMaximum(false); } this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setSize(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.iWidthFormulario,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.iHeightFormulario); } else { if(this.iWidthScroll<this.jInternalFrameDetalleFormSubPreguntaEvaluacion.iWidthFormularioMaximo) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setSize(this.iWidthScroll,this.iHeightScroll); } else { if(!this.jInternalFrameDetalleFormSubPreguntaEvaluacion.isMaximum()) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setMaximum(true); } } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jContentPaneDetalleSubPreguntaEvaluacion.getWidth() > this.getWidth()) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTabbedPaneRelacionesSubPreguntaEvaluacion.setMinimumSize(new Dimension(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jContentPaneDetalleSubPreguntaEvaluacion.getWidth(),SubPreguntaEvaluacionConstantesFunciones.ALTO_TABPANE_RELACIONES)); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTabbedPaneRelacionesSubPreguntaEvaluacion.setMaximumSize(new Dimension(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jContentPaneDetalleSubPreguntaEvaluacion.getWidth(),SubPreguntaEvaluacionConstantesFunciones.ALTO_TABPANE_RELACIONES)); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTabbedPaneRelacionesSubPreguntaEvaluacion.setPreferredSize(new Dimension(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jContentPaneDetalleSubPreguntaEvaluacion.getWidth(),SubPreguntaEvaluacionConstantesFunciones.ALTO_TABPANE_RELACIONES)); Dimension dimension=new Dimension(); if(DetalleEvaluacionProveedorJInternalFrame.ESTA_CARGADO_PORPARTE) { this.redimensionarTablaPanelRelacionadaDetalleEvaluacionProveedor(); } } } this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setVisible(true); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setSelected(true); } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void abrirInicializarFrameOrderBySubPreguntaEvaluacion() throws Exception { try { if(this.jInternalFrameOrderBySubPreguntaEvaluacion==null) { if(!this.conCargarMinimo) { this.jInternalFrameOrderBySubPreguntaEvaluacion=new OrderByJInternalFrame(STIPO_TAMANIO_GENERAL,this.jButtonAbrirOrderBySubPreguntaEvaluacion,false,this); } else { this.jInternalFrameOrderBySubPreguntaEvaluacion=new OrderByJInternalFrame(STIPO_TAMANIO_GENERAL,this.jButtonAbrirOrderBySubPreguntaEvaluacion,true,this); } this.jDesktopPane.add(this.jInternalFrameOrderBySubPreguntaEvaluacion); this.jInternalFrameOrderBySubPreguntaEvaluacion.setVisible(false); this.jInternalFrameOrderBySubPreguntaEvaluacion.setSelected(false); this.jInternalFrameOrderBySubPreguntaEvaluacion.getjButtonCerrarOrderBy().addActionListener (new ButtonActionListener(this,"CerrarOrderBySubPreguntaEvaluacion")); this.inicializarActualizarBindingTablaOrderBySubPreguntaEvaluacion(); } } catch (final Exception e) { } } public void abrirInicializarFrameImportacionSubPreguntaEvaluacion() throws Exception { try { if(this.jInternalFrameImportacionSubPreguntaEvaluacion==null) { this.jInternalFrameImportacionSubPreguntaEvaluacion=new ImportacionJInternalFrame(SubPreguntaEvaluacionConstantesFunciones.SCLASSWEBTITULO,this); MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,this.jInternalFrameImportacionSubPreguntaEvaluacion); this.jDesktopPane.add(this.jInternalFrameImportacionSubPreguntaEvaluacion); this.jInternalFrameImportacionSubPreguntaEvaluacion.setVisible(false); this.jInternalFrameImportacionSubPreguntaEvaluacion.setSelected(false); this.jInternalFrameImportacionSubPreguntaEvaluacion.getjButtonCerrarImportacion().addActionListener (new ButtonActionListener(this,"CerrarImportacionSubPreguntaEvaluacion")); this.jInternalFrameImportacionSubPreguntaEvaluacion.getjButtonGenerarImportacion().addActionListener (new ButtonActionListener(this,"GenerarImportacionSubPreguntaEvaluacion")); this.jInternalFrameImportacionSubPreguntaEvaluacion.getjButtonAbrirImportacion().addActionListener (new ButtonActionListener(this,"AbrirImportacionSubPreguntaEvaluacion")); } } catch (final Exception e) { } } public void abrirInicializarFrameReporteDinamicoSubPreguntaEvaluacion() throws Exception { try { if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion==null) { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion=new ReporteDinamicoJInternalFrame(SubPreguntaEvaluacionConstantesFunciones.SCLASSWEBTITULO,this); MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion); this.jDesktopPane.add(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion); this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.setVisible(false); this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.setSelected(false); this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjButtonCerrarReporteDinamico().addActionListener (new ButtonActionListener(this,"CerrarReporteDinamicoSubPreguntaEvaluacion")); this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjButtonGenerarReporteDinamico().addActionListener (new ButtonActionListener(this,"GenerarReporteDinamicoSubPreguntaEvaluacion")); this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjButtonGenerarExcelReporteDinamico().addActionListener (new ButtonActionListener(this,"GenerarExcelReporteDinamicoSubPreguntaEvaluacion")); this.inicializarActualizarBindingtiposArchivosReportesDinamicoAccionesManualSubPreguntaEvaluacion(); } } catch (final Exception e) { } } public void redimensionarTablaPanelRelacionadaDetalleEvaluacionProveedor() { Dimension dimension=new Dimension(); dimension=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.jScrollPanelDatosDetalleEvaluacionProveedor.getPreferredSize(); dimension.setSize(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jContentPaneDetalleSubPreguntaEvaluacion.getWidth(),dimension.getHeight()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.jScrollPanelDatosDetalleEvaluacionProveedor.setMinimumSize(dimension); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.jScrollPanelDatosDetalleEvaluacionProveedor.setMaximumSize(dimension); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.jScrollPanelDatosDetalleEvaluacionProveedor.setPreferredSize(dimension); } public void cerrarFrameDetalleSubPreguntaEvaluacion() throws Exception { try { //this.jDesktopPane.add(jInternalFrameDetalleFormSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setVisible(false); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setSelected(false); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.dispose(); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion=null; } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void abrirFrameReporteDinamicoSubPreguntaEvaluacion() throws Exception { try { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.setVisible(true); this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.setSelected(true); } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void abrirFrameImportacionSubPreguntaEvaluacion() throws Exception { try { this.jInternalFrameImportacionSubPreguntaEvaluacion.setVisible(true); this.jInternalFrameImportacionSubPreguntaEvaluacion.setSelected(true); } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void abrirFrameOrderBySubPreguntaEvaluacion() throws Exception { try { this.jInternalFrameOrderBySubPreguntaEvaluacion.setVisible(true); this.jInternalFrameOrderBySubPreguntaEvaluacion.setSelected(true); } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void cerrarFrameOrderBySubPreguntaEvaluacion() throws Exception { try { this.jInternalFrameOrderBySubPreguntaEvaluacion.setVisible(false); this.jInternalFrameOrderBySubPreguntaEvaluacion.setSelected(false); } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void cerrarFrameReporteDinamicoSubPreguntaEvaluacion() throws Exception { try { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.setVisible(false); this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.setSelected(false); } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void cerrarFrameImportacionSubPreguntaEvaluacion() throws Exception { try { this.jInternalFrameImportacionSubPreguntaEvaluacion.setVisible(false); this.jInternalFrameImportacionSubPreguntaEvaluacion.setSelected(false); } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jButtonModificarSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { this.modificarSubPreguntaEvaluacion(evt,-1,false); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void modificarSubPreguntaEvaluacion(ActionEvent evt,int rowIndex,Boolean esRelaciones) throws Exception { try { int intSelectedRow = 0; if(rowIndex>=0) { intSelectedRow=rowIndex; } else { intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); } this.habilitarDeshabilitarControlesSubPreguntaEvaluacion(true); //this.isEsNuevoSubPreguntaEvaluacion=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE this.actualizarEstadoCeldasBotonesSubPreguntaEvaluacion("ae", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingBotonesSubPreguntaEvaluacion(false) ; if(subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorSessionBean.getEsGuardarRelacionado() && DetalleEvaluacionProveedorJInternalFrame.ESTA_CARGADO_PORPARTE) { this.jButtonDetalleEvaluacionProveedorActionPerformed(null,intSelectedRow,false,true,null); } } if(SubPreguntaEvaluacionJInternalFrame.CON_DATOS_FRAME) { this.abrirFrameDetalleSubPreguntaEvaluacion(esRelaciones); } //SI ES MANUAL //this.inicializarActualizarBindingBotonesManualSubPreguntaEvaluacion(false) ; } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void seleccionarFilaTablaSubPreguntaEvaluacionActual() { try { //SELECCIONA FILA A OBJETO ACTUAL Integer intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void seleccionarSubPreguntaEvaluacion(ActionEvent evt,int rowIndex) throws Exception { try { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } int intSelectedRow = 0; if(rowIndex>=0) { intSelectedRow=rowIndex; } else { intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); } //this.habilitarDeshabilitarControlesSubPreguntaEvaluacion(true); //this.isEsNuevoSubPreguntaEvaluacion=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE this.jInternalFrameParent.setIdCombosCodigoDesdeBusquedaForeignKey(this.subpreguntaevaluacion.getId(),this.sTipoBusqueda); this.dispose(); //this.actualizarEstadoCeldasBotonesSubPreguntaEvaluacion("ae", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); //NO FUNCIONA BINDINGS /* this.inicializarActualizarBindingBotonesSubPreguntaEvaluacion(false) ; if(SubPreguntaEvaluacionJInternalFrame.CON_DATOS_FRAME) { this.abrirFrameDetalleSubPreguntaEvaluacion(esRelaciones); } */ //SI ES MANUAL //this.inicializarActualizarBindingBotonesManualSubPreguntaEvaluacion(false) ; } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void setIdCombosCodigoDesdeBusquedaForeignKey(Long id,String sType)throws Exception{ try { } catch(Exception e) { throw e; } } public void recargarComboTablaPreguntaEvaluacion(List<PreguntaEvaluacion> preguntaevaluacionsForeignKey)throws Exception{ TableColumn tableColumnPreguntaEvaluacion=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPREGUNTAEVALUACION)); TableCellEditor tableCellEditorPreguntaEvaluacion =tableColumnPreguntaEvaluacion.getCellEditor(); PreguntaEvaluacionTableCell preguntaevaluacionTableCellFk=(PreguntaEvaluacionTableCell)tableCellEditorPreguntaEvaluacion; if(preguntaevaluacionTableCellFk!=null) { preguntaevaluacionTableCellFk.setpreguntaevaluacionsForeignKey(preguntaevaluacionsForeignKey); } //SIEMPRE rowActual<0 , NO USADO POR EL MOMENTO //COMBO DE FILA ACTUAL SE ACTUALIZA, LOS DEMAS USAN EL ANTERIOR COMBO //int intSelectedRow = -1; //intSelectedRow=this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); //if(intSelectedRow<=0) { //preguntaevaluacionTableCellFk.setRowActual(intSelectedRow); //preguntaevaluacionTableCellFk.setpreguntaevaluacionsForeignKeyActual(preguntaevaluacionsForeignKey); //} if(preguntaevaluacionTableCellFk!=null) { preguntaevaluacionTableCellFk.RecargarPreguntaEvaluacionsForeignKey(); //ACTUALIZA COMBOS DE TABLA-FIN } } public void jButtonActualizarSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } this.inicializarActualizarBindingParametrosReportesSubPreguntaEvaluacion(false); //if(!this.isEsNuevoSubPreguntaEvaluacion) { int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); //SE PIEDE INDICE SELECTED CON FILA TOTALES, ASEGURARSE QUE OBJETO ACTUAL ESTE EN FORMULARIO //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //} if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL_TABLA) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.permiteMantenimiento(this.subpreguntaevaluacion)) { this.actualizar(); if(!this.isGuardarCambiosEnLote && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { this.procesarBusqueda(sAccionBusqueda); this.isEsNuevoSubPreguntaEvaluacion=true; this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); this.isEsNuevoSubPreguntaEvaluacion=false; } else { //PARA RELACIONADO ACTUALIZAR FILA TOTALES this.isEsNuevoSubPreguntaEvaluacion=true; this.procesoActualizarFilaTotales(false,"MANTENIMIENTO"); this.isEsNuevoSubPreguntaEvaluacion=false; } //NO FUNCIONA BINDINGS this.inicializarActualizarBindingBotonesSubPreguntaEvaluacion(false); //SI ES MANUAL //this.inicializarActualizarBindingBotonesManualSubPreguntaEvaluacion(false); this.habilitarDeshabilitarControlesSubPreguntaEvaluacion(false); if(SubPreguntaEvaluacionJInternalFrame.CON_DATOS_FRAME) { if(!this.isPostAccionSinCerrar) { this.cerrarFrameDetalleSubPreguntaEvaluacion(); } } if(this.isPostAccionNuevo) { this.jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,subpreguntaevaluacionSessionBean.getConGuardarRelaciones()); } else { if(this.isPostAccionSinCerrar) { Integer intSelectedRowActual=this.getIndiceActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,intSelectedRow); if(intSelectedRow>-1) { this.jTableDatosSubPreguntaEvaluacion.setRowSelectionInterval(intSelectedRowActual, intSelectedRowActual); this.jButtonIdActionPerformed(evt,intSelectedRowActual,subpreguntaevaluacionSessionBean.getConGuardarRelaciones(),false); } } } this.cancelar(false); } else { JOptionPane.showMessageDialog(this,"ESTE REGISTRO NO PUEDE ACTUALIZARSE","EDITAR",JOptionPane.ERROR_MESSAGE); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } if(this.jInternalFrameParent!=null) { //&& this.isEsMantenimientoRelacionado) { Boolean esUsoDesdeHijoLocal=true; String sTipo="Formulario"; Boolean conIrServidorAplicacionParent=false; Long id=this.subpreguntaevaluacion.getId(); ArrayList<String> arrClasses=new ArrayList<String>(); GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(SubPreguntaEvaluacion.class.getName()); this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",SubPreguntaEvaluacion.class.getName(),sTipo,"FORMULARIO",esControlTabla,conIrServidorAplicacionParent, id,this, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.FORM,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,this); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonEliminarSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; this.subpreguntaevaluacion.setIsDeleted(true); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; this.subpreguntaevaluacion.setIsDeleted(true); } //ARCHITECTURE if(this.permiteMantenimiento(this.subpreguntaevaluacion)) { this.eliminar(); if(!this.isGuardarCambiosEnLote && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { this.procesarBusqueda(sAccionBusqueda); } ((SubPreguntaEvaluacionModel) this.jTableDatosSubPreguntaEvaluacion.getModel()).fireTableRowsDeleted(intSelectedRow,intSelectedRow); this.isEsNuevoSubPreguntaEvaluacion=true; this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); this.isEsNuevoSubPreguntaEvaluacion=false; //NO FUNCIONA BINDINGS this.inicializarActualizarBindingBotonesSubPreguntaEvaluacion(false); //SI ES MANUAL //this.inicializarActualizarBindingBotonesManualSubPreguntaEvaluacion(false); this.habilitarDeshabilitarControlesSubPreguntaEvaluacion(false); if(SubPreguntaEvaluacionJInternalFrame.CON_DATOS_FRAME) { this.cerrarFrameDetalleSubPreguntaEvaluacion(); } } else { JOptionPane.showMessageDialog(this,"ESTE REGISTRO NO PUEDE ACTUALIZARSE","EDITAR",JOptionPane.ERROR_MESSAGE); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonCancelarSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { if(jTableDatosSubPreguntaEvaluacion.getRowCount()>=1) { jTableDatosSubPreguntaEvaluacion.removeRowSelectionInterval(0, jTableDatosSubPreguntaEvaluacion.getRowCount()-1); } this.invalidValues=new InvalidValue[0]; this.habilitarDeshabilitarControlesSubPreguntaEvaluacion(false); this.cancelar(true); this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingBotonesSubPreguntaEvaluacion(false) ; //SI ES MANUAL //this.inicializarActualizarBindingBotonesManualSubPreguntaEvaluacion(false) ; this.isEsNuevoSubPreguntaEvaluacion=false; if(SubPreguntaEvaluacionJInternalFrame.CON_DATOS_FRAME) { this.cerrarFrameDetalleSubPreguntaEvaluacion(); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //this.estaModoGuardarCambios=true; this.guardarCambios(); if(!this.isErrorGuardar) { this.procesarBusqueda(this.sAccionBusqueda); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingSubPreguntaEvaluacion(false); //SI ES MANUAL if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingManualSubPreguntaEvaluacion(); } } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } //this.estaModoGuardarCambios=false; } } public void jButtonNuevoGuardarCambiosSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { this.estaModoNuevo=true; this.estaModoNuevoGuardarCambios=true; //LO HACE NUEVOPREPARAR //this.iIdNuevoSubPreguntaEvaluacion--; //SubPreguntaEvaluacion subpreguntaevaluacionAux= new SubPreguntaEvaluacion(); //subpreguntaevaluacionAux.setId(this.iIdNuevoSubPreguntaEvaluacion); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } this.aumentarTamanioFilaNuevaTablaSubPreguntaEvaluacion(); if(this.conTotales) { this.quitarFilaTotales(); } this.nuevoPreparar(true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); this.subpreguntaevaluacion.setsType("NUEVO_GUARDAR_CAMBIOS"); //LO HACE NUEVOPREPARAR /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().add(this.subpreguntaevaluacionAux); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacions.add(this.subpreguntaevaluacionAux); } */ this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); this.jTableDatosSubPreguntaEvaluacion.setRowSelectionInterval(this.getIndiceNuevoSubPreguntaEvaluacion(), this.getIndiceNuevoSubPreguntaEvaluacion()); int iLastRow = this.jTableDatosSubPreguntaEvaluacion.getRowCount () - 1; Rectangle rectangle = this.jTableDatosSubPreguntaEvaluacion.getCellRect(iLastRow, 0, true); this.jTableDatosSubPreguntaEvaluacion.scrollRectToVisible(rectangle); //FILA TOTALES if(this.conTotales) { this.crearFilaTotales(); this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { this.estaModoNuevo=false; this.estaModoNuevoGuardarCambios=false; } } public void jButtonRecargarInformacionSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { this.iNumeroPaginacionPagina=0; if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); this.recargarInformacion(); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingSubPreguntaEvaluacion(false); //SI ES MANUAL if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingManualSubPreguntaEvaluacion(); } //this.abrirFrameTreeSubPreguntaEvaluacion(); if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonGenerarImportacionSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { BufferedReader bufferedReader = null; String sXmlStringFile=""; String sPath=""; this.arrDatoGeneralMinimos= new ArrayList<DatoGeneralMinimo>(); DatoGeneralMinimo datoGeneralMinimo=new DatoGeneralMinimo(); String sLine=""; try { if(JOptionPane.showConfirmDialog(this, "ESTA SEGURO DE PROCESAR IMPORTACION DE Sub Pregunta EvaluacionES ?", "MANTENIMIENTO DE Sub Pregunta Evaluacion", JOptionPane.OK_CANCEL_OPTION) == 0) { bufferedReader = new BufferedReader(new FileReader(this.jInternalFrameImportacionSubPreguntaEvaluacion.getFileImportacion().getAbsolutePath())); while ((sLine = bufferedReader.readLine()) != null) { datoGeneralMinimo=new DatoGeneralMinimo(); datoGeneralMinimo.setsDescripcion(sLine); this.arrDatoGeneralMinimos.add(datoGeneralMinimo); } this.actualizarParametrosGeneralSubPreguntaEvaluacion(); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionReturnGeneral=subpreguntaevaluacionLogic.procesarImportacionSubPreguntaEvaluacionsWithConnection(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this.arrDatoGeneralMinimos,this.subpreguntaevaluacionParameterGeneral); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE this.procesarSubPreguntaEvaluacionReturnGeneral(); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if (bufferedReader != null) { bufferedReader.close(); } } } public void jButtonAbrirImportacionSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { BufferedWriter bufferedWriter = null; String sXmlStringFile=""; String sPath=""; try { int iReturnArchivo = this.jInternalFrameImportacionSubPreguntaEvaluacion.getjFileChooserImportacion().showOpenDialog(this); if (iReturnArchivo == JFileChooser.APPROVE_OPTION) { this.jInternalFrameImportacionSubPreguntaEvaluacion.setFileImportacion(this.jInternalFrameImportacionSubPreguntaEvaluacion.getjFileChooserImportacion().getSelectedFile()); this.jInternalFrameImportacionSubPreguntaEvaluacion.getjTextFieldPathArchivoImportacion().setText(this.jInternalFrameImportacionSubPreguntaEvaluacion.getFileImportacion().getName()); //System.out.println("ARCHIVO ESCOGIDO: "+this.fileImportacionSubPreguntaEvaluacion.getName()); } else { //System.out.println("CANCELAR SELECCION"); this.jInternalFrameImportacionSubPreguntaEvaluacion.getjTextFieldPathArchivoImportacion().setText("SELECCION CANCELADA"); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if (bufferedWriter != null) { bufferedWriter.close(); } } } public void jButtonGenerarReporteDinamicoSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { BufferedWriter bufferedWriter = null; String sXmlStringFile=""; String sPath=""; try { ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsSeleccionados=this.getSubPreguntaEvaluacionsSeleccionados(true); this.sTipoReporteDinamico=((Reporte)this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxTiposReportesDinamico().getSelectedItem()).getsCodigo(); this.sTipoArchivoReporteDinamico=((Reporte)this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxTiposArchivosReportesDinamico().getSelectedItem()).getsCodigo(); this.sTipoArchivoReporte=this.sTipoArchivoReporteDinamico; //this.sTipoReporteExtra="Base"; InputStream reportFile=null; InputStream imageFile=null; imageFile=AuxiliarImagenes.class.getResourceAsStream("LogoReporte.jpg"); reportFile = AuxiliarReportes.class.getResourceAsStream("SubPreguntaEvaluacionBaseDesign.jrxml"); sPath=this.parametroGeneralUsuario.getpath_exportar()+"SubPreguntaEvaluacionBaseDesign.jrxml"; sXmlStringFile=Funciones2.getStringFromInputStream(reportFile); bufferedWriter = new BufferedWriter(new FileWriter(sPath)); sXmlStringFile=this.actualizarReporteDinamico(sXmlStringFile); bufferedWriter.write(sXmlStringFile); bufferedWriter.close(); try{JasperCompileManager.compileReportToFile(sPath);}catch(Exception e){e.printStackTrace();} this.actualizarVariablesTipoReporte(false,true,false,sPath); /* this.esReporteDinamico=true; this.sPathReporteDinamico=sPath.replace(".jrxml",".jasper"); this.sTipoReporteExtra=""; */ this.generarReporteSubPreguntaEvaluacions("Todos",subpreguntaevaluacionsSeleccionados ); if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && //DEBE APARECER EL REPORTE DIRECTAMENTE //JOptionPane.showMessageDialog(this,"GENERADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Sub Pregunta Evaluacion",JOptionPane.INFORMATION_MESSAGE); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if (bufferedWriter != null) { bufferedWriter.close(); } } } public String actualizarReporteDinamico(String sXmlStringFile) { Reporte reporte=new Reporte(); Integer iAnchoMaximoVertical=535;//781,782 Integer iAnchoMaximoHorizontal=782; Integer iAnchoSum=0; Integer iAnchoColumna=0; Integer iAnchoMargenes=60; String sWidthGrafico="535"; for(int index:this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListColumnasSelectReporte().getSelectedIndices()) { reporte=(Reporte)this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListColumnasSelectReporte().getModel().getElementAt(index); switch(reporte.getsCodigo()) { case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEMPRESA: iAnchoColumna=100; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_Empresa_col", ""); sXmlStringFile=sXmlStringFile.replace("col_Empresa_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_Empresa_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_Empresa_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDSUCURSAL: iAnchoColumna=100; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_Sucursal_col", ""); sXmlStringFile=sXmlStringFile.replace("col_Sucursal_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_Sucursal_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_Sucursal_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPREGUNTAEVALUACION: iAnchoColumna=100; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_PreguntaEvaluacion_col", ""); sXmlStringFile=sXmlStringFile.replace("col_PreguntaEvaluacion_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_PreguntaEvaluacion_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_PreguntaEvaluacion_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEJERCICIO: iAnchoColumna=100; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_Ejercicio_col", ""); sXmlStringFile=sXmlStringFile.replace("col_Ejercicio_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_Ejercicio_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_Ejercicio_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPERIODO: iAnchoColumna=100; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_Periodo_col", ""); sXmlStringFile=sXmlStringFile.replace("col_Periodo_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_Periodo_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_Periodo_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN: iAnchoColumna=50; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_den_col", ""); sXmlStringFile=sXmlStringFile.replace("col_den_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_den_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_den_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA: iAnchoColumna=100; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_egunta_col", ""); sXmlStringFile=sXmlStringFile.replace("col_egunta_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_egunta_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_egunta_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI: iAnchoColumna=50; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_rcentajeSi_col", ""); sXmlStringFile=sXmlStringFile.replace("col_rcentajeSi_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_rcentajeSi_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_rcentajeSi_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA: iAnchoColumna=50; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_nFactura_col", ""); sXmlStringFile=sXmlStringFile.replace("col_nFactura_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_nFactura_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_nFactura_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA: iAnchoColumna=50; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_nOrdenCompra_col", ""); sXmlStringFile=sXmlStringFile.replace("col_nOrdenCompra_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_nOrdenCompra_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_nOrdenCompra_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO: iAnchoColumna=50; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_nCompleto_col", ""); sXmlStringFile=sXmlStringFile.replace("col_nCompleto_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_nCompleto_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_nCompleto_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO: iAnchoColumna=50; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_nATiempo_col", ""); sXmlStringFile=sXmlStringFile.replace("col_nATiempo_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_nATiempo_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_nATiempo_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; default : break; } } iAnchoSum+=iAnchoMargenes; if(iAnchoSum>iAnchoMaximoVertical) { sXmlStringFile=sXmlStringFile.replace("595", "842"); //sXmlStringFile=sXmlStringFile.replace("842", "595"); sXmlStringFile=sXmlStringFile.replace("535", "782"); sXmlStringFile=sXmlStringFile.replace("Portrait", "Landscape"); sWidthGrafico="782"; } else { sXmlStringFile=sXmlStringFile.replace("842", "595"); //sXmlStringFile=sXmlStringFile.replace("595", "842"); sXmlStringFile=sXmlStringFile.replace("782", "535"); sXmlStringFile=sXmlStringFile.replace("Landscape", "Portrait"); sWidthGrafico="535"; } if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjCheckBoxConGraficoDinamico().isSelected()) { sXmlStringFile=this.actualizarGraficoReporteDinamico(sXmlStringFile,sWidthGrafico); } else { sXmlStringFile=sXmlStringFile.replace("colancho_summary_colancho", "30"); } return sXmlStringFile; } public String actualizarGraficoReporteDinamico(String sXmlStringFile,String sWidthGrafico) { String strGrafico=""; String sTipo="NORMAL"; String strCategorySeries=""; String sNombreCampoCategoria=""; String sNombreCampoCategoriaValor=""; Reporte reporte=new Reporte(); Reporte reporteCategoriaValor=new Reporte(); Reporte reporteTipoGraficoReporte=new Reporte(); Boolean existe=false; sXmlStringFile=sXmlStringFile.replace("colancho_summary_colancho", "280"); //CATEGORIA GRAFICO reporte=((Reporte)this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxColumnaCategoriaGrafico().getSelectedItem()); //TIPO GRAFICO REPORTE reporteTipoGraficoReporte=((Reporte)this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxTiposGraficosReportesDinamico().getSelectedItem()); String sTipoGraficoReporte=reporteTipoGraficoReporte.getsCodigo(); switch(reporte.getsCodigo()) { case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEMPRESA: sNombreCampoCategoria="id_empresa"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDSUCURSAL: sNombreCampoCategoria="id_sucursal"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPREGUNTAEVALUACION: sNombreCampoCategoria="id_pregunta_evaluacion"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEJERCICIO: sNombreCampoCategoria="id_ejercicio"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPERIODO: sNombreCampoCategoria="id_periodo"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN: sNombreCampoCategoria="orden"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA: sNombreCampoCategoria="pregunta"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI: sNombreCampoCategoria="porcentaje_si"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA: sNombreCampoCategoria="con_factura"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA: sNombreCampoCategoria="con_orden_compra"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO: sNombreCampoCategoria="con_completo"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO: sNombreCampoCategoria="con_a_tiempo"; break; default : break; } //CATEGORIA GRAFICO //CATEGORIA VALOR reporteCategoriaValor=((Reporte)this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxColumnaCategoriaValor().getSelectedItem()); switch(reporteCategoriaValor.getsCodigo()) { case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEMPRESA: sNombreCampoCategoriaValor="id_empresa"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDSUCURSAL: sNombreCampoCategoriaValor="id_sucursal"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPREGUNTAEVALUACION: sNombreCampoCategoriaValor="id_pregunta_evaluacion"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEJERCICIO: sNombreCampoCategoriaValor="id_ejercicio"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPERIODO: sNombreCampoCategoriaValor="id_periodo"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN: sNombreCampoCategoriaValor="orden"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA: sNombreCampoCategoriaValor="pregunta"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI: sNombreCampoCategoriaValor="porcentaje_si"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA: sNombreCampoCategoriaValor="con_factura"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA: sNombreCampoCategoriaValor="con_orden_compra"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO: sNombreCampoCategoriaValor="con_completo"; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO: sNombreCampoCategoriaValor="con_a_tiempo"; break; default : break; } //CATEGORIA VALOR //VALORES GRAFICO for(int index:this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListColumnasValoresGrafico().getSelectedIndices()) { reporte=(Reporte)this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListColumnasValoresGrafico().getModel().getElementAt(index); switch(reporte.getsCodigo()) { case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEMPRESA: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Empresa",sNombreCampoCategoria,sNombreCampoCategoriaValor,"id_empresa"); break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDSUCURSAL: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Sucursal",sNombreCampoCategoria,sNombreCampoCategoriaValor,"id_sucursal"); break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPREGUNTAEVALUACION: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Pregunta Evaluacion",sNombreCampoCategoria,sNombreCampoCategoriaValor,"id_pregunta_evaluacion"); break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEJERCICIO: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Ejercicio",sNombreCampoCategoria,sNombreCampoCategoriaValor,"id_ejercicio"); break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPERIODO: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Periodo",sNombreCampoCategoria,sNombreCampoCategoriaValor,"id_periodo"); break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Orden",sNombreCampoCategoria,sNombreCampoCategoriaValor,"orden"); break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Pregunta",sNombreCampoCategoria,sNombreCampoCategoriaValor,"pregunta"); break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Porcentaje Si",sNombreCampoCategoria,sNombreCampoCategoriaValor,"porcentaje_si"); break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Con Factura",sNombreCampoCategoria,sNombreCampoCategoriaValor,"con_factura"); break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Con Orden Compra",sNombreCampoCategoria,sNombreCampoCategoriaValor,"con_orden_compra"); break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Con Completo",sNombreCampoCategoria,sNombreCampoCategoriaValor,"con_completo"); break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Con A Tiempo",sNombreCampoCategoria,sNombreCampoCategoriaValor,"con_a_tiempo"); break; default : break; } } //VALORES GRAFICO //if(sTipoGraficoReporte.equals("BARRAS") || sTipoGraficoReporte.equals("BARRAS_3D") || sTipoGraficoReporte.equals("BARRAS_XY") || // sTipoGraficoReporte.equals("PASTEL") || sTipoGraficoReporte.equals("PASTEL_3D") || sTipoGraficoReporte.equals("APILADO")) { existe=true; strGrafico=FuncionesReporte.getStringGraficoReporte(sTipoGraficoReporte,sWidthGrafico,strCategorySeries); //} if(existe) { sXmlStringFile=sXmlStringFile.replace("<!--GRAFICO-->", strGrafico); } return sXmlStringFile; } //@SuppressWarnings("deprecation") public void jButtonGenerarExcelReporteDinamicoSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsSeleccionados=this.getSubPreguntaEvaluacionsSeleccionados(true); String sTipo=Funciones2.getTipoExportar(this.parametroGeneralUsuario); Boolean conCabecera=this.parametroGeneralUsuario.getcon_exportar_cabecera(); String sDelimiter=Funciones2.getTipoDelimiter(this.parametroGeneralUsuario); String sPath=this.parametroGeneralUsuario.getpath_exportar()+"subpreguntaevaluacion";//.xls"; String sFilaCabecera=""; String sFilaDatos=""; Boolean existeFilas=false; Workbook workbook = null; FileOutputStream fileOutputStream=null; Reporte reporte=new Reporte(); try { if(sTipoArchivoReporte=="EXCEL2") { workbook = new HSSFWorkbook(); sPath+=".xls"; } else if(sTipoArchivoReporte=="EXCEL2_2") { workbook = new XSSFWorkbook(); sPath+=".xlsx"; } Sheet sheet = workbook.createSheet("SubPreguntaEvaluacions"); Integer iRow=0; Integer iCell=0; Row row = sheet.createRow(iRow); Cell cell = row.createCell(iCell); //cell.setCellValue("Blahblah"); for(int index:this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListColumnasSelectReporte().getSelectedIndices()) { reporte=(Reporte)this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListColumnasSelectReporte().getModel().getElementAt(index); switch(reporte.getsCodigo()) { case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEMPRESA: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEMPRESA); iRow++; for(SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionsSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(subpreguntaevaluacion.getempresa_descripcion()); iRow++; } existeFilas=true; iCell++; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDSUCURSAL: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDSUCURSAL); iRow++; for(SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionsSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(subpreguntaevaluacion.getsucursal_descripcion()); iRow++; } existeFilas=true; iCell++; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPREGUNTAEVALUACION: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPREGUNTAEVALUACION); iRow++; for(SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionsSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(subpreguntaevaluacion.getpreguntaevaluacion_descripcion()); iRow++; } existeFilas=true; iCell++; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEJERCICIO: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEJERCICIO); iRow++; for(SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionsSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(subpreguntaevaluacion.getejercicio_descripcion()); iRow++; } existeFilas=true; iCell++; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPERIODO: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPERIODO); iRow++; for(SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionsSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(subpreguntaevaluacion.getperiodo_descripcion()); iRow++; } existeFilas=true; iCell++; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN); iRow++; for(SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionsSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(subpreguntaevaluacion.getorden()); iRow++; } existeFilas=true; iCell++; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA); iRow++; for(SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionsSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(subpreguntaevaluacion.getpregunta()); iRow++; } existeFilas=true; iCell++; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI); iRow++; for(SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionsSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(subpreguntaevaluacion.getporcentaje_si()); iRow++; } existeFilas=true; iCell++; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA); iRow++; for(SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionsSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(subpreguntaevaluacion.getcon_factura()); iRow++; } existeFilas=true; iCell++; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA); iRow++; for(SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionsSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(subpreguntaevaluacion.getcon_orden_compra()); iRow++; } existeFilas=true; iCell++; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO); iRow++; for(SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionsSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(subpreguntaevaluacion.getcon_completo()); iRow++; } existeFilas=true; iCell++; break; case SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO); iRow++; for(SubPreguntaEvaluacion subpreguntaevaluacion:subpreguntaevaluacionsSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(subpreguntaevaluacion.getcon_a_tiempo()); iRow++; } existeFilas=true; iCell++; break; default : break; } } //if(conCabecera) { // this.getFilaCabeceraExportarExcelSubPreguntaEvaluacion(row); // iRow++; //} //for(SubPreguntaEvaluacion subpreguntaevaluacionAux:subpreguntaevaluacionsSeleccionados) { // row = sheet.createRow(iRow); // this.getFilaDatosExportarExcelSubPreguntaEvaluacion(subpreguntaevaluacionAux,row); // iRow++; //} fileOutputStream = new FileOutputStream(new File(sPath)); workbook.write(fileOutputStream); //fileOutputStream.close(); Constantes2.S_PATH_ULTIMO_ARCHIVO=sPath; if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && JOptionPane.showMessageDialog(this,"EXPORTADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Sub Pregunta Evaluacion",JOptionPane.INFORMATION_MESSAGE); } } catch (Exception e) { throw e; } finally { if (fileOutputStream != null) { fileOutputStream.close(); } } } public void buscarPorId(Long idActual) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } this.idActual=idActual; this.iNumeroPaginacionPagina=0; this.procesarBusqueda("PorId"); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingSubPreguntaEvaluacion(false); //SI ES MANUAL if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingManualSubPreguntaEvaluacion(); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonAnterioresSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { //this.iNumeroPaginacion-=this.iNumeroPaginacion; /* if(this.iNumeroPaginacion<0) { this.iNumeroPaginacion=0; } */ //this.iNumeroPaginacionPagina=10; if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } this.anteriores(); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingSubPreguntaEvaluacion(false); //SI ES MANUAL if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingManualSubPreguntaEvaluacion(); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonSiguientesSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { //this.iNumeroPaginacion+=this.iNumeroPaginacion; //this.iNumeroPaginacionPagina=10; if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } this.siguientes(); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingSubPreguntaEvaluacion(false); //SI ES MANUAL if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingManualSubPreguntaEvaluacion(); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void aumentarTamanioFilaNuevaTablaSubPreguntaEvaluacion() throws Exception { Dimension dimensionMinimum=this.jTableDatosSubPreguntaEvaluacion.getMinimumSize(); Dimension dimensionMaximum=this.jTableDatosSubPreguntaEvaluacion.getMaximumSize(); Dimension dimensionPreferred=this.jTableDatosSubPreguntaEvaluacion.getPreferredSize(); double iHeightConFilaNueva=dimensionPreferred.getHeight(); iHeightConFilaNueva+=this.jTableDatosSubPreguntaEvaluacion.getRowHeight(); dimensionMinimum.setSize(dimensionMinimum.getWidth(),iHeightConFilaNueva); dimensionMaximum.setSize(dimensionMaximum.getWidth(),iHeightConFilaNueva); dimensionPreferred.setSize(dimensionPreferred.getWidth(),iHeightConFilaNueva); this.jTableDatosSubPreguntaEvaluacion.setMinimumSize(dimensionMinimum); this.jTableDatosSubPreguntaEvaluacion.setMaximumSize(dimensionMaximum); this.jTableDatosSubPreguntaEvaluacion.setPreferredSize(dimensionPreferred); } public void inicializarActualizarBindingSubPreguntaEvaluacion(Boolean esInicializar) throws Exception { this.inicializarActualizarBindingSubPreguntaEvaluacion(esInicializar,true); } public void inicializarActualizarBindingSubPreguntaEvaluacion(Boolean esInicializar,Boolean conTabla) throws Exception { if(conTabla) { this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(esInicializar); } this.inicializarActualizarBindingBotonesSubPreguntaEvaluacion(esInicializar); //FUNCIONALIDAD_RELACIONADO if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { try{this.inicializarActualizarBindingBusquedasSubPreguntaEvaluacion(esInicializar);}catch(Exception e){e.printStackTrace();} //this.inicializarActualizarBindingtiposArchivosReportesAccionesSubPreguntaEvaluacion(esInicializar) ; this.inicializarActualizarBindingParametrosReportesSubPreguntaEvaluacion(esInicializar) ; } if(esInicializar) { if( !SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL_TABLA || !SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { } } } public void inicializarActualizarBindingManualSubPreguntaEvaluacion() throws Exception { //NO SE NECESITA HACER BINDING OTRA VEZ //this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(); this.inicializarActualizarBindingBotonesManualSubPreguntaEvaluacion(true); //FUNCIONALIDAD_RELACIONADO if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { this.inicializarActualizarBindingBusquedasManualSubPreguntaEvaluacion(); //this.inicializarActualizarBindingtiposArchivosReportesAccionesSubPreguntaEvaluacion() ; this.inicializarActualizarBindingParametrosReportesPostAccionesManualSubPreguntaEvaluacion(false) ; } } public void inicializarActualizarBindingParametrosReportesPostAccionesManualSubPreguntaEvaluacion(Boolean esSetControles) throws Exception { try { if(!esSetControles) { this.isSeleccionarTodos=this.jCheckBoxSeleccionarTodosSubPreguntaEvaluacion.isSelected(); this.isSeleccionados=this.jCheckBoxSeleccionadosSubPreguntaEvaluacion.isSelected(); this.conGraficoReporte=this.jCheckBoxConGraficoReporteSubPreguntaEvaluacion.isSelected(); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.isPostAccionNuevo=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxPostAccionNuevoSubPreguntaEvaluacion.isSelected(); this.isPostAccionSinCerrar=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxPostAccionSinCerrarSubPreguntaEvaluacion.isSelected(); this.isPostAccionSinMensaje=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxPostAccionSinMensajeSubPreguntaEvaluacion.isSelected(); } } else { this.jCheckBoxSeleccionarTodosSubPreguntaEvaluacion.setSelected(this.isSeleccionarTodos); this.jCheckBoxSeleccionadosSubPreguntaEvaluacion.setSelected(this.isSeleccionados); this.jCheckBoxConGraficoReporteSubPreguntaEvaluacion.setSelected(this.conGraficoReporte); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxPostAccionNuevoSubPreguntaEvaluacion.setSelected(this.isPostAccionNuevo); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxPostAccionSinCerrarSubPreguntaEvaluacion.setSelected(this.isPostAccionSinCerrar); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxPostAccionSinMensajeSubPreguntaEvaluacion.setSelected(this.isPostAccionSinMensaje); } } if(this.jComboBoxTiposPaginacionSubPreguntaEvaluacion.getSelectedItem()!=null) { this.sTipoPaginacion=((Reporte)this.jComboBoxTiposPaginacionSubPreguntaEvaluacion.getSelectedItem()).getsCodigo(); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.sTipoAccionFormulario=((Reporte)this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.getSelectedItem()).getsCodigo(); } if(!this.conCargarMinimo) { this.sTipoArchivoReporte=((Reporte)this.jComboBoxTiposArchivosReportesSubPreguntaEvaluacion.getSelectedItem()).getsCodigo(); if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion!=null) { this.sTipoArchivoReporteDinamico=((Reporte)this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxTiposArchivosReportesDinamico().getSelectedItem()).getsCodigo(); } this.sTipoRelacion=((Reporte)this.jComboBoxTiposRelacionesSubPreguntaEvaluacion.getSelectedItem()).getsCodigo(); this.sTipoAccion=((Reporte)this.jComboBoxTiposAccionesSubPreguntaEvaluacion.getSelectedItem()).getsCodigo(); this.sTipoSeleccionar=((Reporte)this.jComboBoxTiposSeleccionarSubPreguntaEvaluacion.getSelectedItem()).getsCodigo(); this.sTipoReporte=((Reporte)this.jComboBoxTiposReportesSubPreguntaEvaluacion.getSelectedItem()).getsCodigo(); if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion!=null) { this.sTipoReporteDinamico=((Reporte)this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxTiposReportesDinamico().getSelectedItem()).getsCodigo(); } this.sTipoGraficoReporte=((Reporte)this.jComboBoxTiposGraficosReportesSubPreguntaEvaluacion.getSelectedItem()).getsCodigo(); } this.sValorCampoGeneral=this.jTextFieldValorCampoGeneralSubPreguntaEvaluacion.getText(); } catch(Exception e) { throw e; } } public void inicializarActualizarBindingParametrosReportesSubPreguntaEvaluacion(Boolean esInicializar) throws Exception { try { if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { this. inicializarActualizarBindingParametrosReportesPostAccionesManualSubPreguntaEvaluacion(false); } else { } } catch(Exception e) { throw e; } } public void inicializarActualizarBindingtiposArchivosReportesAccionesSubPreguntaEvaluacion() throws Exception { try { if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { this.inicializarActualizarBindingtiposArchivosReportesAccionesManualSubPreguntaEvaluacion(); } else { } } catch(Exception e) { throw e; } } @SuppressWarnings("unchecked") public void inicializarActualizarBindingtiposArchivosReportesAccionesManualFormDetalleSubPreguntaEvaluacion() throws Exception { //TIPOS ACCIONES FORMULARIO this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.removeAllItems(); for(Reporte reporte:this.tiposAccionesFormulario) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.addItem(reporte); } //TIPOS ACCIONES FORMULARIO } @SuppressWarnings("unchecked") public void inicializarActualizarBindingtiposArchivosReportesAccionesManualSubPreguntaEvaluacion() throws Exception { try { //TIPOS ARCHIVOS REPORTES this.jComboBoxTiposArchivosReportesSubPreguntaEvaluacion.removeAllItems(); for(Reporte reporte:this.tiposArchivosReportes) { this.jComboBoxTiposArchivosReportesSubPreguntaEvaluacion.addItem(reporte); } //TIPOS REPORTES this.jComboBoxTiposReportesSubPreguntaEvaluacion.removeAllItems(); for(Reporte reporte:this.tiposReportes) { this.jComboBoxTiposReportesSubPreguntaEvaluacion.addItem(reporte); } //TIPOS GRAFICOS REPORTES this.jComboBoxTiposGraficosReportesSubPreguntaEvaluacion.removeAllItems(); for(Reporte reporte:this.tiposGraficosReportes) { this.jComboBoxTiposGraficosReportesSubPreguntaEvaluacion.addItem(reporte); } //TIPOS PAGINACION this.jComboBoxTiposPaginacionSubPreguntaEvaluacion.removeAllItems(); for(Reporte reporte:this.tiposPaginacion) { this.jComboBoxTiposPaginacionSubPreguntaEvaluacion.addItem(reporte); } if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { this.jComboBoxTiposPaginacionSubPreguntaEvaluacion.setSelectedItem(Funciones2.getTipoPaginacionDefecto("NORMAL",this.tiposPaginacion)); } else { this.jComboBoxTiposPaginacionSubPreguntaEvaluacion.setSelectedItem(Funciones2.getTipoPaginacionDefecto("RELACIONADO",this.tiposPaginacion)); } //TIPOS ACCIONES this.jComboBoxTiposRelacionesSubPreguntaEvaluacion.removeAllItems(); for(Reporte reporte:this.tiposRelaciones) { this.jComboBoxTiposRelacionesSubPreguntaEvaluacion.addItem(reporte); } //TIPOS ACCIONES //TIPOS ACCIONES this.jComboBoxTiposAccionesSubPreguntaEvaluacion.removeAllItems(); for(Reporte reporte:this.tiposAcciones) { this.jComboBoxTiposAccionesSubPreguntaEvaluacion.addItem(reporte); } //TIPOS ACCIONES //TIPOS ACCIONES FORMULARIO if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.removeAllItems(); for(Reporte reporte:this.tiposAccionesFormulario) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.addItem(reporte); } } //TIPOS ACCIONES FORMULARIO //TIPOS SELECCIONAR this.jComboBoxTiposSeleccionarSubPreguntaEvaluacion.removeAllItems(); for(Reporte reporte:this.tiposSeleccionar) { this.jComboBoxTiposSeleccionarSubPreguntaEvaluacion.addItem(reporte); } if(this.tiposSeleccionar!=null && this.tiposSeleccionar.size()>1) { this.jComboBoxTiposSeleccionarSubPreguntaEvaluacion.setSelectedIndex(1); } //REPORTE DINAMICO this.inicializarActualizarBindingtiposArchivosReportesDinamicoAccionesManualSubPreguntaEvaluacion(); //TIPOS COLUMNAS SELECT //TIPOS SELECCIONAR } catch(Exception e) { throw e; } } @SuppressWarnings("unchecked") public void inicializarActualizarBindingtiposArchivosReportesDinamicoAccionesManualSubPreguntaEvaluacion() throws Exception { try { DefaultListModel<Reporte> defaultListModel=new DefaultListModel<Reporte>(); //TIPOS ARCHIVOS REPORTES DINAMICO if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion!=null) { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxTiposArchivosReportesDinamico().removeAllItems(); for(Reporte reporte:this.tiposArchivosReportesDinamico) { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxTiposArchivosReportesDinamico().addItem(reporte); } } //TIPOS REPORTES DINAMICO if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion!=null) { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxTiposReportesDinamico().removeAllItems(); for(Reporte reporte:this.tiposReportesDinamico) { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxTiposReportesDinamico().addItem(reporte); } } defaultListModel=new DefaultListModel<Reporte>(); if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion!=null) { if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListColumnasSelectReporte()!=null) { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListColumnasSelectReporte().removeAll(); for(Reporte reporte:this.tiposColumnasSelect) { defaultListModel.addElement(reporte); } this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListColumnasSelectReporte().setModel(defaultListModel); } //TIPOS RELACIONES SELECT //TIPOS SELECCIONAR defaultListModel=new DefaultListModel<Reporte>(); if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListRelacionesSelectReporte()!=null) { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListRelacionesSelectReporte().removeAll(); for(Reporte reporte:this.tiposRelacionesSelect) { defaultListModel.addElement(reporte); } this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListRelacionesSelectReporte().setModel(defaultListModel); } //TIPOS COLUMNAS CATEGORIA DINAMICO if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxColumnaCategoriaGrafico()!=null) { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxColumnaCategoriaGrafico().removeAllItems(); ArrayList<Reporte> tiposColumnasCategoria=SubPreguntaEvaluacionConstantesFunciones.getTiposSeleccionarSubPreguntaEvaluacion(true,true,false,true,true); for(Reporte reporte:tiposColumnasCategoria) {//this.tiposSeleccionar this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxColumnaCategoriaGrafico().addItem(reporte); } } //TIPOS COLUMNAS CATEGORIA VALOR DINAMICO if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxColumnaCategoriaValor()!=null) { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxColumnaCategoriaValor().removeAllItems(); ArrayList<Reporte> tiposColumnasCategoriaValor=SubPreguntaEvaluacionConstantesFunciones.getTiposSeleccionarSubPreguntaEvaluacion(false,false,true,false,false); for(Reporte reporte:tiposColumnasCategoriaValor) {//this.tiposSeleccionar this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxColumnaCategoriaValor().addItem(reporte); } } //TIPOS COLUMNAS VALOR defaultListModel=new DefaultListModel<Reporte>(); if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListColumnasValoresGrafico()!=null) { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListColumnasValoresGrafico().removeAll(); ArrayList<Reporte> tiposColumnasValor=SubPreguntaEvaluacionConstantesFunciones.getTiposSeleccionarSubPreguntaEvaluacion(false,false,true,false,false); for(Reporte reporte:tiposColumnasValor) {//this.tiposSeleccionar defaultListModel.addElement(reporte); } this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjListColumnasValoresGrafico().setModel(defaultListModel); } //TIPOS GRAFICOS REPORTES DINAMICOS if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxTiposGraficosReportesDinamico()!=null) { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxTiposGraficosReportesDinamico().removeAllItems(); for(Reporte reporte:this.tiposGraficosReportes) { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjComboBoxTiposGraficosReportesDinamico().addItem(reporte); } } } } catch(Exception e) { throw e; } } public void inicializarActualizarBindingBusquedasManualSubPreguntaEvaluacion() throws Exception { //BYDAN_BUSQUEDAS if(this.jComboBoxid_pregunta_evaluacionFK_IdPreguntaEvaluacionSubPreguntaEvaluacion.getSelectedItem()!=null){this.id_pregunta_evaluacionFK_IdPreguntaEvaluacion=((PreguntaEvaluacion)this.jComboBoxid_pregunta_evaluacionFK_IdPreguntaEvaluacionSubPreguntaEvaluacion.getSelectedItem()).getId();} } public void inicializarActualizarBindingBusquedasSubPreguntaEvaluacion(Boolean esInicializar) throws Exception { if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { this.inicializarActualizarBindingBusquedasManualSubPreguntaEvaluacion(); } else { } } public void inicializarActualizarBindingTablaSubPreguntaEvaluacion() throws Exception { this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); } public void inicializarActualizarBindingTablaOrderBySubPreguntaEvaluacion() { //TABLA OrderBy TableColumn tableColumn=new TableColumn(); Integer iWidthTableDefinicionOrderBy=0; this.jInternalFrameOrderBySubPreguntaEvaluacion.getjTableDatosOrderBy().setModel(new TablaGeneralOrderByModel(this.arrOrderBy)); //DEFINIR RENDERERS OrderBy tableColumn=this.jInternalFrameOrderBySubPreguntaEvaluacion.getjTableDatosOrderBy().getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jInternalFrameOrderBySubPreguntaEvaluacion.getjTableDatosOrderBy(),OrderBy.ISSELECTED)); //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); tableColumn.setPreferredWidth(50); tableColumn.setWidth(50); tableColumn.setMinWidth(50); tableColumn.setMaxWidth(50); iWidthTableDefinicionOrderBy+=50; tableColumn=this.jInternalFrameOrderBySubPreguntaEvaluacion.getjTableDatosOrderBy().getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jInternalFrameOrderBySubPreguntaEvaluacion.getjTableDatosOrderBy(),OrderBy.NOMBRE)); //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); tableColumn.setPreferredWidth(150); tableColumn.setWidth(150); tableColumn.setMinWidth(150); tableColumn.setMaxWidth(150); iWidthTableDefinicionOrderBy+=150; //tableColumn=this.jTableDatosSubPreguntaEvaluacionOrderBy.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacionOrderBy,OrderBy.NOMBREDB)); ////tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); tableColumn=this.jInternalFrameOrderBySubPreguntaEvaluacion.getjTableDatosOrderBy().getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jInternalFrameOrderBySubPreguntaEvaluacion.getjTableDatosOrderBy(),OrderBy.ESDESC)); //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); tableColumn.setPreferredWidth(50); tableColumn.setWidth(50); tableColumn.setMinWidth(50); tableColumn.setMaxWidth(50); ((AbstractTableModel) this.jInternalFrameOrderBySubPreguntaEvaluacion.getjTableDatosOrderBy().getModel()).fireTableDataChanged(); iWidthTableDefinicionOrderBy+=50; } public void inicializarActualizarBindingTablaSubPreguntaEvaluacion(Boolean esInicializar) throws Exception { Boolean isNoExiste=false; Integer iCountNumeroColumnasNormal=0; Integer iCountNumeroColumnasFk=0; this.iWidthTableDefinicion=0; int iSizeTabla=0; iSizeTabla=this.getSizeTablaDatos(); if(esInicializar || ConstantesSwing.FORZAR_INICIALIZAR_TABLA) {//esInicializar //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { isNoExiste=subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().size()==0; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { isNoExiste=subpreguntaevaluacions.size()==0; } //ARCHITECTURE if(isNoExiste) { if(this.iNumeroPaginacion-this.iNumeroPaginacion>0) { this.iNumeroPaginacion-=this.iNumeroPaginacion; } } TableColumn tableColumn=new TableColumn(); if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL_TABLA) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.jTableDatosSubPreguntaEvaluacion.setModel(new SubPreguntaEvaluacionModel(this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions(),this)); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.jTableDatosSubPreguntaEvaluacion.setModel(new SubPreguntaEvaluacionModel(this.subpreguntaevaluacions,this)); } //ARCHITECTURE if(this.jInternalFrameOrderBySubPreguntaEvaluacion!=null && this.jInternalFrameOrderBySubPreguntaEvaluacion.getjTableDatosOrderBy()!=null) { this.inicializarActualizarBindingTablaOrderBySubPreguntaEvaluacion(); } //DEFINIR RENDERERS tableColumn=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,Constantes2.S_SELECCIONAR)); //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); tableColumn.setCellRenderer(new BooleanRenderer(true,"Seleccionar "+SubPreguntaEvaluacionConstantesFunciones.SCLASSWEBTITULO,subpreguntaevaluacionConstantesFunciones.resaltarSeleccionarSubPreguntaEvaluacion,iSizeTabla,true,false,"","",this)); tableColumn.setCellEditor(new BooleanEditorRenderer(true,"Seleccionar "+SubPreguntaEvaluacionConstantesFunciones.SCLASSWEBTITULO,subpreguntaevaluacionConstantesFunciones.resaltarSeleccionarSubPreguntaEvaluacion,false,"","",this)); tableColumn.setPreferredWidth(50); tableColumn.setWidth(50); tableColumn.setMinWidth(50); tableColumn.setMaxWidth(50); this.iWidthTableDefinicion+=50; tableColumn=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,SubPreguntaEvaluacionConstantesFunciones.LABEL_ID)); if(this.subpreguntaevaluacionConstantesFunciones.mostraridSubPreguntaEvaluacion && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,SubPreguntaEvaluacionConstantesFunciones.LABEL_ID,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new TextFieldRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltaridSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activaridSubPreguntaEvaluacion,iSizeTabla,this,true,"idSubPreguntaEvaluacion","BASICO")); tableColumn.setCellEditor(new TextFieldEditorRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltaridSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activaridSubPreguntaEvaluacion,this,true,"idSubPreguntaEvaluacion","BASICO",false)); tableColumn.setPreferredWidth(50); tableColumn.setWidth(50); tableColumn.setMinWidth(50); tableColumn.setMaxWidth(50); this.iWidthTableDefinicion+=50; } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEMPRESA)); if(this.subpreguntaevaluacionConstantesFunciones.mostrarid_empresaSubPreguntaEvaluacion && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEMPRESA,true,iCountNumeroColumnasNormal,iCountNumeroColumnasFk++) && Constantes.ISDEVELOPING) { tableColumn.setCellRenderer(new EmpresaTableCell(this.empresasForeignKey,this.subpreguntaevaluacionConstantesFunciones.resaltarid_empresaSubPreguntaEvaluacion,this,this.subpreguntaevaluacionConstantesFunciones.activarid_empresaSubPreguntaEvaluacion,iSizeTabla)); tableColumn.setCellEditor(new EmpresaTableCell(this.empresasForeignKey,this.subpreguntaevaluacionConstantesFunciones.resaltarid_empresaSubPreguntaEvaluacion,this,this.subpreguntaevaluacionConstantesFunciones.activarid_empresaSubPreguntaEvaluacion,false,"id_empresaSubPreguntaEvaluacion","GLOBAL")); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0); //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,SubPreguntaEvaluacionConstantesFunciones.LABEL_IDSUCURSAL)); if(this.subpreguntaevaluacionConstantesFunciones.mostrarid_sucursalSubPreguntaEvaluacion && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,SubPreguntaEvaluacionConstantesFunciones.LABEL_IDSUCURSAL,true,iCountNumeroColumnasNormal,iCountNumeroColumnasFk++) && Constantes.ISDEVELOPING) { tableColumn.setCellRenderer(new SucursalTableCell(this.sucursalsForeignKey,this.subpreguntaevaluacionConstantesFunciones.resaltarid_sucursalSubPreguntaEvaluacion,this,this.subpreguntaevaluacionConstantesFunciones.activarid_sucursalSubPreguntaEvaluacion,iSizeTabla)); tableColumn.setCellEditor(new SucursalTableCell(this.sucursalsForeignKey,this.subpreguntaevaluacionConstantesFunciones.resaltarid_sucursalSubPreguntaEvaluacion,this,this.subpreguntaevaluacionConstantesFunciones.activarid_sucursalSubPreguntaEvaluacion,false,"id_sucursalSubPreguntaEvaluacion","GLOBAL")); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0); //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPREGUNTAEVALUACION)); if(this.subpreguntaevaluacionConstantesFunciones.mostrarid_pregunta_evaluacionSubPreguntaEvaluacion && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPREGUNTAEVALUACION,true,iCountNumeroColumnasNormal,iCountNumeroColumnasFk++)) { tableColumn.setCellRenderer(new PreguntaEvaluacionTableCell(this.preguntaevaluacionsForeignKey,this.subpreguntaevaluacionConstantesFunciones.resaltarid_pregunta_evaluacionSubPreguntaEvaluacion,this,this.subpreguntaevaluacionConstantesFunciones.activarid_pregunta_evaluacionSubPreguntaEvaluacion,iSizeTabla)); tableColumn.setCellEditor(new PreguntaEvaluacionTableCell(this.preguntaevaluacionsForeignKey,this.subpreguntaevaluacionConstantesFunciones.resaltarid_pregunta_evaluacionSubPreguntaEvaluacion,this,this.subpreguntaevaluacionConstantesFunciones.activarid_pregunta_evaluacionSubPreguntaEvaluacion,true,"id_pregunta_evaluacionSubPreguntaEvaluacion","BASICO")); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0); //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEJERCICIO)); if(this.subpreguntaevaluacionConstantesFunciones.mostrarid_ejercicioSubPreguntaEvaluacion && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEJERCICIO,true,iCountNumeroColumnasNormal,iCountNumeroColumnasFk++) && Constantes.ISDEVELOPING) { tableColumn.setCellRenderer(new EjercicioTableCell(this.ejerciciosForeignKey,this.subpreguntaevaluacionConstantesFunciones.resaltarid_ejercicioSubPreguntaEvaluacion,this,this.subpreguntaevaluacionConstantesFunciones.activarid_ejercicioSubPreguntaEvaluacion,iSizeTabla)); tableColumn.setCellEditor(new EjercicioTableCell(this.ejerciciosForeignKey,this.subpreguntaevaluacionConstantesFunciones.resaltarid_ejercicioSubPreguntaEvaluacion,this,this.subpreguntaevaluacionConstantesFunciones.activarid_ejercicioSubPreguntaEvaluacion,false,"id_ejercicioSubPreguntaEvaluacion","GLOBAL")); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0); //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPERIODO)); if(this.subpreguntaevaluacionConstantesFunciones.mostrarid_periodoSubPreguntaEvaluacion && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPERIODO,true,iCountNumeroColumnasNormal,iCountNumeroColumnasFk++) && Constantes.ISDEVELOPING) { tableColumn.setCellRenderer(new PeriodoTableCell(this.periodosForeignKey,this.subpreguntaevaluacionConstantesFunciones.resaltarid_periodoSubPreguntaEvaluacion,this,this.subpreguntaevaluacionConstantesFunciones.activarid_periodoSubPreguntaEvaluacion,iSizeTabla)); tableColumn.setCellEditor(new PeriodoTableCell(this.periodosForeignKey,this.subpreguntaevaluacionConstantesFunciones.resaltarid_periodoSubPreguntaEvaluacion,this,this.subpreguntaevaluacionConstantesFunciones.activarid_periodoSubPreguntaEvaluacion,false,"id_periodoSubPreguntaEvaluacion","GLOBAL")); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0); //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN)); if(this.subpreguntaevaluacionConstantesFunciones.mostrarordenSubPreguntaEvaluacion && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new TextFieldRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltarordenSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activarordenSubPreguntaEvaluacion,iSizeTabla,this,true,"ordenSubPreguntaEvaluacion","BASICO")); tableColumn.setCellEditor(new TextFieldEditorRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltarordenSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activarordenSubPreguntaEvaluacion,this,true,"ordenSubPreguntaEvaluacion","BASICO",false)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA)); if(this.subpreguntaevaluacionConstantesFunciones.mostrarpreguntaSubPreguntaEvaluacion && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new LabelRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltarpreguntaSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activarpreguntaSubPreguntaEvaluacion,iSizeTabla,this,true,"preguntaSubPreguntaEvaluacion","BASICO")); tableColumn.setCellEditor(new TextFieldEditorRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltarpreguntaSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activarpreguntaSubPreguntaEvaluacion,this,true,"preguntaSubPreguntaEvaluacion","BASICO",false)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0); //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI)); if(this.subpreguntaevaluacionConstantesFunciones.mostrarporcentaje_siSubPreguntaEvaluacion && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new TextFieldRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltarporcentaje_siSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activarporcentaje_siSubPreguntaEvaluacion,iSizeTabla,this,true,"porcentaje_siSubPreguntaEvaluacion","BASICO")); tableColumn.setCellEditor(new TextFieldEditorRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltarporcentaje_siSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activarporcentaje_siSubPreguntaEvaluacion,this,true,"porcentaje_siSubPreguntaEvaluacion","BASICO",false)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA)); if(this.subpreguntaevaluacionConstantesFunciones.mostrarcon_facturaSubPreguntaEvaluacion && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new BooleanRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_facturaSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activarcon_facturaSubPreguntaEvaluacion,iSizeTabla)); tableColumn.setCellEditor(new BooleanEditorRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_facturaSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activarcon_facturaSubPreguntaEvaluacion,this,true,"con_facturaSubPreguntaEvaluacion","BASICO")); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA)); if(this.subpreguntaevaluacionConstantesFunciones.mostrarcon_orden_compraSubPreguntaEvaluacion && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new BooleanRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_orden_compraSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activarcon_orden_compraSubPreguntaEvaluacion,iSizeTabla)); tableColumn.setCellEditor(new BooleanEditorRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_orden_compraSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activarcon_orden_compraSubPreguntaEvaluacion,this,true,"con_orden_compraSubPreguntaEvaluacion","BASICO")); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO)); if(this.subpreguntaevaluacionConstantesFunciones.mostrarcon_completoSubPreguntaEvaluacion && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new BooleanRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_completoSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activarcon_completoSubPreguntaEvaluacion,iSizeTabla)); tableColumn.setCellEditor(new BooleanEditorRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_completoSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activarcon_completoSubPreguntaEvaluacion,this,true,"con_completoSubPreguntaEvaluacion","BASICO")); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO)); if(this.subpreguntaevaluacionConstantesFunciones.mostrarcon_a_tiempoSubPreguntaEvaluacion && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new BooleanRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_a_tiempoSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activarcon_a_tiempoSubPreguntaEvaluacion,iSizeTabla)); tableColumn.setCellEditor(new BooleanEditorRenderer(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_a_tiempoSubPreguntaEvaluacion,this.subpreguntaevaluacionConstantesFunciones.activarcon_a_tiempoSubPreguntaEvaluacion,this,true,"con_a_tiempoSubPreguntaEvaluacion","BASICO")); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; //tableColumn.addPropertyChangeListener(new SubPreguntaEvaluacionPropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } } else { } if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado() && !this.esParaBusquedaForeignKey) { if(this.isTienePermisosDetalleEvaluacionProveedor && this.subpreguntaevaluacionConstantesFunciones.mostrarDetalleEvaluacionProveedorSubPreguntaEvaluacion && !SubPreguntaEvaluacionConstantesFunciones.ISGUARDARREL) { tableColumn= new TableColumn(); tableColumn.setIdentifier("Detalle Evaluacion Proveedores"); tableColumn.setHeaderValue("Detalle Evaluacion Proveedores"); tableColumn.setCellRenderer(new DetalleEvaluacionProveedorTableCell(subpreguntaevaluacionConstantesFunciones.resaltarDetalleEvaluacionProveedorSubPreguntaEvaluacion,this,this.subpreguntaevaluacionConstantesFunciones.activarDetalleEvaluacionProveedorSubPreguntaEvaluacion)); tableColumn.setCellEditor(new DetalleEvaluacionProveedorTableCell(subpreguntaevaluacionConstantesFunciones.resaltarDetalleEvaluacionProveedorSubPreguntaEvaluacion,this,this.subpreguntaevaluacionConstantesFunciones.activarDetalleEvaluacionProveedorSubPreguntaEvaluacion)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setWidth(Constantes.ISWING_ANCHO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_CONTROL + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0); this.jTableDatosSubPreguntaEvaluacion.addColumn(tableColumn); } } if(true) { String sLabelColumnAccion="Editar"; String sLabelColumnAccionEli="Eli"; if(this.esParaBusquedaForeignKey) { sLabelColumnAccion="Seleccionar"; //LO MISMO QUE ELSE tableColumn= new TableColumn(); tableColumn.setIdentifier(sLabelColumnAccion); tableColumn.setHeaderValue(sLabelColumnAccion); tableColumn.setCellRenderer(new IdTableCell(this,false,false,this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado(),iSizeTabla)); tableColumn.setCellEditor(new IdTableCell(this,false,false,this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado(),iSizeTabla)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; this.jTableDatosSubPreguntaEvaluacion.addColumn(tableColumn); } else { //LO MISMO QUE IF tableColumn= new TableColumn(); tableColumn.setIdentifier(sLabelColumnAccion); tableColumn.setHeaderValue(sLabelColumnAccion); tableColumn.setCellRenderer(new IdTableCell(this,false,false,this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado(),iSizeTabla)); tableColumn.setCellEditor(new IdTableCell(this,false,false,this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado(),iSizeTabla)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; this.jTableDatosSubPreguntaEvaluacion.addColumn(tableColumn); //ELIMINAR if(this.isPermisoEliminarSubPreguntaEvaluacion && this.isPermisoGuardarCambiosSubPreguntaEvaluacion) { tableColumn= new TableColumn(); tableColumn.setIdentifier(Constantes2.S_ELI); tableColumn.setHeaderValue(sLabelColumnAccionEli); tableColumn.setCellRenderer(new IdTableCell(this,false,true,this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado(),iSizeTabla)); tableColumn.setCellEditor(new IdTableCell(this,false,true,this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado(),iSizeTabla)); tableColumn.setPreferredWidth(65); tableColumn.setWidth(65); tableColumn.setMinWidth(65); tableColumn.setMaxWidth(65); this.iWidthTableDefinicion+=65; this.jTableDatosSubPreguntaEvaluacion.addColumn(tableColumn); } } if(this.conMaximoRelaciones && this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { if(this.conFuncionalidadRelaciones) { tableColumn= new TableColumn(); tableColumn.setIdentifier("Editar Rel"); tableColumn.setHeaderValue("Editar Rel"); tableColumn.setCellRenderer(new IdTableCell(this,true,false,iSizeTabla)); tableColumn.setCellEditor(new IdTableCell(this,true,false,iSizeTabla)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; this.jTableDatosSubPreguntaEvaluacion.addColumn(tableColumn); } } /* tableColumn= new TableColumn(); tableColumn.setIdentifier(Constantes2.S_SELECCIONAR); tableColumn.setHeaderValue(Constantes2.S_SELECCIONAR); tableColumn.setCellRenderer(new IdSeleccionarTableCell(this)); tableColumn.setCellEditor(new IdSeleccionarTableCell(this)); tableColumn.setPreferredWidth(30); tableColumn.setWidth(30); tableColumn.setMinWidth(30); this.iWidthTableDefinicion+=30; this.jTableDatosSubPreguntaEvaluacion.addColumn(tableColumn); */ } Integer iUltimaColumna=0;//1 Integer iNuevaPosicionColumna=0; //PERMITE ELIMINAR SIMPLE if(!this.esParaBusquedaForeignKey) { if(this.isPermisoEliminarSubPreguntaEvaluacion && this.isPermisoGuardarCambiosSubPreguntaEvaluacion) { iUltimaColumna++; } } //PERMITE EDITAR SIMPLE iUltimaColumna++; if(this.conFuncionalidadRelaciones) { if(this.conMaximoRelaciones && this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { //PERMITE EDITAR RELACIONES iUltimaColumna++;//2 } } //MOVIA SELECCIONAR //iUltimaColumna++; if(!this.esParaBusquedaForeignKey) { if(this.isPermisoEliminarSubPreguntaEvaluacion && this.isPermisoGuardarCambiosSubPreguntaEvaluacion) { //REUBICA ELIMINAR SIMPLE jTableDatosSubPreguntaEvaluacion.moveColumn(this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumnCount()-iUltimaColumna, iNuevaPosicionColumna++);//-1,-2 o -3 iUltimaColumna--; } } //REUBICA EDITAR SIMPLE jTableDatosSubPreguntaEvaluacion.moveColumn(this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumnCount()-iUltimaColumna, iNuevaPosicionColumna++);//-1,-2 o -3 if(this.conFuncionalidadRelaciones) { if(this.conMaximoRelaciones && this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { if(iUltimaColumna>1) { iUltimaColumna--; } //iNuevaPosicionColumna++; //REUBICA EDITAR RELACIONES jTableDatosSubPreguntaEvaluacion.moveColumn(this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumnCount()-iUltimaColumna, iNuevaPosicionColumna++);//-1 } } //REUBICABA SELECCIONAR /* if(iUltimaColumna>1) { iUltimaColumna--; } //iNuevaPosicionColumna++; //REUBICA SELECCIONAR FILA CHECK jTableDatosSubPreguntaEvaluacion.moveColumn(this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumnCount()-iUltimaColumna, iNuevaPosicionColumna++);//-1 */ //DEFINEN HEADERS final TableCellRenderer tableHeaderDefaultCellRenderer = this.jTableDatosSubPreguntaEvaluacion.getTableHeader().getDefaultRenderer(); this.jTableDatosSubPreguntaEvaluacion.getTableHeader().setDefaultRenderer(new TableCellRendererHeader(this.jTableDatosSubPreguntaEvaluacion,tableHeaderDefaultCellRenderer)); TableColumn column=null; if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL_TABLA) { for(int i = 0; i < this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumnCount(); i++) { column = this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(i); if(column.getIdentifier()!=null) { //SI SE UTILIZA UN HEADER ES GENERICO //column.setHeaderRenderer(new HeaderRenderer(column.getIdentifier().toString())); } if(column.getIdentifier()!=null && column.getIdentifier().equals(Constantes2.S_ELI)) { continue; } if(column.getIdentifier()!=null && column.getIdentifier().equals(Constantes2.S_SELECCIONAR)) { if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL_TABLA) { column.setPreferredWidth(50); column.setWidth(50); column.setMinWidth(50); column.setMaxWidth(50); this.iWidthTableDefinicion+=50; } } else { if(!SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL_TABLA) { column.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); column.setWidth(Constantes.ISWING_ANCHO_COLUMNA); column.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); column.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; } } } } this.jTableDatosSubPreguntaEvaluacion.setSelectionBackground(FuncionesSwing.getColorSelectedBackground()); this.jTableDatosSubPreguntaEvaluacion.setSelectionForeground(FuncionesSwing.getColorSelectedForeground()); /* this.jTableDatosSubPreguntaEvaluacion.setDefaultRenderer(Object.class, new DefaultTableCellRenderer() { private static final long serialVersionUID = 1L; @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { final Component component= super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); //POR DEFECTO ES MEJOR, SE PIERDE DATOS AL SELECCIONAR BLANCO LETRAS BLANCAS component.setBackground(row % 2 == 0 ? FuncionesSwing.getColorTextFields(Constantes2.S_FONDOCONTROL_COLOR) : Funciones2.getColorFilaTabla2()); //FuncionesSwing.getColorTextFields(Constantes2.S_FONDOCONTROL_COLOR) component.setForeground(Funciones2.getColorTextoFilaTabla1()); try { int iSize=-999; if(conTotales) { //FILA TOTALES OTRO COLOR, SI TABLA NO ES UNO A UNO if(Constantes.ISUSAEJBLOGICLAYER) { iSize=subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().size()-1; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { iSize=subpreguntaevaluacions.size()-1; } if(iSize==row) { component.setBackground(Funciones2.getColorFilaTablaTotales()); } } //POR EFICIENCIA NO UTILIZAR //if (component instanceof JComponent) { // JComponent jcomponent = (JComponent) component; //} } catch (Exception e) { e.printStackTrace(); } return component; } }); */ //ESTA EN LA DEFINICION DE LA TABLA //this.jTableDatosSubPreguntaEvaluacion.setRowHeight(Constantes.ISWING_ALTO_FILA_TABLA); /* column=this.jTableDatosSubPreguntaEvaluacion.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSistema,Constantes2.S_SELECCIONAR)); if(column!=null) { column.setPreferredWidth(25); column.setWidth(25); column.setMinWidth(25); } */ //CopyTableToTableTotal(); } else { this.actualizarVisualTableDatosSubPreguntaEvaluacion(); } } /* //COPY_TABLES /* FALTARIA RESOLVER: 1 SOLO SCROLL PARA 2 TABLAS COPIA EXACTA DE COLUMNAS DE UNA TABLA A OTRA, SI SE MODIFICA TAMANIO TAMBIEN LA OTRA */ public void jButtonIdActionPerformed(ActionEvent evt,int rowIndex,Boolean esRelaciones,Boolean esEliminar) { try { if(!esEliminar) { this.estaModoSeleccionar=true; //this.isEsNuevoSubPreguntaEvaluacion=false; SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.FORM,EventoTipo.LOAD,EventoSubTipo.SELECTED,"FORM",this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { this.dStart=(double)System.currentTimeMillis(); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion==null) { this.inicializarFormDetalle(); } this.inicializarInvalidValues(); int intSelectedRow = 0; if(rowIndex>=0) { intSelectedRow=rowIndex; this.jTableDatosSubPreguntaEvaluacion.getSelectionModel().setSelectionInterval(intSelectedRow, intSelectedRow); } else { intSelectedRow=this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //PUEDE SER PARA DUPLICADO O NUEVO TABLA if(this.subpreguntaevaluacion.getsType().equals("DUPLICADO") || this.subpreguntaevaluacion.getsType().equals("NUEVO_GUARDAR_CAMBIOS")) { this.isEsNuevoSubPreguntaEvaluacion=true; } else { this.isEsNuevoSubPreguntaEvaluacion=false; } //CONTROL VERSION ANTERIOR /* if(!this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { if(this.subpreguntaevaluacion.getId()>=0 && !this.subpreguntaevaluacion.getIsNew()) { this.isEsNuevoSubPreguntaEvaluacion=false; } else { this.isEsNuevoSubPreguntaEvaluacion=true; } } else { //CONTROLAR PARA RELACIONADO } */ //ESTABLECE SI ES RELACIONADO O NO this.habilitarDeshabilitarTipoMantenimientoSubPreguntaEvaluacion(esRelaciones); this.seleccionarSubPreguntaEvaluacion(evt,null,rowIndex); //SELECCIONA ACTUAL PERO AUN NO SE HA INGRESADO AL SISTEMA //SE DESHABILITA POR GUARDAR CAMBIOS /* if(this.subpreguntaevaluacion.getId()<0) { this.isEsNuevoSubPreguntaEvaluacion=true; } */ if(!this.esParaBusquedaForeignKey) { this.modificarSubPreguntaEvaluacion(evt,rowIndex,esRelaciones); } else { this.seleccionarSubPreguntaEvaluacion(evt,rowIndex); } if(this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { this.dEnd=(double)System.currentTimeMillis(); this.dDif=this.dEnd - this.dStart; if(Constantes.ISDEVELOPING) { System.out.println("Tiempo(ms) Seleccion SubPreguntaEvaluacion: " + this.dDif); } } SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.FORM,EventoTipo.LOAD,EventoSubTipo.SELECTED,"FORM",this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); } else { this.estaModoEliminarGuardarCambios=true; this.seleccionarSubPreguntaEvaluacion(evt,null,rowIndex); if(this.permiteMantenimiento(this.subpreguntaevaluacion)) { if(this.subpreguntaevaluacion.getId()>0) { this.subpreguntaevaluacion.setIsDeleted(true); this.subpreguntaevaluacionsEliminados.add(this.subpreguntaevaluacion); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().remove(this.subpreguntaevaluacion); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacions.remove(this.subpreguntaevaluacion); } ((SubPreguntaEvaluacionModel) this.jTableDatosSubPreguntaEvaluacion.getModel()).fireTableRowsDeleted(rowIndex,rowIndex); this.actualizarFilaTotales(); this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { this.estaModoSeleccionar=false; this.estaModoEliminarGuardarCambios=false; } } public void seleccionarSubPreguntaEvaluacion(ActionEvent evt,javax.swing.event.ListSelectionEvent evt2,int rowIndex) throws Exception { try { //SI PUEDE SER NUEVO Y SELECCIONAR (PARA DUPLICAR Y NUEVO TABLA) //if(!this.isEsNuevoSubPreguntaEvaluacion) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } int intSelectedRow = 0; if(rowIndex>=0) { intSelectedRow=rowIndex; this.jTableDatosSubPreguntaEvaluacion.getSelectionModel().setSelectionInterval(intSelectedRow, intSelectedRow); } else { intSelectedRow=this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); } //CUANDO SE RECARGA TABLA TAMBIEN SE SELECCIONA PERO CON -1 POR LO QUE SE NECESITA VALIDAR ANTES if(intSelectedRow<0) { return; } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL_TABLA) { this.setVariablesObjetoActualToFormularioSubPreguntaEvaluacion(this.subpreguntaevaluacion); } //ARCHITECTURE try { //Empresa if(!this.subpreguntaevaluacionConstantesFunciones.cargarid_empresaSubPreguntaEvaluacion || this.subpreguntaevaluacionConstantesFunciones.event_dependid_empresaSubPreguntaEvaluacion) { //this.cargarCombosEmpresasForeignKeyLista(" where id="+this.subpreguntaevaluacion.getid_empresa()); //this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); this.empresasForeignKey=new ArrayList<Empresa>(); if(subpreguntaevaluacion.getEmpresa()!=null) { this.empresasForeignKey.add(subpreguntaevaluacion.getEmpresa()); } this.addItemDefectoCombosForeignKeyEmpresa(); this.cargarCombosFrameEmpresasForeignKey("Todos"); } this.setActualEmpresaForeignKey(this.subpreguntaevaluacion.getid_empresa(),false,"Formulario"); //Sucursal if(!this.subpreguntaevaluacionConstantesFunciones.cargarid_sucursalSubPreguntaEvaluacion || this.subpreguntaevaluacionConstantesFunciones.event_dependid_sucursalSubPreguntaEvaluacion) { //this.cargarCombosSucursalsForeignKeyLista(" where id="+this.subpreguntaevaluacion.getid_sucursal()); //this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); this.sucursalsForeignKey=new ArrayList<Sucursal>(); if(subpreguntaevaluacion.getSucursal()!=null) { this.sucursalsForeignKey.add(subpreguntaevaluacion.getSucursal()); } this.addItemDefectoCombosForeignKeySucursal(); this.cargarCombosFrameSucursalsForeignKey("Todos"); } this.setActualSucursalForeignKey(this.subpreguntaevaluacion.getid_sucursal(),false,"Formulario"); //PreguntaEvaluacion if(!this.subpreguntaevaluacionConstantesFunciones.cargarid_pregunta_evaluacionSubPreguntaEvaluacion || this.subpreguntaevaluacionConstantesFunciones.event_dependid_pregunta_evaluacionSubPreguntaEvaluacion) { //this.cargarCombosPreguntaEvaluacionsForeignKeyLista(" where id="+this.subpreguntaevaluacion.getid_pregunta_evaluacion()); //this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); this.preguntaevaluacionsForeignKey=new ArrayList<PreguntaEvaluacion>(); if(subpreguntaevaluacion.getPreguntaEvaluacion()!=null) { this.preguntaevaluacionsForeignKey.add(subpreguntaevaluacion.getPreguntaEvaluacion()); } this.addItemDefectoCombosForeignKeyPreguntaEvaluacion(); this.cargarCombosFramePreguntaEvaluacionsForeignKey("Todos"); } this.setActualPreguntaEvaluacionForeignKey(this.subpreguntaevaluacion.getid_pregunta_evaluacion(),false,"Formulario"); //Ejercicio if(!this.subpreguntaevaluacionConstantesFunciones.cargarid_ejercicioSubPreguntaEvaluacion || this.subpreguntaevaluacionConstantesFunciones.event_dependid_ejercicioSubPreguntaEvaluacion) { //this.cargarCombosEjerciciosForeignKeyLista(" where id="+this.subpreguntaevaluacion.getid_ejercicio()); //this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); this.ejerciciosForeignKey=new ArrayList<Ejercicio>(); if(subpreguntaevaluacion.getEjercicio()!=null) { this.ejerciciosForeignKey.add(subpreguntaevaluacion.getEjercicio()); } this.addItemDefectoCombosForeignKeyEjercicio(); this.cargarCombosFrameEjerciciosForeignKey("Todos"); } this.setActualEjercicioForeignKey(this.subpreguntaevaluacion.getid_ejercicio(),false,"Formulario"); //Periodo if(!this.subpreguntaevaluacionConstantesFunciones.cargarid_periodoSubPreguntaEvaluacion || this.subpreguntaevaluacionConstantesFunciones.event_dependid_periodoSubPreguntaEvaluacion) { //this.cargarCombosPeriodosForeignKeyLista(" where id="+this.subpreguntaevaluacion.getid_periodo()); //this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); this.periodosForeignKey=new ArrayList<Periodo>(); if(subpreguntaevaluacion.getPeriodo()!=null) { this.periodosForeignKey.add(subpreguntaevaluacion.getPeriodo()); } this.addItemDefectoCombosForeignKeyPeriodo(); this.cargarCombosFramePeriodosForeignKey("Todos"); } this.setActualPeriodoForeignKey(this.subpreguntaevaluacion.getid_periodo(),false,"Formulario"); } catch(Exception e) { throw e; } this.actualizarEstadoCeldasBotonesSubPreguntaEvaluacion("s", this.isGuardarCambiosEnLote, this.isEsMantenimientoRelacionado); //NO FUNCIONA BINDING PERO SE MANTIENE this.inicializarActualizarBindingBotonesSubPreguntaEvaluacion(false) ; //SI ES MANUAL //this.inicializarActualizarBindingBotonesManualSubPreguntaEvaluacion() ; //} } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void setVariablesObjetoActualToFormularioTodoSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion) throws Exception { this.setVariablesObjetoActualToFormularioTodoSubPreguntaEvaluacion(subpreguntaevaluacion,false,"NINGUNO"); } public void setVariablesObjetoActualToFormularioTodoSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion,Boolean conCargarListasDesdeObjetoActual,String sTipoEvento) throws Exception { this.setVariablesObjetoActualToFormularioSubPreguntaEvaluacion(subpreguntaevaluacion); if(conCargarListasDesdeObjetoActual) { this.setVariablesObjetoActualToListasForeignKeySubPreguntaEvaluacion(subpreguntaevaluacion,sTipoEvento); } this.setVariablesObjetoActualToFormularioForeignKeySubPreguntaEvaluacion(subpreguntaevaluacion); } public void setVariablesObjetoActualToFormularioSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion) throws Exception { try { Image imageActual=null; ImageIcon imageIcon = null; if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelidSubPreguntaEvaluacion.setText(subpreguntaevaluacion.getId().toString()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldordenSubPreguntaEvaluacion.setText(subpreguntaevaluacion.getorden().toString()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextAreapreguntaSubPreguntaEvaluacion.setText(subpreguntaevaluacion.getpregunta()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldporcentaje_siSubPreguntaEvaluacion.setText(subpreguntaevaluacion.getporcentaje_si().toString()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_facturaSubPreguntaEvaluacion.setSelected(subpreguntaevaluacion.getcon_factura()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_orden_compraSubPreguntaEvaluacion.setSelected(subpreguntaevaluacion.getcon_orden_compra()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_completoSubPreguntaEvaluacion.setSelected(subpreguntaevaluacion.getcon_completo()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_a_tiempoSubPreguntaEvaluacion.setSelected(subpreguntaevaluacion.getcon_a_tiempo()); } catch(Exception e) { throw e; //FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void actualizarInformacion(String sTipo,SubPreguntaEvaluacion subpreguntaevaluacionLocal) throws Exception { this.actualizarInformacion(sTipo,false,subpreguntaevaluacionLocal); } public void actualizarInformacion(String sTipo,Boolean conParametroObjeto,SubPreguntaEvaluacion subpreguntaevaluacionLocal) throws Exception { if(!conParametroObjeto) { if(!this.getEsControlTabla()) { subpreguntaevaluacionLocal=this.subpreguntaevaluacion; } else { subpreguntaevaluacionLocal=this.subpreguntaevaluacionAnterior; } } if(this.permiteMantenimiento(subpreguntaevaluacionLocal)) { if(sTipo.equals("EVENTO_CONTROL")) { // || sTipo.equals("EVENTO_NUEVO") if(!this.esControlTabla) { this.setVariablesFormularioToObjetoActualTodoSubPreguntaEvaluacion(subpreguntaevaluacionLocal,true); if(subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { this.actualizarRelaciones(subpreguntaevaluacionLocal); } } } else if(sTipo.equals("INFO_PADRE")) { if(this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { this.actualizarRelacionFkPadreActual(subpreguntaevaluacionLocal); } } } } public void setVariablesFormularioToObjetoActualTodoSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion,Boolean conColumnasBase) throws Exception { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(subpreguntaevaluacion,conColumnasBase); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(subpreguntaevaluacion); } public void setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion,Boolean conColumnasBase) throws Exception { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(subpreguntaevaluacion,conColumnasBase,true); } public void setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion,Boolean conColumnasBase,Boolean conInicializarInvalidValues) throws Exception { String sMensajeCampoActual=""; Boolean estaValidado=true; try { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } if(conInicializarInvalidValues) { this.inicializarInvalidValues(); } try { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelidSubPreguntaEvaluacion.getText()==null || this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelidSubPreguntaEvaluacion.getText()=="" || this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelidSubPreguntaEvaluacion.getText()=="Id") { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelidSubPreguntaEvaluacion.setText("0"); } if(conColumnasBase) {subpreguntaevaluacion.setId(Long.parseLong(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelidSubPreguntaEvaluacion.getText()));} } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+SubPreguntaEvaluacionConstantesFunciones.LABEL_ID+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelIdSubPreguntaEvaluacion,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } try { subpreguntaevaluacion.setorden(Integer.parseInt(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldordenSubPreguntaEvaluacion.getText())); } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelordenSubPreguntaEvaluacion,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } try { subpreguntaevaluacion.setpregunta(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextAreapreguntaSubPreguntaEvaluacion.getText()); } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelpreguntaSubPreguntaEvaluacion,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } try { subpreguntaevaluacion.setporcentaje_si(Double.parseDouble(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldporcentaje_siSubPreguntaEvaluacion.getText())); } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelporcentaje_siSubPreguntaEvaluacion,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } try { subpreguntaevaluacion.setcon_factura(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_facturaSubPreguntaEvaluacion.isSelected()); } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelcon_facturaSubPreguntaEvaluacion,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } try { subpreguntaevaluacion.setcon_orden_compra(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_orden_compraSubPreguntaEvaluacion.isSelected()); } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelcon_orden_compraSubPreguntaEvaluacion,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } try { subpreguntaevaluacion.setcon_completo(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_completoSubPreguntaEvaluacion.isSelected()); } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelcon_completoSubPreguntaEvaluacion,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } try { subpreguntaevaluacion.setcon_a_tiempo(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_a_tiempoSubPreguntaEvaluacion.isSelected()); } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelcon_a_tiempoSubPreguntaEvaluacion,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } if(!estaValidado) { throw new Exception(sMensajeCampoActual); } } catch(NumberFormatException e) { throw new Exception(sMensajeCampoActual); //FuncionesSwing.manageException(this, e,logger,MovimientoInventarioConstantesFunciones.CLASSNAME); } catch(Exception e) { throw e; //FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void setVariablesForeignKeyObjetoBeanDefectoActualToObjetoActualSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacionBean,SubPreguntaEvaluacion subpreguntaevaluacion,Boolean conDefault,Boolean conColumnasBase) throws Exception { try { if(conDefault || (!conDefault && subpreguntaevaluacionBean.getid_pregunta_evaluacion()!=null && !subpreguntaevaluacionBean.getid_pregunta_evaluacion().equals(-1L))) {subpreguntaevaluacion.setid_pregunta_evaluacion(subpreguntaevaluacionBean.getid_pregunta_evaluacion());} } catch(Exception e) { throw e; //FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void setCopiarVariablesObjetosSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacionOrigen,SubPreguntaEvaluacion subpreguntaevaluacion,Boolean conDefault,Boolean conColumnasBase) throws Exception { try { if(conColumnasBase) {if(conDefault || (!conDefault && subpreguntaevaluacionOrigen.getId()!=null && !subpreguntaevaluacionOrigen.getId().equals(0L))) {subpreguntaevaluacion.setId(subpreguntaevaluacionOrigen.getId());}} if(conDefault || (!conDefault && subpreguntaevaluacionOrigen.getid_pregunta_evaluacion()!=null && !subpreguntaevaluacionOrigen.getid_pregunta_evaluacion().equals(-1L))) {subpreguntaevaluacion.setid_pregunta_evaluacion(subpreguntaevaluacionOrigen.getid_pregunta_evaluacion());} if(conDefault || (!conDefault && subpreguntaevaluacionOrigen.getorden()!=null && !subpreguntaevaluacionOrigen.getorden().equals(0))) {subpreguntaevaluacion.setorden(subpreguntaevaluacionOrigen.getorden());} if(conDefault || (!conDefault && subpreguntaevaluacionOrigen.getpregunta()!=null && !subpreguntaevaluacionOrigen.getpregunta().equals(""))) {subpreguntaevaluacion.setpregunta(subpreguntaevaluacionOrigen.getpregunta());} if(conDefault || (!conDefault && subpreguntaevaluacionOrigen.getporcentaje_si()!=null && !subpreguntaevaluacionOrigen.getporcentaje_si().equals(0.0))) {subpreguntaevaluacion.setporcentaje_si(subpreguntaevaluacionOrigen.getporcentaje_si());} if(conDefault || (!conDefault && subpreguntaevaluacionOrigen.getcon_factura()!=null && !subpreguntaevaluacionOrigen.getcon_factura().equals(false))) {subpreguntaevaluacion.setcon_factura(subpreguntaevaluacionOrigen.getcon_factura());} if(conDefault || (!conDefault && subpreguntaevaluacionOrigen.getcon_orden_compra()!=null && !subpreguntaevaluacionOrigen.getcon_orden_compra().equals(false))) {subpreguntaevaluacion.setcon_orden_compra(subpreguntaevaluacionOrigen.getcon_orden_compra());} if(conDefault || (!conDefault && subpreguntaevaluacionOrigen.getcon_completo()!=null && !subpreguntaevaluacionOrigen.getcon_completo().equals(false))) {subpreguntaevaluacion.setcon_completo(subpreguntaevaluacionOrigen.getcon_completo());} if(conDefault || (!conDefault && subpreguntaevaluacionOrigen.getcon_a_tiempo()!=null && !subpreguntaevaluacionOrigen.getcon_a_tiempo().equals(false))) {subpreguntaevaluacion.setcon_a_tiempo(subpreguntaevaluacionOrigen.getcon_a_tiempo());} } catch(Exception e) { throw e; //FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } /* public void setVariablesObjetoBeanActualToFormularioSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion) throws Exception { try { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelidSubPreguntaEvaluacion.setText(subpreguntaevaluacion.getId().toString()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldordenSubPreguntaEvaluacion.setText(subpreguntaevaluacion.getorden().toString()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextAreapreguntaSubPreguntaEvaluacion.setText(subpreguntaevaluacion.getpregunta()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldporcentaje_siSubPreguntaEvaluacion.setText(subpreguntaevaluacion.getporcentaje_si().toString()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_facturaSubPreguntaEvaluacion.setSelected(subpreguntaevaluacion.getcon_factura()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_orden_compraSubPreguntaEvaluacion.setSelected(subpreguntaevaluacion.getcon_orden_compra()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_completoSubPreguntaEvaluacion.setSelected(subpreguntaevaluacion.getcon_completo()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_a_tiempoSubPreguntaEvaluacion.setSelected(subpreguntaevaluacion.getcon_a_tiempo()); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } */ /* public void setVariablesObjetoBeanActualToFormularioSubPreguntaEvaluacion(SubPreguntaEvaluacionBean subpreguntaevaluacionBean) throws Exception { try { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelidSubPreguntaEvaluacion.setText(subpreguntaevaluacionBean.getId().toString()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldordenSubPreguntaEvaluacion.setText(subpreguntaevaluacionBean.getorden().toString()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextAreapreguntaSubPreguntaEvaluacion.setText(subpreguntaevaluacionBean.getpregunta()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldporcentaje_siSubPreguntaEvaluacion.setText(subpreguntaevaluacionBean.getporcentaje_si().toString()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_facturaSubPreguntaEvaluacion.setSelected(subpreguntaevaluacionBean.getcon_factura()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_orden_compraSubPreguntaEvaluacion.setSelected(subpreguntaevaluacionBean.getcon_orden_compra()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_completoSubPreguntaEvaluacion.setSelected(subpreguntaevaluacionBean.getcon_completo()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_a_tiempoSubPreguntaEvaluacion.setSelected(subpreguntaevaluacionBean.getcon_a_tiempo()); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } */ /* public void setVariablesObjetoReturnGeneralToBeanSubPreguntaEvaluacion(SubPreguntaEvaluacionParameterReturnGeneral subpreguntaevaluacionReturnGeneral,SubPreguntaEvaluacionBean subpreguntaevaluacionBean,Boolean conDefault) throws Exception { try { SubPreguntaEvaluacion subpreguntaevaluacionLocal=new SubPreguntaEvaluacion(); subpreguntaevaluacionLocal=subpreguntaevaluacionReturnGeneral.getSubPreguntaEvaluacion(); if(conColumnasBase) {if(conDefault || (!conDefault && subpreguntaevaluacionLocal.getId()!=null && !subpreguntaevaluacionLocal.getId().equals(0L))) {subpreguntaevaluacionBean.setId(subpreguntaevaluacionLocal.getId());}} if(conDefault || (!conDefault && subpreguntaevaluacionLocal.getid_pregunta_evaluacion()!=null && !subpreguntaevaluacionLocal.getid_pregunta_evaluacion().equals(-1L))) {subpreguntaevaluacionBean.setid_pregunta_evaluacion(subpreguntaevaluacionLocal.getid_pregunta_evaluacion());} if(conDefault || (!conDefault && subpreguntaevaluacionLocal.getorden()!=null && !subpreguntaevaluacionLocal.getorden().equals(0))) {subpreguntaevaluacionBean.setorden(subpreguntaevaluacionLocal.getorden());} if(conDefault || (!conDefault && subpreguntaevaluacionLocal.getpregunta()!=null && !subpreguntaevaluacionLocal.getpregunta().equals(""))) {subpreguntaevaluacionBean.setpregunta(subpreguntaevaluacionLocal.getpregunta());} if(conDefault || (!conDefault && subpreguntaevaluacionLocal.getporcentaje_si()!=null && !subpreguntaevaluacionLocal.getporcentaje_si().equals(0.0))) {subpreguntaevaluacionBean.setporcentaje_si(subpreguntaevaluacionLocal.getporcentaje_si());} if(conDefault || (!conDefault && subpreguntaevaluacionLocal.getcon_factura()!=null && !subpreguntaevaluacionLocal.getcon_factura().equals(false))) {subpreguntaevaluacionBean.setcon_factura(subpreguntaevaluacionLocal.getcon_factura());} if(conDefault || (!conDefault && subpreguntaevaluacionLocal.getcon_orden_compra()!=null && !subpreguntaevaluacionLocal.getcon_orden_compra().equals(false))) {subpreguntaevaluacionBean.setcon_orden_compra(subpreguntaevaluacionLocal.getcon_orden_compra());} if(conDefault || (!conDefault && subpreguntaevaluacionLocal.getcon_completo()!=null && !subpreguntaevaluacionLocal.getcon_completo().equals(false))) {subpreguntaevaluacionBean.setcon_completo(subpreguntaevaluacionLocal.getcon_completo());} if(conDefault || (!conDefault && subpreguntaevaluacionLocal.getcon_a_tiempo()!=null && !subpreguntaevaluacionLocal.getcon_a_tiempo().equals(false))) {subpreguntaevaluacionBean.setcon_a_tiempo(subpreguntaevaluacionLocal.getcon_a_tiempo());} } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } */ @SuppressWarnings("rawtypes") public static void setActualComboBoxSubPreguntaEvaluacionGenerico(Long idSubPreguntaEvaluacionSeleccionado,JComboBox jComboBoxSubPreguntaEvaluacion,List<SubPreguntaEvaluacion> subpreguntaevaluacionsLocal)throws Exception { try { SubPreguntaEvaluacion subpreguntaevaluacionTemp=null; for(SubPreguntaEvaluacion subpreguntaevaluacionAux:subpreguntaevaluacionsLocal) { if(subpreguntaevaluacionAux.getId()!=null && subpreguntaevaluacionAux.getId().equals(idSubPreguntaEvaluacionSeleccionado)) { subpreguntaevaluacionTemp=subpreguntaevaluacionAux; break; } } jComboBoxSubPreguntaEvaluacion.setSelectedItem(subpreguntaevaluacionTemp); } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public static void setHotKeysComboBoxSubPreguntaEvaluacionGenerico(JComboBox jComboBoxSubPreguntaEvaluacion,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda)throws Exception { try { //GLOBAL(id_empresa,id_sucursal,id_ejercicio) //BASICO(normal) //CON_BUSQUEDA(Permite buscar Fk) String sKeyStrokeName=""; KeyStroke keyStrokeControl=null; if(!sTipoBusqueda.equals("GLOBAL")) { //BUSCAR sKeyStrokeName = FuncionesSwing.getKeyNameControl("CONTROL_BUSCAR"); keyStrokeControl=FuncionesSwing.getKeyStrokeControl("CONTROL_BUSCAR"); jComboBoxSubPreguntaEvaluacion.getInputMap().put(keyStrokeControl, sKeyStrokeName); jComboBoxSubPreguntaEvaluacion.getActionMap().put(sKeyStrokeName, new ButtonAbstractAction(jInternalFrameBase,sNombreHotKeyAbstractAction+"Busqueda")); //BUSCAR //ACTUALIZAR sKeyStrokeName = FuncionesSwing.getKeyNameControl("CONTROL_ACTUALIZAR"); keyStrokeControl=FuncionesSwing.getKeyStrokeControl("CONTROL_ACTUALIZAR"); jComboBoxSubPreguntaEvaluacion.getInputMap().put(keyStrokeControl, sKeyStrokeName); jComboBoxSubPreguntaEvaluacion.getActionMap().put(sKeyStrokeName, new ButtonAbstractAction(jInternalFrameBase,sNombreHotKeyAbstractAction+"Update")); //ACTUALIZAR if(sTipoBusqueda.contains("CON_EVENT_CHANGE")) { if(Constantes2.CON_COMBOBOX_ITEMLISTENER) { jComboBoxSubPreguntaEvaluacion.addFocusListener(new ComboBoxFocusListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); jComboBoxSubPreguntaEvaluacion.addActionListener(new ComboBoxActionListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } /* if(Constantes2.CON_COMBOBOX_ITEMLISTENER) { jComboBoxSubPreguntaEvaluacion.addItemListener(new ComboBoxItemListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } else { jComboBoxSubPreguntaEvaluacion.addActionListener(new ComboBoxActionListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } */ } //CON_BUSQUEDA if(sTipoBusqueda.contains("CON_BUSQUEDA")) { sKeyStrokeName = FuncionesSwing.getKeyNameControl("CONTROL_BUSQUEDA"); keyStrokeControl=FuncionesSwing.getKeyStrokeControl("CONTROL_BUSQUEDA"); jComboBoxSubPreguntaEvaluacion.getInputMap().put(keyStrokeControl, sKeyStrokeName); jComboBoxSubPreguntaEvaluacion.getActionMap().put(sKeyStrokeName, new ButtonAbstractAction(jInternalFrameBase,sNombreHotKeyAbstractAction)); } //CON_BUSQUEDA } } catch(Exception e) { throw e; } } //PARA INICIALIZAR CONTROLES DE TABLA @SuppressWarnings("rawtypes") public void setHotKeysComboBoxGenerico(JComboBox jComboBox,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda) { if(sTipoBusqueda.contains("CON_EVENT_CHANGE")) { if(Constantes2.CON_COMBOBOX_ITEMLISTENER) { jComboBox.addItemListener(new ComboBoxItemListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); jComboBox.addFocusListener(new ComboBoxFocusListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } else { jComboBox.addActionListener(new ComboBoxActionListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); jComboBox.addFocusListener(new ComboBoxFocusListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } } } //PARA INICIALIZAR CONTROLES DE TABLA public void setHotKeysJTextFieldGenerico(JTextField jTextField,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda) { jTextField.addFocusListener(new TextFieldFocusListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); jTextField.addActionListener(new TextFieldActionListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } //PARA INICIALIZAR CONTROLES DE TABLA public void setHotKeysJTextAreaGenerico(JTextArea jTextArea,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda) { jTextArea.addFocusListener(new TextAreaFocusListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); //NO EXISTE //jTextArea.addActionListener(new TextAreaActionListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } //PARA INICIALIZAR CONTROLES DE TABLA public void setHotKeysJLabelGenerico(JLabel jLabel,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda) { jLabel.addFocusListener(new LabelFocusListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); //NO EXISTE //jLabel.addActionListener(new LabelActionListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } //PARA INICIALIZAR CONTROLES DE TABLA public void setHotKeysJCheckBoxGenerico(JCheckBox jCheckBox,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda) { jCheckBox.addFocusListener(new CheckBoxFocusListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); //SI SE DEFINE AL CAMBIAR VALOR, ESTE NUEVO VALOR NO SE ENVIA AL EVENTO //jCheckBox.addItemListener(new CheckBoxItemListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } //PARA INICIALIZAR CONTROLES DE TABLA public void setHotKeysJDateChooserGenerico(JDateChooser jDateChooser,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda) { FuncionesSwing.addDateListener(jDateChooser, jInternalFrameBase, sNombreHotKeyAbstractAction); } //PARA INICIALIZAR CONTROLES DE TABLA public void setHotKeysJButtonGenerico(JButton jButton,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda) { jButton.addActionListener(new ButtonActionListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } public void jButtonRelacionActionPerformed(String sTipo,ActionEvent evt,int rowIndex,Boolean conInicializar,Boolean esRelacionado) { //ABRIR RELACIONES try { if(sTipo.equals("DetalleEvaluacionProveedor")) { jButtonDetalleEvaluacionProveedorActionPerformed(evt,rowIndex,true,false,null); } } catch (Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public String getDescripcionFk(String sTipo,JTable table,Object value,int intSelectedRow) throws Exception { //DESCRIPCIONES FK String sDescripcion=""; if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacion=(SubPreguntaEvaluacion) subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[table.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE) { subpreguntaevaluacion =(SubPreguntaEvaluacion) subpreguntaevaluacions.toArray()[table.convertRowIndexToModel(intSelectedRow)]; } if(sTipo.equals("Empresa")) { //sDescripcion=this.getActualEmpresaForeignKeyDescripcion((Long)value); if(!subpreguntaevaluacion.getIsNew() && !subpreguntaevaluacion.getIsChanged() && !subpreguntaevaluacion.getIsDeleted()) { sDescripcion=subpreguntaevaluacion.getempresa_descripcion(); } else { //sDescripcion=this.getActualEmpresaForeignKeyDescripcion((Long)value); sDescripcion=subpreguntaevaluacion.getempresa_descripcion(); } } if(sTipo.equals("Sucursal")) { //sDescripcion=this.getActualSucursalForeignKeyDescripcion((Long)value); if(!subpreguntaevaluacion.getIsNew() && !subpreguntaevaluacion.getIsChanged() && !subpreguntaevaluacion.getIsDeleted()) { sDescripcion=subpreguntaevaluacion.getsucursal_descripcion(); } else { //sDescripcion=this.getActualSucursalForeignKeyDescripcion((Long)value); sDescripcion=subpreguntaevaluacion.getsucursal_descripcion(); } } if(sTipo.equals("PreguntaEvaluacion")) { //sDescripcion=this.getActualPreguntaEvaluacionForeignKeyDescripcion((Long)value); if(!subpreguntaevaluacion.getIsNew() && !subpreguntaevaluacion.getIsChanged() && !subpreguntaevaluacion.getIsDeleted()) { sDescripcion=subpreguntaevaluacion.getpreguntaevaluacion_descripcion(); } else { //sDescripcion=this.getActualPreguntaEvaluacionForeignKeyDescripcion((Long)value); sDescripcion=subpreguntaevaluacion.getpreguntaevaluacion_descripcion(); } } if(sTipo.equals("Ejercicio")) { //sDescripcion=this.getActualEjercicioForeignKeyDescripcion((Long)value); if(!subpreguntaevaluacion.getIsNew() && !subpreguntaevaluacion.getIsChanged() && !subpreguntaevaluacion.getIsDeleted()) { sDescripcion=subpreguntaevaluacion.getejercicio_descripcion(); } else { //sDescripcion=this.getActualEjercicioForeignKeyDescripcion((Long)value); sDescripcion=subpreguntaevaluacion.getejercicio_descripcion(); } } if(sTipo.equals("Periodo")) { //sDescripcion=this.getActualPeriodoForeignKeyDescripcion((Long)value); if(!subpreguntaevaluacion.getIsNew() && !subpreguntaevaluacion.getIsChanged() && !subpreguntaevaluacion.getIsDeleted()) { sDescripcion=subpreguntaevaluacion.getperiodo_descripcion(); } else { //sDescripcion=this.getActualPeriodoForeignKeyDescripcion((Long)value); sDescripcion=subpreguntaevaluacion.getperiodo_descripcion(); } } return sDescripcion; } public Color getColorFk(String sTipo,JTable table,Object value,int intSelectedRow) throws Exception { //DESCRIPCIONES FK Color color=Color.WHITE; SubPreguntaEvaluacion subpreguntaevaluacionRow=new SubPreguntaEvaluacion(); if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionRow=(SubPreguntaEvaluacion) subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[table.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE) { subpreguntaevaluacionRow=(SubPreguntaEvaluacion) subpreguntaevaluacions.toArray()[table.convertRowIndexToModel(intSelectedRow)]; } return color; } public void jButtonDetalleEvaluacionProveedorActionPerformed(ActionEvent evt,int rowIndex,Boolean conInicializar,Boolean esRelacionado,SubPreguntaEvaluacion subpreguntaevaluacion) throws Exception { try { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion==null) { this.inicializarFormDetalle(); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } int intSelectedRow =rowIndex; if(intSelectedRow!=-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion = (SubPreguntaEvaluacion)this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE) { this.subpreguntaevaluacion = (SubPreguntaEvaluacion)this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE } else { if(subpreguntaevaluacion!=null) { this.subpreguntaevaluacion = subpreguntaevaluacion; } else { this.subpreguntaevaluacion = new SubPreguntaEvaluacion(); } } if(this.isTienePermisosDetalleEvaluacionProveedor && this.permiteMantenimiento(this.subpreguntaevaluacion)) { DetalleEvaluacionProveedorBeanSwingJInternalFrame detalleevaluacionproveedorBeanSwingJInternalFrame=null; if(conInicializar) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFramePopup=new DetalleEvaluacionProveedorBeanSwingJInternalFrame(false,false,this.jDesktopPane,this.usuarioActual,this.resumenUsuarioActual,this.moduloActual,this.opcionActual,this.parametroGeneralSg,this.parametroGeneralUsuario,PaginaTipo.SECUNDARIO,false,false,true,false); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFramePopup.setJInternalFrameParent(this); detalleevaluacionproveedorBeanSwingJInternalFrame=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFramePopup; } else { detalleevaluacionproveedorBeanSwingJInternalFrame=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame; } List<SubPreguntaEvaluacion> subpreguntaevaluacions=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacions.add(this.subpreguntaevaluacion); if(!esRelacionado) { //detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorSessionBean.setConGuardarRelaciones(false); //detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorSessionBean.setEsGuardarRelacionado(false); } //DESHABILITA TEMPORALMENTE EVENTOS CHANGE DE TEXTOS,COMBOS,ETC detalleevaluacionproveedorBeanSwingJInternalFrame.estaModoSeleccionar=true; this.jInternalFrameDetalleFormSubPreguntaEvaluacion.cargarDetalleEvaluacionProveedorBeanSwingJInternalFrame(subpreguntaevaluacions,this.subpreguntaevaluacion,detalleevaluacionproveedorBeanSwingJInternalFrame,/*conInicializar,*/detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorSessionBean.getConGuardarRelaciones(),detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorSessionBean.getEsGuardarRelacionado()); detalleevaluacionproveedorBeanSwingJInternalFrame.estaModoSeleccionar=false; if(!esRelacionado) { detalleevaluacionproveedorBeanSwingJInternalFrame.actualizarEstadoPanelsDetalleEvaluacionProveedor("no_relacionado"); detalleevaluacionproveedorBeanSwingJInternalFrame.redimensionarTablaDatosConTamanio(DetalleEvaluacionProveedorConstantesFunciones.ITAMANIOFILATABLA + (DetalleEvaluacionProveedorConstantesFunciones.ITAMANIOFILATABLA/2)); detalleevaluacionproveedorBeanSwingJInternalFrame.setLocation(xOffset*(openFrameCount + Constantes.INUM_MAX_VENTANAS_REL_X), yOffset*(openFrameCount+Constantes.INUM_MAX_VENTANAS_REL_Y)); TitledBorder titledBorderSubPreguntaEvaluacion=(TitledBorder)this.jScrollPanelDatosSubPreguntaEvaluacion.getBorder(); TitledBorder titledBorderDetalleEvaluacionProveedor=(TitledBorder)detalleevaluacionproveedorBeanSwingJInternalFrame.jScrollPanelDatosDetalleEvaluacionProveedor.getBorder(); titledBorderDetalleEvaluacionProveedor.setTitle(titledBorderSubPreguntaEvaluacion.getTitle() + " -> Detalle Evaluacion Proveedor"); if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,detalleevaluacionproveedorBeanSwingJInternalFrame); } detalleevaluacionproveedorBeanSwingJInternalFrame.setVisible(true); this.jDesktopPane.add(detalleevaluacionproveedorBeanSwingJInternalFrame); detalleevaluacionproveedorBeanSwingJInternalFrame.setSelected(true); } } else { if(!this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { JOptionPane.showMessageDialog(this,"NO TIENE PERMISOS PARA USAR LA FUNCIONALIDAD DE Detalle Evaluacion Proveedor",Constantes.SERROR,JOptionPane.ERROR_MESSAGE); } } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void refrescarBindingTabla(Boolean blnSoloTabla) { } public void inicializarActualizarBindingBotonesManualSubPreguntaEvaluacion(Boolean esSetControles) { if(esSetControles) { this.jButtonNuevoSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion && this.isPermisoNuevoSubPreguntaEvaluacion)); this.jButtonDuplicarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaDuplicarSubPreguntaEvaluacion && this.isPermisoDuplicarSubPreguntaEvaluacion)); this.jButtonCopiarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaCopiarSubPreguntaEvaluacion && this.isPermisoCopiarSubPreguntaEvaluacion)); this.jButtonVerFormSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaVerFormSubPreguntaEvaluacion && this.isPermisoVerFormSubPreguntaEvaluacion)); this.jButtonAbrirOrderBySubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaOrdenSubPreguntaEvaluacion && this.isPermisoOrdenSubPreguntaEvaluacion)); this.jButtonNuevoRelacionesSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion && this.isPermisoNuevoSubPreguntaEvaluacion)); this.jButtonNuevoGuardarCambiosSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion && this.isPermisoNuevoSubPreguntaEvaluacion && this.isPermisoGuardarCambiosSubPreguntaEvaluacion)); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonModificarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaModificarSubPreguntaEvaluacion && this.isPermisoActualizarSubPreguntaEvaluacion)); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonActualizarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion && this.isPermisoActualizarSubPreguntaEvaluacion)); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonEliminarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion && this.isPermisoEliminarSubPreguntaEvaluacion)); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonCancelarSubPreguntaEvaluacion.setVisible(this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonGuardarCambiosSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion && this.isPermisoGuardarCambiosSubPreguntaEvaluacion)); } this.jButtonGuardarCambiosTablaSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion && this.isPermisoGuardarCambiosSubPreguntaEvaluacion)); //TOOLBAR this.jButtonNuevoToolBarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion && this.isPermisoNuevoSubPreguntaEvaluacion)); this.jButtonDuplicarToolBarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaDuplicarSubPreguntaEvaluacion && this.isPermisoDuplicarSubPreguntaEvaluacion)); this.jButtonCopiarToolBarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaCopiarSubPreguntaEvaluacion && this.isPermisoCopiarSubPreguntaEvaluacion)); this.jButtonVerFormToolBarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaVerFormSubPreguntaEvaluacion && this.isPermisoVerFormSubPreguntaEvaluacion)); this.jButtonAbrirOrderByToolBarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaOrdenSubPreguntaEvaluacion && this.isPermisoOrdenSubPreguntaEvaluacion)); this.jButtonNuevoRelacionesToolBarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion && this.isPermisoNuevoSubPreguntaEvaluacion)); this.jButtonNuevoGuardarCambiosToolBarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion && this.isPermisoNuevoSubPreguntaEvaluacion && this.isPermisoGuardarCambiosSubPreguntaEvaluacion)); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonModificarToolBarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaModificarSubPreguntaEvaluacion && this.isPermisoActualizarSubPreguntaEvaluacion)); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonActualizarToolBarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion && this.isPermisoActualizarSubPreguntaEvaluacion)); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonEliminarToolBarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion && this.isPermisoEliminarSubPreguntaEvaluacion)); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonCancelarToolBarSubPreguntaEvaluacion.setVisible(this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonGuardarCambiosToolBarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion && this.isPermisoGuardarCambiosSubPreguntaEvaluacion)); } this.jButtonGuardarCambiosTablaToolBarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion && this.isPermisoGuardarCambiosSubPreguntaEvaluacion)); //TOOLBAR //MENUS this.jMenuItemNuevoSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion && this.isPermisoNuevoSubPreguntaEvaluacion)); this.jMenuItemDuplicarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaDuplicarSubPreguntaEvaluacion && this.isPermisoDuplicarSubPreguntaEvaluacion)); this.jMenuItemCopiarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaCopiarSubPreguntaEvaluacion && this.isPermisoCopiarSubPreguntaEvaluacion)); this.jMenuItemVerFormSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaVerFormSubPreguntaEvaluacion && this.isPermisoVerFormSubPreguntaEvaluacion)); this.jMenuItemAbrirOrderBySubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaOrdenSubPreguntaEvaluacion && this.isPermisoOrdenSubPreguntaEvaluacion)); //this.jMenuItemMostrarOcultarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaOrdenSubPreguntaEvaluacion && this.isPermisoOrdenSubPreguntaEvaluacion)); this.jMenuItemDetalleAbrirOrderBySubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaOrdenSubPreguntaEvaluacion && this.isPermisoOrdenSubPreguntaEvaluacion)); //this.jMenuItemDetalleMostrarOcultarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaOrdenSubPreguntaEvaluacion && this.isPermisoOrdenSubPreguntaEvaluacion)); this.jMenuItemNuevoRelacionesSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion && this.isPermisoNuevoSubPreguntaEvaluacion)); this.jMenuItemNuevoGuardarCambiosSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion && this.isPermisoNuevoSubPreguntaEvaluacion && this.isPermisoGuardarCambiosSubPreguntaEvaluacion)); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemModificarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaModificarSubPreguntaEvaluacion && this.isPermisoActualizarSubPreguntaEvaluacion)); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemActualizarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion && this.isPermisoActualizarSubPreguntaEvaluacion)); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemEliminarSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion && this.isPermisoEliminarSubPreguntaEvaluacion)); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemCancelarSubPreguntaEvaluacion.setVisible(this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion); } this.jMenuItemGuardarCambiosSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion && this.isPermisoGuardarCambiosSubPreguntaEvaluacion)); this.jMenuItemGuardarCambiosTablaSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion && this.isPermisoGuardarCambiosSubPreguntaEvaluacion)); //MENUS } else { this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion=this.jButtonNuevoSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaDuplicarSubPreguntaEvaluacion=this.jButtonDuplicarSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaCopiarSubPreguntaEvaluacion=this.jButtonCopiarSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaVerFormSubPreguntaEvaluacion=this.jButtonVerFormSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaOrdenSubPreguntaEvaluacion=this.jButtonAbrirOrderBySubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=this.jButtonNuevoRelacionesSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaModificarSubPreguntaEvaluacion=this.jButtonModificarSubPreguntaEvaluacion.isVisible(); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonActualizarSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonEliminarSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonCancelarSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonGuardarCambiosSubPreguntaEvaluacion.isVisible(); } this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=this.jButtonGuardarCambiosTablaSubPreguntaEvaluacion.isVisible(); //TOOLBAR this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion=this.jButtonNuevoToolBarSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=this.jButtonNuevoRelacionesToolBarSubPreguntaEvaluacion.isVisible(); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.isVisibilidadCeldaModificarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonModificarToolBarSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonActualizarToolBarSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonEliminarToolBarSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonCancelarToolBarSubPreguntaEvaluacion.isVisible(); } this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=this.jButtonGuardarCambiosToolBarSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=this.jButtonGuardarCambiosTablaToolBarSubPreguntaEvaluacion.isVisible(); //TOOLBAR //MENUS this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion=this.jMenuItemNuevoSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=this.jMenuItemNuevoRelacionesSubPreguntaEvaluacion.isVisible(); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.isVisibilidadCeldaModificarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemModificarSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemActualizarSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemEliminarSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemCancelarSubPreguntaEvaluacion.isVisible(); } this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=this.jMenuItemGuardarCambiosSubPreguntaEvaluacion.isVisible(); this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=this.jMenuItemGuardarCambiosTablaSubPreguntaEvaluacion.isVisible(); //MENUS } } public void inicializarActualizarBindingBotonesSubPreguntaEvaluacion(Boolean esInicializar) { if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { if(this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { //if(this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { this.actualizarEstadoCeldasBotonesConGuardarRelacionesSubPreguntaEvaluacion(); } this.inicializarActualizarBindingBotonesManualSubPreguntaEvaluacion(true); } else { } } public void inicializarActualizarBindingBotonesPermisosManualSubPreguntaEvaluacion() { this.jButtonNuevoSubPreguntaEvaluacion.setVisible(this.isPermisoNuevoSubPreguntaEvaluacion); this.jButtonDuplicarSubPreguntaEvaluacion.setVisible(this.isPermisoDuplicarSubPreguntaEvaluacion); this.jButtonCopiarSubPreguntaEvaluacion.setVisible(this.isPermisoCopiarSubPreguntaEvaluacion); this.jButtonVerFormSubPreguntaEvaluacion.setVisible(this.isPermisoVerFormSubPreguntaEvaluacion); this.jButtonAbrirOrderBySubPreguntaEvaluacion.setVisible(this.isPermisoOrdenSubPreguntaEvaluacion); this.jButtonNuevoRelacionesSubPreguntaEvaluacion.setVisible(this.isPermisoNuevoSubPreguntaEvaluacion); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonModificarSubPreguntaEvaluacion.setVisible(this.isPermisoActualizarSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonActualizarSubPreguntaEvaluacion.setVisible(this.isPermisoActualizarSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonEliminarSubPreguntaEvaluacion.setVisible(this.isPermisoEliminarSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonCancelarSubPreguntaEvaluacion.setVisible(this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonGuardarCambiosSubPreguntaEvaluacion.setVisible(this.isPermisoGuardarCambiosSubPreguntaEvaluacion); } this.jButtonGuardarCambiosTablaSubPreguntaEvaluacion.setVisible(this.isPermisoActualizarSubPreguntaEvaluacion); } public void inicializarActualizarBindingBotonesPermisosManualFormDetalleSubPreguntaEvaluacion() { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonModificarSubPreguntaEvaluacion.setVisible(this.isPermisoActualizarSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonActualizarSubPreguntaEvaluacion.setVisible(this.isPermisoActualizarSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonEliminarSubPreguntaEvaluacion.setVisible(this.isPermisoEliminarSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonCancelarSubPreguntaEvaluacion.setVisible(this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonGuardarCambiosSubPreguntaEvaluacion.setVisible((this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion && this.isPermisoGuardarCambiosSubPreguntaEvaluacion)); } public void inicializarActualizarBindingBotonesPermisosSubPreguntaEvaluacion() { if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL) { this.inicializarActualizarBindingBotonesPermisosManualSubPreguntaEvaluacion(); } else { } } public void refrescarBindingBotonesSubPreguntaEvaluacion() { } public void jTableDatosSubPreguntaEvaluacionListSelectionListener(javax.swing.event.ListSelectionEvent evt) throws Exception { try { this.seleccionarSubPreguntaEvaluacion(null,evt,-1); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jButtonidSubPreguntaEvaluacionBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.subpreguntaevaluacion==null) { this.subpreguntaevaluacion = new SubPreguntaEvaluacion(); } this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.subpreguntaevaluacion.getId()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id = "+this.subpreguntaevaluacion.getId().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonid_empresaSubPreguntaEvaluacionUpdateActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } Boolean idTienePermisoempresa=true; idTienePermisoempresa=this.tienePermisosUsuarioEnPaginaWebSubPreguntaEvaluacion(EmpresaConstantesFunciones.CLASSNAME); if(idTienePermisoempresa) { //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow<0 && this.jTableDatosSubPreguntaEvaluacion.getRowCount()>0) { intSelectedRow =0; this.jTableDatosSubPreguntaEvaluacion.setRowSelectionInterval(intSelectedRow,intSelectedRow); } //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); this.empresaBeanSwingJInternalFrame=new EmpresaBeanSwingJInternalFrame(true,true,this.jDesktopPane,this.usuarioActual,this.resumenUsuarioActual,this.moduloActual,this.opcionActual,this.parametroGeneralSg,this.parametroGeneralUsuario,PaginaTipo.AUXILIAR,false,false,false,true); this.empresaBeanSwingJInternalFrame.setJInternalFrameParent(this); this.empresaBeanSwingJInternalFrame.getEmpresaLogic().setConnexion(this.subpreguntaevaluacionLogic.getConnexion()); if(this.subpreguntaevaluacion.getid_empresa()!=null) { this.empresaBeanSwingJInternalFrame.sTipoBusqueda="PorId"; this.empresaBeanSwingJInternalFrame.setIdActual(this.subpreguntaevaluacion.getid_empresa()); this.empresaBeanSwingJInternalFrame.procesarBusqueda("PorId"); this.empresaBeanSwingJInternalFrame.setsAccionBusqueda("PorId"); this.empresaBeanSwingJInternalFrame.inicializarActualizarBindingTablaEmpresa(); } JInternalFrameBase jinternalFrame =this.empresaBeanSwingJInternalFrame; jinternalFrame.setAutoscrolls(true); //frame.setSize(screenSize.width-inset*7 , screenSize.height-inset*9); jinternalFrame.setVisible(true); TitledBorder titledBorderSubPreguntaEvaluacion=(TitledBorder)this.jScrollPanelDatosSubPreguntaEvaluacion.getBorder(); TitledBorder titledBorderempresa=(TitledBorder)this.empresaBeanSwingJInternalFrame.jScrollPanelDatosEmpresa.getBorder(); titledBorderempresa.setTitle(titledBorderSubPreguntaEvaluacion.getTitle() + " -> Empresa"); if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,jinternalFrame); } this.jDesktopPane.add(jinternalFrame); jinternalFrame.setSelected(true); } else { throw new Exception("NO TIENE PERMISO PARA TRABAJAR CON ESTA INFORMACION"); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonid_empresaSubPreguntaEvaluacionBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.subpreguntaevaluacion==null) { this.subpreguntaevaluacion = new SubPreguntaEvaluacion(); } this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.subpreguntaevaluacion.getid_empresa()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id_empresa = "+this.subpreguntaevaluacion.getid_empresa().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonid_sucursalSubPreguntaEvaluacionUpdateActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } Boolean idTienePermisosucursal=true; idTienePermisosucursal=this.tienePermisosUsuarioEnPaginaWebSubPreguntaEvaluacion(SucursalConstantesFunciones.CLASSNAME); if(idTienePermisosucursal) { //TOCA <NAME>, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow<0 && this.jTableDatosSubPreguntaEvaluacion.getRowCount()>0) { intSelectedRow =0; this.jTableDatosSubPreguntaEvaluacion.setRowSelectionInterval(intSelectedRow,intSelectedRow); } //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); this.sucursalBeanSwingJInternalFrame=new SucursalBeanSwingJInternalFrame(true,true,this.jDesktopPane,this.usuarioActual,this.resumenUsuarioActual,this.moduloActual,this.opcionActual,this.parametroGeneralSg,this.parametroGeneralUsuario,PaginaTipo.AUXILIAR,false,false,false,true); this.sucursalBeanSwingJInternalFrame.setJInternalFrameParent(this); this.sucursalBeanSwingJInternalFrame.getSucursalLogic().setConnexion(this.subpreguntaevaluacionLogic.getConnexion()); if(this.subpreguntaevaluacion.getid_sucursal()!=null) { this.sucursalBeanSwingJInternalFrame.sTipoBusqueda="PorId"; this.sucursalBeanSwingJInternalFrame.setIdActual(this.subpreguntaevaluacion.getid_sucursal()); this.sucursalBeanSwingJInternalFrame.procesarBusqueda("PorId"); this.sucursalBeanSwingJInternalFrame.setsAccionBusqueda("PorId"); this.sucursalBeanSwingJInternalFrame.inicializarActualizarBindingTablaSucursal(); } JInternalFrameBase jinternalFrame =this.sucursalBeanSwingJInternalFrame; jinternalFrame.setAutoscrolls(true); //frame.setSize(screenSize.width-inset*7 , screenSize.height-inset*9); jinternalFrame.setVisible(true); TitledBorder titledBorderSubPreguntaEvaluacion=(TitledBorder)this.jScrollPanelDatosSubPreguntaEvaluacion.getBorder(); TitledBorder titledBordersucursal=(TitledBorder)this.sucursalBeanSwingJInternalFrame.jScrollPanelDatosSucursal.getBorder(); titledBordersucursal.setTitle(titledBorderSubPreguntaEvaluacion.getTitle() + " -> Sucursal"); if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,jinternalFrame); } this.jDesktopPane.add(jinternalFrame); jinternalFrame.setSelected(true); } else { throw new Exception("NO TIENE PERMISO PARA TRABAJAR CON ESTA INFORMACION"); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonid_sucursalSubPreguntaEvaluacionBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.subpreguntaevaluacion==null) { this.subpreguntaevaluacion = new SubPreguntaEvaluacion(); } this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.subpreguntaevaluacion.getid_sucursal()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id_sucursal = "+this.subpreguntaevaluacion.getid_sucursal().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonid_pregunta_evaluacionSubPreguntaEvaluacionUpdateActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } Boolean idTienePermisopreguntaevaluacion=true; idTienePermisopreguntaevaluacion=this.tienePermisosUsuarioEnPaginaWebSubPreguntaEvaluacion(PreguntaEvaluacionConstantesFunciones.CLASSNAME); if(idTienePermisopreguntaevaluacion) { //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow<0 && this.jTableDatosSubPreguntaEvaluacion.getRowCount()>0) { intSelectedRow =0; this.jTableDatosSubPreguntaEvaluacion.setRowSelectionInterval(intSelectedRow,intSelectedRow); } //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); this.preguntaevaluacionBeanSwingJInternalFrame=new PreguntaEvaluacionBeanSwingJInternalFrame(true,true,this.jDesktopPane,this.usuarioActual,this.resumenUsuarioActual,this.moduloActual,this.opcionActual,this.parametroGeneralSg,this.parametroGeneralUsuario,PaginaTipo.AUXILIAR,false,false,false,true); this.preguntaevaluacionBeanSwingJInternalFrame.setJInternalFrameParent(this); this.preguntaevaluacionBeanSwingJInternalFrame.getPreguntaEvaluacionLogic().setConnexion(this.subpreguntaevaluacionLogic.getConnexion()); if(this.subpreguntaevaluacion.getid_pregunta_evaluacion()!=null) { this.preguntaevaluacionBeanSwingJInternalFrame.sTipoBusqueda="PorId"; this.preguntaevaluacionBeanSwingJInternalFrame.setIdActual(this.subpreguntaevaluacion.getid_pregunta_evaluacion()); this.preguntaevaluacionBeanSwingJInternalFrame.procesarBusqueda("PorId"); this.preguntaevaluacionBeanSwingJInternalFrame.setsAccionBusqueda("PorId"); this.preguntaevaluacionBeanSwingJInternalFrame.inicializarActualizarBindingTablaPreguntaEvaluacion(); } JInternalFrameBase jinternalFrame =this.preguntaevaluacionBeanSwingJInternalFrame; jinternalFrame.setAutoscrolls(true); //frame.setSize(screenSize.width-inset*7 , screenSize.height-inset*9); jinternalFrame.setVisible(true); TitledBorder titledBorderSubPreguntaEvaluacion=(TitledBorder)this.jScrollPanelDatosSubPreguntaEvaluacion.getBorder(); TitledBorder titledBorderpreguntaevaluacion=(TitledBorder)this.preguntaevaluacionBeanSwingJInternalFrame.jScrollPanelDatosPreguntaEvaluacion.getBorder(); titledBorderpreguntaevaluacion.setTitle(titledBorderSubPreguntaEvaluacion.getTitle() + " -> Pregunta Evaluacion"); if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,jinternalFrame); } this.jDesktopPane.add(jinternalFrame); jinternalFrame.setSelected(true); } else { throw new Exception("NO TIENE PERMISO PARA TRABAJAR CON ESTA INFORMACION"); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonid_pregunta_evaluacionSubPreguntaEvaluacionBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.subpreguntaevaluacion==null) { this.subpreguntaevaluacion = new SubPreguntaEvaluacion(); } this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.subpreguntaevaluacion.getid_pregunta_evaluacion()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id_pregunta_evaluacion = "+this.subpreguntaevaluacion.getid_pregunta_evaluacion().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonid_ejercicioSubPreguntaEvaluacionUpdateActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } Boolean idTienePermisoejercicio=true; idTienePermisoejercicio=this.tienePermisosUsuarioEnPaginaWebSubPreguntaEvaluacion(EjercicioConstantesFunciones.CLASSNAME); if(idTienePermisoejercicio) { //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow<0 && this.jTableDatosSubPreguntaEvaluacion.getRowCount()>0) { intSelectedRow =0; this.jTableDatosSubPreguntaEvaluacion.setRowSelectionInterval(intSelectedRow,intSelectedRow); } //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); this.ejercicioBeanSwingJInternalFrame=new EjercicioBeanSwingJInternalFrame(true,true,this.jDesktopPane,this.usuarioActual,this.resumenUsuarioActual,this.moduloActual,this.opcionActual,this.parametroGeneralSg,this.parametroGeneralUsuario,PaginaTipo.AUXILIAR,false,false,false,true); this.ejercicioBeanSwingJInternalFrame.setJInternalFrameParent(this); this.ejercicioBeanSwingJInternalFrame.getEjercicioLogic().setConnexion(this.subpreguntaevaluacionLogic.getConnexion()); if(this.subpreguntaevaluacion.getid_ejercicio()!=null) { this.ejercicioBeanSwingJInternalFrame.sTipoBusqueda="PorId"; this.ejercicioBeanSwingJInternalFrame.setIdActual(this.subpreguntaevaluacion.getid_ejercicio()); this.ejercicioBeanSwingJInternalFrame.procesarBusqueda("PorId"); this.ejercicioBeanSwingJInternalFrame.setsAccionBusqueda("PorId"); this.ejercicioBeanSwingJInternalFrame.inicializarActualizarBindingTablaEjercicio(); } JInternalFrameBase jinternalFrame =this.ejercicioBeanSwingJInternalFrame; jinternalFrame.setAutoscrolls(true); //frame.setSize(screenSize.width-inset*7 , screenSize.height-inset*9); jinternalFrame.setVisible(true); TitledBorder titledBorderSubPreguntaEvaluacion=(TitledBorder)this.jScrollPanelDatosSubPreguntaEvaluacion.getBorder(); TitledBorder titledBorderejercicio=(TitledBorder)this.ejercicioBeanSwingJInternalFrame.jScrollPanelDatosEjercicio.getBorder(); titledBorderejercicio.setTitle(titledBorderSubPreguntaEvaluacion.getTitle() + " -> Ejercicio"); if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,jinternalFrame); } this.jDesktopPane.add(jinternalFrame); jinternalFrame.setSelected(true); } else { throw new Exception("NO TIENE PERMISO PARA TRABAJAR CON ESTA INFORMACION"); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonid_ejercicioSubPreguntaEvaluacionBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.subpreguntaevaluacion==null) { this.subpreguntaevaluacion = new SubPreguntaEvaluacion(); } this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.subpreguntaevaluacion.getid_ejercicio()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id_ejercicio = "+this.subpreguntaevaluacion.getid_ejercicio().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonid_periodoSubPreguntaEvaluacionUpdateActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } Boolean idTienePermisoperiodo=true; idTienePermisoperiodo=this.tienePermisosUsuarioEnPaginaWebSubPreguntaEvaluacion(PeriodoConstantesFunciones.CLASSNAME); if(idTienePermisoperiodo) { //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow<0 && this.jTableDatosSubPreguntaEvaluacion.getRowCount()>0) { intSelectedRow =0; this.jTableDatosSubPreguntaEvaluacion.setRowSelectionInterval(intSelectedRow,intSelectedRow); } //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); this.periodoBeanSwingJInternalFrame=new PeriodoBeanSwingJInternalFrame(true,true,this.jDesktopPane,this.usuarioActual,this.resumenUsuarioActual,this.moduloActual,this.opcionActual,this.parametroGeneralSg,this.parametroGeneralUsuario,PaginaTipo.AUXILIAR,false,false,false,true); this.periodoBeanSwingJInternalFrame.setJInternalFrameParent(this); this.periodoBeanSwingJInternalFrame.getPeriodoLogic().setConnexion(this.subpreguntaevaluacionLogic.getConnexion()); if(this.subpreguntaevaluacion.getid_periodo()!=null) { this.periodoBeanSwingJInternalFrame.sTipoBusqueda="PorId"; this.periodoBeanSwingJInternalFrame.setIdActual(this.subpreguntaevaluacion.getid_periodo()); this.periodoBeanSwingJInternalFrame.procesarBusqueda("PorId"); this.periodoBeanSwingJInternalFrame.setsAccionBusqueda("PorId"); this.periodoBeanSwingJInternalFrame.inicializarActualizarBindingTablaPeriodo(); } JInternalFrameBase jinternalFrame =this.periodoBeanSwingJInternalFrame; jinternalFrame.setAutoscrolls(true); //frame.setSize(screenSize.width-inset*7 , screenSize.height-inset*9); jinternalFrame.setVisible(true); TitledBorder titledBorderSubPreguntaEvaluacion=(TitledBorder)this.jScrollPanelDatosSubPreguntaEvaluacion.getBorder(); TitledBorder titledBorderperiodo=(TitledBorder)this.periodoBeanSwingJInternalFrame.jScrollPanelDatosPeriodo.getBorder(); titledBorderperiodo.setTitle(titledBorderSubPreguntaEvaluacion.getTitle() + " -> Periodo"); if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,jinternalFrame); } this.jDesktopPane.add(jinternalFrame); jinternalFrame.setSelected(true); } else { throw new Exception("NO TIENE PERMISO PARA TRABAJAR CON ESTA INFORMACION"); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonid_periodoSubPreguntaEvaluacionBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.subpreguntaevaluacion==null) { this.subpreguntaevaluacion = new SubPreguntaEvaluacion(); } this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.subpreguntaevaluacion.getid_periodo()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id_periodo = "+this.subpreguntaevaluacion.getid_periodo().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonordenSubPreguntaEvaluacionBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.subpreguntaevaluacion==null) { this.subpreguntaevaluacion = new SubPreguntaEvaluacion(); } this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.subpreguntaevaluacion.getorden()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where orden = "+this.subpreguntaevaluacion.getorden().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonpreguntaSubPreguntaEvaluacionBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.subpreguntaevaluacion==null) { this.subpreguntaevaluacion = new SubPreguntaEvaluacion(); } this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.subpreguntaevaluacion.getpregunta()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where pregunta like '%"+this.subpreguntaevaluacion.getpregunta()+"%' "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonporcentaje_siSubPreguntaEvaluacionBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //TOCA <NAME>, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.subpreguntaevaluacion==null) { this.subpreguntaevaluacion = new SubPreguntaEvaluacion(); } this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.subpreguntaevaluacion.getporcentaje_si()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where porcentaje_si = "+this.subpreguntaevaluacion.getporcentaje_si().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtoncon_facturaSubPreguntaEvaluacionBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.subpreguntaevaluacion==null) { this.subpreguntaevaluacion = new SubPreguntaEvaluacion(); } this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.subpreguntaevaluacion.getcon_factura()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where con_factura = "+this.subpreguntaevaluacion.getcon_factura().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtoncon_orden_compraSubPreguntaEvaluacionBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.subpreguntaevaluacion==null) { this.subpreguntaevaluacion = new SubPreguntaEvaluacion(); } this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.subpreguntaevaluacion.getcon_orden_compra()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where con_orden_compra = "+this.subpreguntaevaluacion.getcon_orden_compra().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtoncon_completoSubPreguntaEvaluacionBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.subpreguntaevaluacion==null) { this.subpreguntaevaluacion = new SubPreguntaEvaluacion(); } this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.subpreguntaevaluacion.getcon_completo()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where con_completo = "+this.subpreguntaevaluacion.getcon_completo().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtoncon_a_tiempoSubPreguntaEvaluacionBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.getsubpreguntaevaluacion(),true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.subpreguntaevaluacion==null) { this.subpreguntaevaluacion = new SubPreguntaEvaluacion(); } this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.subpreguntaevaluacion.getcon_a_tiempo()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where con_a_tiempo = "+this.subpreguntaevaluacion.getcon_a_tiempo().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonFK_IdEjercicioSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } this.iNumeroPaginacionPagina=0; this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); this.getSubPreguntaEvaluacionsFK_IdEjercicio(); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); //if(SubPreguntaEvaluacionBeanSwingJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); //} if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonFK_IdEmpresaSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } this.iNumeroPaginacionPagina=0; this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); this.getSubPreguntaEvaluacionsFK_IdEmpresa(); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); //if(SubPreguntaEvaluacionBeanSwingJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); //} if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonFK_IdPeriodoSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } this.iNumeroPaginacionPagina=0; this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); this.getSubPreguntaEvaluacionsFK_IdPeriodo(); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); //if(SubPreguntaEvaluacionBeanSwingJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); //} if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonFK_IdPreguntaEvaluacionSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } this.iNumeroPaginacionPagina=0; this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); this.getSubPreguntaEvaluacionsFK_IdPreguntaEvaluacion(); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); //if(SubPreguntaEvaluacionBeanSwingJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); //} if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void jButtonFK_IdSucursalSubPreguntaEvaluacionActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.getNewConnexionToDeep(""); } this.iNumeroPaginacionPagina=0; this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); this.getSubPreguntaEvaluacionsFK_IdSucursal(); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); //if(SubPreguntaEvaluacionBeanSwingJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); //} if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.closeNewConnexionToDeep(); } } } public void closingInternalFrameSubPreguntaEvaluacion() { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.setVisible(false); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.dispose(); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame=null; } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFramePopup!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFramePopup.setVisible(false); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFramePopup.dispose(); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFramePopup=null; } } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setVisible(false); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.dispose(); this.jInternalFrameDetalleFormSubPreguntaEvaluacion=null; } if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion!=null) { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.setVisible(false); this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.dispose(); this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion=null; } if(this.jInternalFrameImportacionSubPreguntaEvaluacion!=null) { this.jInternalFrameImportacionSubPreguntaEvaluacion.setVisible(false); this.jInternalFrameImportacionSubPreguntaEvaluacion.dispose(); this.jInternalFrameImportacionSubPreguntaEvaluacion=null; } this.setVisible(false); this.dispose(); //this=null; } public void jButtonActionPerformedGeneral(String sTipo,ActionEvent evt) { try { this.startProcessSubPreguntaEvaluacion(); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.BUTTON,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(sTipo.equals("NuevoSubPreguntaEvaluacion")) { jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,false); } else if(sTipo.equals("DuplicarSubPreguntaEvaluacion")) { jButtonDuplicarSubPreguntaEvaluacionActionPerformed(evt,false); } else if(sTipo.equals("CopiarSubPreguntaEvaluacion")) { jButtonCopiarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("VerFormSubPreguntaEvaluacion")) { jButtonVerFormSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("NuevoToolBarSubPreguntaEvaluacion")) { jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,false); } else if(sTipo.equals("DuplicarToolBarSubPreguntaEvaluacion")) { jButtonDuplicarSubPreguntaEvaluacionActionPerformed(evt,false); } else if(sTipo.equals("MenuItemNuevoSubPreguntaEvaluacion")) { jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,false); } else if(sTipo.equals("MenuItemDuplicarSubPreguntaEvaluacion")) { jButtonDuplicarSubPreguntaEvaluacionActionPerformed(evt,false); } else if(sTipo.equals("NuevoRelacionesSubPreguntaEvaluacion")) { jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,true); } else if(sTipo.equals("NuevoRelacionesToolBarSubPreguntaEvaluacion")) { jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,true); } else if(sTipo.equals("MenuItemNuevoRelacionesSubPreguntaEvaluacion")) { jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,true); } else if(sTipo.equals("ModificarSubPreguntaEvaluacion")) { jButtonModificarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("ModificarToolBarSubPreguntaEvaluacion")) { jButtonModificarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemModificarSubPreguntaEvaluacion")) { jButtonModificarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("ActualizarSubPreguntaEvaluacion")) { jButtonActualizarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("ActualizarToolBarSubPreguntaEvaluacion")) { jButtonActualizarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemActualizarSubPreguntaEvaluacion")) { jButtonActualizarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("EliminarSubPreguntaEvaluacion")) { jButtonEliminarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("EliminarToolBarSubPreguntaEvaluacion")) { jButtonEliminarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemEliminarSubPreguntaEvaluacion")) { jButtonEliminarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("CancelarSubPreguntaEvaluacion")) { jButtonCancelarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("CancelarToolBarSubPreguntaEvaluacion")) { jButtonCancelarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemCancelarSubPreguntaEvaluacion")) { jButtonCancelarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("CerrarSubPreguntaEvaluacion")) { jButtonCerrarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("CerrarToolBarSubPreguntaEvaluacion")) { jButtonCerrarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemCerrarSubPreguntaEvaluacion")) { jButtonCerrarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MostrarOcultarToolBarSubPreguntaEvaluacion")) { jButtonMostrarOcultarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemDetalleCerrarSubPreguntaEvaluacion")) { jButtonCancelarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("GuardarCambiosSubPreguntaEvaluacion")) { jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("GuardarCambiosToolBarSubPreguntaEvaluacion")) { jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("CopiarToolBarSubPreguntaEvaluacion")) { jButtonCopiarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("VerFormToolBarSubPreguntaEvaluacion")) { jButtonVerFormSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemGuardarCambiosSubPreguntaEvaluacion")) { jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemCopiarSubPreguntaEvaluacion")) { jButtonCopiarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemVerFormSubPreguntaEvaluacion")) { jButtonVerFormSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("GuardarCambiosTablaSubPreguntaEvaluacion")) { jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("GuardarCambiosTablaToolBarSubPreguntaEvaluacion")) { jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemGuardarCambiosTablaSubPreguntaEvaluacion")) { jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("RecargarInformacionSubPreguntaEvaluacion")) { jButtonRecargarInformacionSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("RecargarInformacionToolBarSubPreguntaEvaluacion")) { jButtonRecargarInformacionSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemRecargarInformacionSubPreguntaEvaluacion")) { jButtonRecargarInformacionSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("AnterioresSubPreguntaEvaluacion")) { jButtonAnterioresSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("AnterioresToolBarSubPreguntaEvaluacion")) { jButtonAnterioresSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemAnterioreSubPreguntaEvaluacion")) { jButtonAnterioresSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("SiguientesSubPreguntaEvaluacion")) { jButtonSiguientesSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("SiguientesToolBarSubPreguntaEvaluacion")) { jButtonSiguientesSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemSiguientesSubPreguntaEvaluacion")) { jButtonSiguientesSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemAbrirOrderBySubPreguntaEvaluacion") || sTipo.equals("MenuItemDetalleAbrirOrderBySubPreguntaEvaluacion")) { jButtonAbrirOrderBySubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemMostrarOcultarSubPreguntaEvaluacion") || sTipo.equals("MenuItemDetalleMostrarOcultarSubPreguntaEvaluacion")) { jButtonMostrarOcultarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("NuevoGuardarCambiosSubPreguntaEvaluacion")) { jButtonNuevoGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("NuevoGuardarCambiosToolBarSubPreguntaEvaluacion")) { jButtonNuevoGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("MenuItemNuevoGuardarCambiosSubPreguntaEvaluacion")) { jButtonNuevoGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("CerrarReporteDinamicoSubPreguntaEvaluacion")) { jButtonCerrarReporteDinamicoSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("GenerarReporteDinamicoSubPreguntaEvaluacion")) { jButtonGenerarReporteDinamicoSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("GenerarExcelReporteDinamicoSubPreguntaEvaluacion")) { jButtonGenerarExcelReporteDinamicoSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("CerrarImportacionSubPreguntaEvaluacion")) { jButtonCerrarImportacionSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("GenerarImportacionSubPreguntaEvaluacion")) { jButtonGenerarImportacionSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("AbrirImportacionSubPreguntaEvaluacion")) { jButtonAbrirImportacionSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("TiposAccionesSubPreguntaEvaluacion")) { jComboBoxTiposAccionesSubPreguntaEvaluacionActionListener(evt,false); } else if(sTipo.equals("TiposRelacionesSubPreguntaEvaluacion")) { jComboBoxTiposRelacionesSubPreguntaEvaluacionActionListener(evt); } else if(sTipo.equals("TiposAccionesFormularioSubPreguntaEvaluacion")) { jComboBoxTiposAccionesSubPreguntaEvaluacionActionListener(evt,true); } else if(sTipo.equals("TiposSeleccionarSubPreguntaEvaluacion")) { jComboBoxTiposSeleccionarSubPreguntaEvaluacionActionListener(evt); } else if(sTipo.equals("ValorCampoGeneralSubPreguntaEvaluacion")) { jTextFieldValorCampoGeneralSubPreguntaEvaluacionActionListener(evt); } else if(sTipo.equals("AbrirOrderBySubPreguntaEvaluacion")) { jButtonAbrirOrderBySubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("AbrirOrderByToolBarSubPreguntaEvaluacion")) { jButtonAbrirOrderBySubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("CerrarOrderBySubPreguntaEvaluacion")) { jButtonCerrarOrderBySubPreguntaEvaluacionActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("idSubPreguntaEvaluacionBusqueda")) { this.jButtonidSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_empresaSubPreguntaEvaluacionUpdate")) { this.jButtonid_empresaSubPreguntaEvaluacionUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_empresaSubPreguntaEvaluacionBusqueda")) { this.jButtonid_empresaSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_sucursalSubPreguntaEvaluacionUpdate")) { this.jButtonid_sucursalSubPreguntaEvaluacionUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_sucursalSubPreguntaEvaluacionBusqueda")) { this.jButtonid_sucursalSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_pregunta_evaluacionSubPreguntaEvaluacionUpdate")) { this.jButtonid_pregunta_evaluacionSubPreguntaEvaluacionUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_pregunta_evaluacionSubPreguntaEvaluacionBusqueda")) { this.jButtonid_pregunta_evaluacionSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_ejercicioSubPreguntaEvaluacionUpdate")) { this.jButtonid_ejercicioSubPreguntaEvaluacionUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_ejercicioSubPreguntaEvaluacionBusqueda")) { this.jButtonid_ejercicioSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_periodoSubPreguntaEvaluacionUpdate")) { this.jButtonid_periodoSubPreguntaEvaluacionUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_periodoSubPreguntaEvaluacionBusqueda")) { this.jButtonid_periodoSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("ordenSubPreguntaEvaluacionBusqueda")) { this.jButtonordenSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("preguntaSubPreguntaEvaluacionBusqueda")) { this.jButtonpreguntaSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("porcentaje_siSubPreguntaEvaluacionBusqueda")) { this.jButtonporcentaje_siSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("con_facturaSubPreguntaEvaluacionBusqueda")) { this.jButtoncon_facturaSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("con_orden_compraSubPreguntaEvaluacionBusqueda")) { this.jButtoncon_orden_compraSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("con_completoSubPreguntaEvaluacionBusqueda")) { this.jButtoncon_completoSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("con_a_tiempoSubPreguntaEvaluacionBusqueda")) { this.jButtoncon_a_tiempoSubPreguntaEvaluacionBusquedaActionPerformed(evt); } else if(sTipo.equals("FK_IdPreguntaEvaluacionSubPreguntaEvaluacion")) { this.jButtonFK_IdPreguntaEvaluacionSubPreguntaEvaluacionActionPerformed(evt); } ; SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.BUTTON,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { this.finishProcessSubPreguntaEvaluacion(); } } //FUNCIONA AL APLASTAR ENTER public void jTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { try { if(this.permiteManejarEventosControl()) { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; Container containerParent=null; JTextField jTextField=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ ArrayList<Classe> classes=new ArrayList<Classe>(); jTextField=(JTextField)evt.getSource(); containerParent=jTextField.getParent(); if(containerParent!=null && containerParent.getClass().equals(JTableMe.class)) { esControlTabla=true; } this.esControlTabla=esControlTabla; this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(SubPreguntaEvaluacion.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",SubPreguntaEvaluacion.class.getName(),sTipo,"TEXTFIELD",esControlTabla,conIrServidorAplicacionParent, id,jTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public Boolean existeCambioValor(ControlTipo controlTipo,String sTipo) throws Exception { Boolean existeCambio=true; try { SubPreguntaEvaluacion subpreguntaevaluacionLocal=null; if(!this.getEsControlTabla()) { subpreguntaevaluacionLocal=this.subpreguntaevaluacion; } else { subpreguntaevaluacionLocal=this.subpreguntaevaluacionAnterior; } if(controlTipo.equals(ControlTipo.TEXTBOX)) { } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } return existeCambio; } public void jTextFieldFocusLostGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl() && this.existeCambioValor(ControlTipo.TEXTBOX,sTipo)) { EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; JTextField jTextField=null; Container containerParent=null; Component componentOpposite=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ ArrayList<Classe> classes=new ArrayList<Classe>(); jTextField=(JTextField)evt.getSource(); containerParent=jTextField.getParent(); componentOpposite=evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(SubPreguntaEvaluacion.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",SubPreguntaEvaluacion.class.getName(),sTipo,"TEXTFIELD",esControlTabla,conIrServidorAplicacionParent, id,jTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jTextFieldFocusGainedGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); //SELECCIONA FILA A OBJETO ANTERIOR Integer intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionAnterior =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.subpreguntaevaluacionAnterior =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } //CUANDO SE CAMBIA ALGUN FORMATO(TIPO DE LETRA,NEGRILLA,ETC) public void jTextFieldChangedUpdateGeneral(String sTipo,JTextField jTextField,DocumentEvent evt) { try { /* EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; //System.out.println("UPDATE"); Boolean esControlTabla=false; //JTextField jTextField=null; Container containerParent=null; Component componentOpposite=null; if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); ArrayList<Classe> classes=new ArrayList<Classe>(); //jTextField=(JTextField)evt.getSource(); containerParent=jTextField.getParent(); componentOpposite=null;//evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); */ } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } //CUANDO SE QUITA ALGUN CARACTER public void jTextFieldRemoveUpdateGeneral(String sTipo,JTextField jTextField,DocumentEvent evt) { try { //System.out.println("REMOVE"); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } //CUANDO SE INGRESA ALGUN CARACTER public void jTextFieldInsertUpdateGeneral(String sTipo,JTextField jTextField,DocumentEvent evt) { try { //System.out.println("INSERT"); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } //FUNCIONA AL APLASTAR ENTER public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { try { if(this.permiteManejarEventosControl()) { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; Container containerParent=null; Container containerParentAux=null; JFormattedTextField JFormattedTextField=null; Component componentOpposite=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ ArrayList<Classe> classes=new ArrayList<Classe>(); JFormattedTextField=(JFormattedTextField)evt.getSource(); containerParentAux=JFormattedTextField.getParent(); if(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) { containerParent=containerParentAux.getParent(); } componentOpposite=null;//evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(SubPreguntaEvaluacion.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",SubPreguntaEvaluacion.class.getName(),sTipo,"DATE",esControlTabla,conIrServidorAplicacionParent, id,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jFormattedTextFieldFocusLostGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl() && this.existeCambioValor(ControlTipo.TEXTBOX,sTipo)) { EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; JTextField jTextField=null; Container containerParent=null; Container containerParentAux=null; Component componentOpposite=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ ArrayList<Classe> classes=new ArrayList<Classe>(); jTextField=(JTextField)evt.getSource(); containerParentAux=jTextField.getParent(); if(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) { containerParent=containerParentAux.getParent(); } componentOpposite=evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(SubPreguntaEvaluacion.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",SubPreguntaEvaluacion.class.getName(),sTipo,"TEXTFIELD",esControlTabla,conIrServidorAplicacionParent, id,jTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jFormattedTextFieldFocusGainedGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); //SELECCIONA FILA A OBJETO ANTERIOR Integer intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionAnterior =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.subpreguntaevaluacionAnterior =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jDateChooserFocusLostGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl() && this.existeCambioValor(ControlTipo.DATE,sTipo)) { this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jDateChooserFocusGainedGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); //SELECCIONA FILA A OBJETO ANTERIOR Integer intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionAnterior =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.subpreguntaevaluacionAnterior =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jDateChooserActionPerformedGeneral(String sTipo,ActionEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jTextAreaFocusLostGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl() && this.existeCambioValor(ControlTipo.TEXTAREA,sTipo)) { EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; JTextArea jTextArea=null; Container containerParent=null; Component componentOpposite=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ ArrayList<Classe> classes=new ArrayList<Classe>(); jTextArea=(JTextArea)evt.getSource(); containerParent=jTextArea.getParent(); componentOpposite=evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TEXTAREA,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TEXTAREA,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(SubPreguntaEvaluacion.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",SubPreguntaEvaluacion.class.getName(),sTipo,"TEXTAREA",esControlTabla,conIrServidorAplicacionParent, id,jTextArea, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.TEXTAREA,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jTextAreaFocusGainedGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl()) { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); //SELECCIONA FILA A OBJETO ANTERIOR Integer intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionAnterior =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.subpreguntaevaluacionAnterior =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jTextAreaChangedUpdateGeneral(String sTipo,JTextArea jTextArea,DocumentEvent evt) { try { /* EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; //System.out.println("UPDATE"); Boolean esControlTabla=false; //JTextArea jTextArea=null; Container containerParent=null; Component componentOpposite=null; if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TEXTAREA,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); ArrayList<Classe> classes=new ArrayList<Classe>(); //jTextArea=(JTextArea)evt.getSource(); containerParent=jTextArea.getParent(); componentOpposite=null;//evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TEXTAREA,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); */ } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jTextAreaRemoveUpdateGeneral(String sTipo,JTextArea jTextArea,DocumentEvent evt) { try { //System.out.println("REMOVE"); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jTextAreaInsertUpdateGeneral(String sTipo,JTextArea jTextArea,DocumentEvent evt) { try { //System.out.println("INSERT"); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } //NO EXISTE O NO ES APLICABLE public void jTextAreaActionPerformedGeneral(String sTipo,ActionEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jLabelFocusLostGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl()) { EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; JLabel jLabel=null; Container containerParent=null; Component componentOpposite=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ ArrayList<Classe> classes=new ArrayList<Classe>(); jLabel=(JLabel)evt.getSource(); containerParent=jLabel.getParent(); componentOpposite=evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(SubPreguntaEvaluacion.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",SubPreguntaEvaluacion.class.getName(),sTipo,"TEXTFIELD",esControlTabla,conIrServidorAplicacionParent, id,jLabel, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jLabelFocusGainedGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); //SELECCIONA FILA A OBJETO ANTERIOR Integer intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionAnterior =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.subpreguntaevaluacionAnterior =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } //NO EXISTE O NO ES APLICABLE public void jLabelActionPerformedGeneral(String sTipo,ActionEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jCheckBoxItemListenerGeneral(String sTipo,ItemEvent evt) { try { if(this.permiteManejarEventosControl()) { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; JCheckBox jCheckBox=null; Container containerParent=null; Component componentOpposite=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ ArrayList<Classe> classes=new ArrayList<Classe>(); jCheckBox=(JCheckBox)evt.getSource(); containerParent=jCheckBox.getParent(); componentOpposite=null;//evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(sTipo.equals("SeleccionarTodosSubPreguntaEvaluacion")) { jCheckBoxSeleccionarTodosSubPreguntaEvaluacionItemListener(evt); } else if(sTipo.equals("SeleccionadosSubPreguntaEvaluacion")) { jCheckBoxSeleccionadosSubPreguntaEvaluacionItemListener(evt); } else if(sTipo.equals("NuevoToolBarSubPreguntaEvaluacion")) { } SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(SubPreguntaEvaluacion.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",SubPreguntaEvaluacion.class.getName(),sTipo,"TEXTFIELD",esControlTabla,conIrServidorAplicacionParent, id,jCheckBox, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jCheckBoxFocusLostGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl() && this.existeCambioValor(ControlTipo.CHECKBOX,sTipo)) { EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; JCheckBox jCheckBox=null; Container containerParent=null; Component componentOpposite=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN ArrayList<Classe> classes=new ArrayList<Classe>(); jCheckBox=(JCheckBox)evt.getSource(); containerParent=jCheckBox.getParent(); componentOpposite=evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ //this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); //this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(SubPreguntaEvaluacion.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",SubPreguntaEvaluacion.class.getName(),sTipo,"TEXTFIELD",esControlTabla,conIrServidorAplicacionParent, id,jCheckBox, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jCheckBoxFocusGainedGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl()) { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); //SELECCIONA FILA A OBJETO ANTERIOR Integer intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionAnterior =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.subpreguntaevaluacionAnterior =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jCheckBoxActionPerformedGeneral(String sTipo,ActionEvent evt) { try { if(this.permiteManejarEventosControl()) { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } //NO SE UTILIZA, SE USA EL DE ABAJO, IGUAL SE DEJA EL CODIGO COMO RESPALDO Y ES CASI IGUAL //ERROR:SI SE USA,AL HACER CLIC EN EL MISMO ELEMENTO O EJECUTAR SELECTEDITEM, SIEMPRE SE EJECUTA COMO SI ESCOGIERA OTRO ELEMENTO(NO DEBERIA) //@SuppressWarnings("rawtypes") public void jComboBoxActionPerformedGeneral(String sTipo,ActionEvent evt) { try { /* EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } Container containerParent=null; Component componentOpposite=null; Boolean esControlTabla=false; ArrayList<Classe> classes=new ArrayList<Classe>(); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); JComboBox jComboBoxGenerico=null; if(evt.getSource().getClass().equals(JComboBox.class) || evt.getSource().getClass().equals(JComboBoxMe.class)) { jComboBoxGenerico=(JComboBox)evt.getSource(); containerParent=jComboBoxGenerico.getParent(); componentOpposite=null;//evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; } String sFinalQueryCombo=""; SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); */ } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } @SuppressWarnings("rawtypes") public void jComboBoxItemStateChangedGeneral(String sTipo,ItemEvent evt) { try { if (evt.getStateChange() == ItemEvent.SELECTED && this.permiteManejarEventosControl()) { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ Container containerParent=null; Component componentOpposite=null; Boolean esControlTabla=false; ArrayList<Classe> classes=new ArrayList<Classe>(); JComboBox jComboBoxGenerico=null; if(evt.getSource().getClass().equals(JComboBox.class) || evt.getSource().getClass().equals(JComboBoxMe.class)) { jComboBoxGenerico=(JComboBox)evt.getSource(); containerParent=jComboBoxGenerico.getParent(); componentOpposite=null;//evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; } this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); String sFinalQueryCombo=""; SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(SubPreguntaEvaluacion.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",SubPreguntaEvaluacion.class.getName(),sTipo,"COMBOBOX",esControlTabla,conIrServidorAplicacionParent, id,jComboBoxGenerico, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } //@SuppressWarnings("rawtypes") public void jComboBoxFocusLostGeneral(String sTipo,java.awt.event.FocusEvent evt) { //MANEJADO EN ITEMLISTENER /* try { if(this.permiteManejarEventosControl()) { EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; //if(this.esUsoDesdeHijo) { // eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; //} Container containerParent=null; Component componentOpposite=null; Boolean esControlTabla=false; ArrayList<Classe> classes=new ArrayList<Classe>(); //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN this.actualizarInformacion("EVENTO_CONTROL",false,this.subpreguntaevaluacion); this.actualizarInformacion("INFO_PADRE",false,this.subpreguntaevaluacion); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); JComboBox jComboBoxGenerico=null; if(evt.getSource().getClass().equals(JComboBox.class) || evt.getSource().getClass().equals(JComboBoxMe.class)) { jComboBoxGenerico=(JComboBox)evt.getSource(); containerParent=jComboBoxGenerico.getParent(); componentOpposite=evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; } String sFinalQueryCombo=""; SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(SubPreguntaEvaluacion.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",SubPreguntaEvaluacion.class.getName(),sTipo,"TEXTFIELD",esControlTabla,conIrServidorAplicacionParent, id,jComboBoxGenerico, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } */ } public void jComboBoxFocusGainedGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaSubPreguntaEvaluacionActual(); //SELECCIONA FILA A OBJETO ANTERIOR Integer intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionAnterior =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.subpreguntaevaluacionAnterior =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void tableValueChangedGeneral(String sTipo,ListSelectionEvent evt) { try { if(this.permiteManejarEventosControl()) { SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TABLE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(sTipo.equals("TableDatosSeleccionarSubPreguntaEvaluacion")) { //BYDAN_DESHABILITADO //try {jTableDatosSubPreguntaEvaluacionListSelectionListener(e);}catch(Exception e1){e1.printStackTrace();} //SOLO CUANDO MOUSE ES SOLTADO if (!evt.getValueIsAdjusting()) { //SELECCIONA FILA A OBJETO ACTUAL Integer intSelectedRow = this.jTableDatosSubPreguntaEvaluacion.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.subpreguntaevaluacion =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.subpreguntaevaluacion); } } } else if(sTipo.equals("jButtonCancelarSubPreguntaEvaluacion")) { } SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TABLE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void tableMouseAdapterGeneral(String sTipo,MouseEvent evt) { try { SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TABLE,EventoTipo.MOUSE,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(sTipo.equals("DatosSeleccionarSubPreguntaEvaluacion")) { if (evt.getClickCount() == 2) { jButtonIdActionPerformed(null,jTableDatosSubPreguntaEvaluacion.getSelectedRow(),false,false); } } else if(sTipo.equals("jButtonCancelarSubPreguntaEvaluacion")) { } SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TABLE,EventoTipo.MOUSE,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } ; public void jButtonActionPerformedTecladoGeneral(String sTipo,ActionEvent evt) { try { this.startProcessSubPreguntaEvaluacion(); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.KEY,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(sTipo.equals("NuevoSubPreguntaEvaluacion")) { jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,false); } else if(sTipo.equals("DuplicarSubPreguntaEvaluacion")) { jButtonDuplicarSubPreguntaEvaluacionActionPerformed(evt,false); } else if(sTipo.equals("CopiarSubPreguntaEvaluacion")) { jButtonCopiarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("VerFormSubPreguntaEvaluacion")) { jButtonVerFormSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("NuevoRelacionesSubPreguntaEvaluacion")) { jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,true); } else if(sTipo.equals("ModificarSubPreguntaEvaluacion")) { jButtonModificarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("ActualizarSubPreguntaEvaluacion")) { jButtonActualizarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("EliminarSubPreguntaEvaluacion")) { jButtonEliminarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("GuardarCambiosTablaSubPreguntaEvaluacion")) { jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("CancelarSubPreguntaEvaluacion")) { jButtonCancelarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("CerrarSubPreguntaEvaluacion")) { jButtonCerrarSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("GuardarCambiosSubPreguntaEvaluacion")) { jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("NuevoGuardarCambiosSubPreguntaEvaluacion")) { jButtonNuevoGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("AbrirOrderBySubPreguntaEvaluacion")) { jButtonAbrirOrderBySubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("RecargarInformacionSubPreguntaEvaluacion")) { jButtonRecargarInformacionSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("AnterioresSubPreguntaEvaluacion")) { jButtonAnterioresSubPreguntaEvaluacionActionPerformed(evt); } else if(sTipo.equals("SiguientesSubPreguntaEvaluacion")) { jButtonSiguientesSubPreguntaEvaluacionActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("idSubPreguntaEvaluacionBusqueda")) { this.jButtonidSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_empresaSubPreguntaEvaluacionUpdate")) { this.jButtonid_empresaSubPreguntaEvaluacionUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_empresaSubPreguntaEvaluacionBusqueda")) { this.jButtonid_empresaSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_sucursalSubPreguntaEvaluacionUpdate")) { this.jButtonid_sucursalSubPreguntaEvaluacionUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_sucursalSubPreguntaEvaluacionBusqueda")) { this.jButtonid_sucursalSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_pregunta_evaluacionSubPreguntaEvaluacionUpdate")) { this.jButtonid_pregunta_evaluacionSubPreguntaEvaluacionUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_pregunta_evaluacionSubPreguntaEvaluacionBusqueda")) { this.jButtonid_pregunta_evaluacionSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_ejercicioSubPreguntaEvaluacionUpdate")) { this.jButtonid_ejercicioSubPreguntaEvaluacionUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_ejercicioSubPreguntaEvaluacionBusqueda")) { this.jButtonid_ejercicioSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_periodoSubPreguntaEvaluacionUpdate")) { this.jButtonid_periodoSubPreguntaEvaluacionUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_periodoSubPreguntaEvaluacionBusqueda")) { this.jButtonid_periodoSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("ordenSubPreguntaEvaluacionBusqueda")) { this.jButtonordenSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("preguntaSubPreguntaEvaluacionBusqueda")) { this.jButtonpreguntaSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("porcentaje_siSubPreguntaEvaluacionBusqueda")) { this.jButtonporcentaje_siSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("con_facturaSubPreguntaEvaluacionBusqueda")) { this.jButtoncon_facturaSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("con_orden_compraSubPreguntaEvaluacionBusqueda")) { this.jButtoncon_orden_compraSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("con_completoSubPreguntaEvaluacionBusqueda")) { this.jButtoncon_completoSubPreguntaEvaluacionBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("con_a_tiempoSubPreguntaEvaluacionBusqueda")) { this.jButtoncon_a_tiempoSubPreguntaEvaluacionBusquedaActionPerformed(evt); } SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.KEY,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { this.finishProcessSubPreguntaEvaluacion(); } } public void internalFrameClosingInternalFrameGeneral(String sTipo,InternalFrameEvent evt) { try { SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.WINDOW,EventoTipo.CLIC,EventoSubTipo.CLOSING,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); if(sTipo.equals("CloseInternalFrameSubPreguntaEvaluacion")) { closingInternalFrameSubPreguntaEvaluacion(); } else if(sTipo.equals("jButtonCancelarSubPreguntaEvaluacion")) { JInternalFrameBase jInternalFrameDetalleFormSubPreguntaEvaluacion = (JInternalFrameBase)evt.getSource(); SubPreguntaEvaluacionBeanSwingJInternalFrame jInternalFrameParent=(SubPreguntaEvaluacionBeanSwingJInternalFrame)jInternalFrameDetalleFormSubPreguntaEvaluacion.getjInternalFrameParent(); jInternalFrameParent.jButtonCancelarSubPreguntaEvaluacionActionPerformed(null); } SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.WINDOW,EventoTipo.CLIC,EventoSubTipo.CLOSING,sTipo,this.subpreguntaevaluacion,new Object(),this.subpreguntaevaluacionParameterGeneral,this.subpreguntaevaluacionReturnGeneral); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void recargarFormSubPreguntaEvaluacion(String sTipo,String sDominio,EventoGlobalTipo eventoGlobalTipo,ControlTipo controlTipo,EventoTipo eventoTipo,EventoSubTipo eventoSubTipo,String sTipoGeneral,ArrayList<Classe> classes,Boolean conIrServidorAplicacion) throws Exception { this.recargarFormSubPreguntaEvaluacion(sTipo,sDominio,eventoGlobalTipo,controlTipo,eventoTipo,eventoSubTipo,sTipoGeneral,classes,conIrServidorAplicacion,false); } public void recargarFormSubPreguntaEvaluacion(String sTipo,String sDominio,EventoGlobalTipo eventoGlobalTipo,ControlTipo controlTipo,EventoTipo eventoTipo,EventoSubTipo eventoSubTipo,String sTipoGeneral,ArrayList<Classe> classes,Boolean conIrServidorAplicacion,Boolean esControlTabla) throws Exception { if(this.permiteRecargarForm && this.permiteMantenimiento(this.subpreguntaevaluacion)) { if(!esControlTabla) { if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL_TABLA) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true,false); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } if(this.subpreguntaevaluacionSessionBean.getEstaModoGuardarRelaciones()) { this.setVariablesFormularioRelacionesToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,classes); } if(conIrServidorAplicacion) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionReturnGeneral=subpreguntaevaluacionLogic.procesarEventosSubPreguntaEvaluacionsWithConnection(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,eventoGlobalTipo,controlTipo,eventoTipo,eventoSubTipo,sTipo,this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions(),this.subpreguntaevaluacion,this.subpreguntaevaluacionParameterGeneral,this.isEsNuevoSubPreguntaEvaluacion,classes);//this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacion()//sTipoGeneral } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE //ACTUALIZA VARIABLES DEFECTO DESDE LOGIC A RETURN GENERAL Y LUEGO A BEAN //this.setVariablesObjetoReturnGeneralToBeanSubPreguntaEvaluacion(this.subpreguntaevaluacionReturnGeneral,this.subpreguntaevaluacionBean,false); //ACTUALIZA VARIABLES RELACIONES DEFECTO DESDE LOGIC A RETURN GENERAL Y LUEGO A BEAN if(this.subpreguntaevaluacionSessionBean.getEstaModoGuardarRelaciones()) { //this.setVariablesRelacionesObjetoReturnGeneralToBeanSubPreguntaEvaluacion(classes,this.subpreguntaevaluacionReturnGeneral,this.subpreguntaevaluacionBean,false); } if(this.subpreguntaevaluacionReturnGeneral.getConRecargarPropiedades()) { //INICIALIZA VARIABLES COMBOS NORMALES (FK) this.setVariablesObjetoActualToFormularioForeignKeySubPreguntaEvaluacion(this.subpreguntaevaluacionReturnGeneral.getSubPreguntaEvaluacion()); //INICIALIZA VARIABLES NORMALES A FORMULARIO(SIN FK) this.setVariablesObjetoActualToFormularioSubPreguntaEvaluacion(this.subpreguntaevaluacionReturnGeneral.getSubPreguntaEvaluacion()); } if(this.subpreguntaevaluacionReturnGeneral.getConRecargarRelaciones()) { //INICIALIZA VARIABLES RELACIONES A FORMULARIO this.setVariablesRelacionesObjetoActualToFormularioSubPreguntaEvaluacion(this.subpreguntaevaluacionReturnGeneral.getSubPreguntaEvaluacion(),classes);//this.subpreguntaevaluacionBean); } } else { //INICIALIZA VARIABLES RELACIONES A FORMULARIO this.setVariablesRelacionesObjetoActualToFormularioSubPreguntaEvaluacion(this.subpreguntaevaluacion,classes);//this.subpreguntaevaluacionBean); } if(SubPreguntaEvaluacionJInternalFrame.ISBINDING_MANUAL_TABLA) { this.setVariablesFormularioToObjetoActualSubPreguntaEvaluacion(this.subpreguntaevaluacion,true,false); this.setVariablesFormularioToObjetoActualForeignKeysSubPreguntaEvaluacion(this.subpreguntaevaluacion); } } else { if(((controlTipo.equals(ControlTipo.TEXTBOX) || controlTipo.equals(ControlTipo.DATE) || controlTipo.equals(ControlTipo.TEXTAREA) || controlTipo.equals(ControlTipo.COMBOBOX) ) && eventoTipo.equals(EventoTipo.CHANGE) ) || (controlTipo.equals(ControlTipo.CHECKBOX) && eventoTipo.equals(EventoTipo.CLIC)) ) { // && sTipoGeneral.equals("TEXTBOX") if(this.subpreguntaevaluacionAnterior!=null) { this.subpreguntaevaluacion=this.subpreguntaevaluacionAnterior; } } if(conIrServidorAplicacion) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionReturnGeneral=subpreguntaevaluacionLogic.procesarEventosSubPreguntaEvaluacionsWithConnection(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,eventoGlobalTipo,controlTipo,eventoTipo,eventoSubTipo,sTipo,this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions(),this.subpreguntaevaluacion,this.subpreguntaevaluacionParameterGeneral,this.isEsNuevoSubPreguntaEvaluacion,classes);//this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacion()//sTipoGeneral } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //NO ENTENDIBLE PORQUE PONER //if(this.subpreguntaevaluacionSessionBean.getEstaModoGuardarRelaciones() // || this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { actualizarLista(this.subpreguntaevaluacionReturnGeneral.getSubPreguntaEvaluacion(),subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); //} } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { actualizarLista(this.subpreguntaevaluacionReturnGeneral.getSubPreguntaEvaluacion(),this.subpreguntaevaluacions); } //ARCHITECTURE //this.jTableDatosSubPreguntaEvaluacion.repaint(); //((AbstractTableModel) this.jTableDatosSubPreguntaEvaluacion.getModel()).fireTableDataChanged(); this.actualizarVisualTableDatosSubPreguntaEvaluacion(); } } } public void actualizarVisualTableDatosSubPreguntaEvaluacion() throws Exception { SubPreguntaEvaluacionModel subpreguntaevaluacionModel=(SubPreguntaEvaluacionModel)this.jTableDatosSubPreguntaEvaluacion.getModel(); if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionModel.subpreguntaevaluacions=this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions(); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { subpreguntaevaluacionModel.subpreguntaevaluacions=this.subpreguntaevaluacions; } ((SubPreguntaEvaluacionModel) this.jTableDatosSubPreguntaEvaluacion.getModel()).fireTableDataChanged(); } public void actualizarVisualTableDatosEventosVistaSubPreguntaEvaluacion() throws Exception { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.actualizarLista(this.getsubpreguntaevaluacionAnterior(),this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { this.actualizarLista(this.getsubpreguntaevaluacionAnterior(),this.subpreguntaevaluacions); } //ARCHITECTURE this.actualizarFilaTotales(); this.actualizarVisualTableDatosSubPreguntaEvaluacion(); } public void setVariablesRelacionesObjetoActualToFormularioSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion,ArrayList<Classe> classes) throws Exception { try { for(Classe clas:classes) { if(clas.clas.equals(DetalleEvaluacionProveedor.class)) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.setDetalleEvaluacionProveedors(subpreguntaevaluacion.getDetalleEvaluacionProveedors()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.inicializarActualizarBindingTablaDetalleEvaluacionProveedor(false); break; } } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void setEventoParentGeneral(Boolean esUsoDesdeHijo,String sDominio,String sDominioTipo,String sTipo,String sTipoGeneral,Boolean esControlTabla,Boolean conIrServidorAplicacion, Long id,Component control, EventoGlobalTipo eventoGlobalTipo,ControlTipo controlTipo,EventoTipo eventoTipo,EventoSubTipo eventoSubTipo,ArrayList<String> arrClasses, Object evt,GeneralEntityParameterReturnGeneral generalEntityParameterGeneral,Object otro) { try { if(this.permiteManejarEventosControl()) { //BASE COPIADO DESDE TEXTFIELLOSTFOCUS //EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; Boolean conTodasRelaciones=false; this.esUsoDesdeHijo=esUsoDesdeHijo; SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,controlTipo,eventoTipo,eventoSubTipo,sTipo,this.subpreguntaevaluacion,new Object(),generalEntityParameterGeneral,this.subpreguntaevaluacionReturnGeneral); ArrayList<Classe> classes=new ArrayList<Classe>(); for(String sClasse:arrClasses) { if(sClasse.equals("TODOS")) { conTodasRelaciones=true; break; } } if(this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { if(conTodasRelaciones) { classes=SubPreguntaEvaluacionConstantesFunciones.getClassesRelationshipsOfSubPreguntaEvaluacion(new ArrayList<Classe>(),DeepLoadType.NONE); } else { classes=SubPreguntaEvaluacionConstantesFunciones.getClassesRelationshipsFromStringsOfSubPreguntaEvaluacion(arrClasses,DeepLoadType.NONE); } } this.classesActual=new ArrayList<Classe>(); this.classesActual.addAll(classes); this.recargarFormSubPreguntaEvaluacion(sTipo,sDominio,eventoGlobalTipo,controlTipo,eventoTipo,eventoSubTipo,sTipoGeneral,classes,conIrServidorAplicacion,esControlTabla); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,controlTipo,eventoTipo,eventoSubTipo,sTipo,this.subpreguntaevaluacion,new Object(),generalEntityParameterGeneral,this.subpreguntaevaluacionReturnGeneral); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } /* public void setVariablesRelacionesObjetoBeanActualToFormularioSubPreguntaEvaluacion(SubPreguntaEvaluacionBean subpreguntaevaluacionBean) throws Exception { try { for(Classe clas:classes) { if(clas.clas.equals(DetalleEvaluacionProveedor.class)) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.setDetalleEvaluacionProveedors(subpreguntaevaluacion.getDetalleEvaluacionProveedors()); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.inicializarActualizarBindingTablaDetalleEvaluacionProveedor(false); break; } } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } */ /* public void setVariablesRelacionesObjetoReturnGeneralToBeanSubPreguntaEvaluacion(ArrayList<Classe> classes,SubPreguntaEvaluacionReturnGeneral subpreguntaevaluacionReturnGeneral,SubPreguntaEvaluacionBean subpreguntaevaluacionBean,Boolean conDefault) throws Exception { this.subpreguntaevaluacionBean.setDetalleEvaluacionProveedors(subpreguntaevaluacionReturnGeneral.getSubPreguntaEvaluacion().getDetalleEvaluacionProveedors()); } */ public void setVariablesFormularioRelacionesToObjetoActualSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion,ArrayList<Classe> classes) throws Exception { for(Classe clas:classes) { if(clas.clas.equals(DetalleEvaluacionProveedor.class)) { subpreguntaevaluacion.setDetalleEvaluacionProveedors(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorBeanSwingJInternalFrame.detalleevaluacionproveedorLogic.getDetalleEvaluacionProveedors()); break; } } } public Boolean permiteManejarEventosControl() { Boolean permite=true; if(this.estaModoNuevo || this.estaModoSeleccionar || this.estaModoEliminarGuardarCambios) { permite=false; } //NO DEBE MEZCLARSE CONCEPTOS /* if(!paraTabla && !this.permiteMantenimiento(this.subpreguntaevaluacion)) { System.out.println("ERROR:EL OBJETO ACTUAL NO PUEDE SER FILA TOTALES"); //JOptionPane.showMessageDialog(this,"EL OBJETO ACTUAL NO PUEDE SER FILA TOTALES","EVENTO",JOptionPane.ERROR_MESSAGE); } */ return permite; } public void inicializarFormDetalle() throws Exception { this.jInternalFrameDetalleFormSubPreguntaEvaluacion = new SubPreguntaEvaluacionDetalleFormJInternalFrame(jDesktopPane,this.subpreguntaevaluacionSessionBean.getConGuardarRelaciones(),this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado(),this.cargarRelaciones,usuarioActual,resumenUsuarioActual,moduloActual,opcionActual,parametroGeneralSg,parametroGeneralUsuario,paginaTipo); this.jDesktopPane.add(this.jInternalFrameDetalleFormSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setVisible(false); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setSelected(false); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.setJInternalFrameParent(this); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.subpreguntaevaluacionLogic=this.subpreguntaevaluacionLogic; this.cargarCombosFrameForeignKeySubPreguntaEvaluacion("Formulario"); this.inicializarActualizarBindingBotonesPermisosManualFormDetalleSubPreguntaEvaluacion(); this.inicializarActualizarBindingtiposArchivosReportesAccionesManualFormDetalleSubPreguntaEvaluacion(); this.initActionsFormDetalle(); this.initActionsCombosTodosForeignKeySubPreguntaEvaluacion("Formulario"); //TALVEZ conSetVariablesGlobales COMO if() this.setVariablesGlobalesCombosForeignKeySubPreguntaEvaluacion(); this.cargarMenuRelaciones(); } public void initActionsFormDetalle() { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.addInternalFrameListener(new InternalFrameInternalFrameAdapter(this,"jButtonCancelarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonModificarSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"ModificarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonModificarToolBarSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"ModificarToolBarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemModificarSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"MenuItemModificarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonActualizarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"ActualizarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonActualizarToolBarSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"ActualizarToolBarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemActualizarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemActualizarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonEliminarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"EliminarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonEliminarToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"EliminarToolBarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemEliminarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemEliminarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonCancelarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"CancelarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonCancelarToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"CancelarToolBarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemCancelarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemCancelarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemDetalleCerrarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemDetalleCerrarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonGuardarCambiosToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"GuardarCambiosToolBarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonGuardarCambiosToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"GuardarCambiosToolBarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"TiposAccionesFormularioSubPreguntaEvaluacion")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonidSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"idSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_empresaSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_empresaSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_empresaSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_empresaSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_sucursalSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_sucursalSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_sucursalSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_sucursalSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_pregunta_evaluacionSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_pregunta_evaluacionSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_pregunta_evaluacionSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_pregunta_evaluacionSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_ejercicioSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_ejercicioSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_ejercicioSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_ejercicioSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_periodoSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_periodoSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_periodoSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_periodoSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonordenSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"ordenSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonpreguntaSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"preguntaSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonporcentaje_siSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"porcentaje_siSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtoncon_facturaSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"con_facturaSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtoncon_orden_compraSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"con_orden_compraSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtoncon_completoSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"con_completoSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtoncon_a_tiempoSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"con_a_tiempoSubPreguntaEvaluacionBusqueda")); ; //TABBED PANE RELACIONES this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTabbedPaneRelacionesSubPreguntaEvaluacion.addChangeListener(new TabbedPaneChangeListener(this,"RelacionesSubPreguntaEvaluacion")); ; //TABBED PANE RELACIONES FIN(EXTRA TAB) } public void initActions() { this.addInternalFrameListener(new InternalFrameInternalFrameAdapter(this,"CloseInternalFrameSubPreguntaEvaluacion")); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.addInternalFrameListener(new InternalFrameInternalFrameAdapter(this,"jButtonCancelarSubPreguntaEvaluacion")); } this.jTableDatosSubPreguntaEvaluacion.getSelectionModel().addListSelectionListener(new TableListSelectionListener(this,"TableDatosSeleccionarSubPreguntaEvaluacion")); this.jTableDatosSubPreguntaEvaluacion.addMouseListener(new TableMouseAdapter(this,"DatosSeleccionarSubPreguntaEvaluacion")); this.jButtonNuevoSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"NuevoSubPreguntaEvaluacion")); this.jButtonDuplicarSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"DuplicarSubPreguntaEvaluacion")); this.jButtonCopiarSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"CopiarSubPreguntaEvaluacion")); this.jButtonVerFormSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"VerFormSubPreguntaEvaluacion")); this.jButtonNuevoToolBarSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"NuevoToolBarSubPreguntaEvaluacion")); this.jButtonDuplicarToolBarSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"DuplicarToolBarSubPreguntaEvaluacion")); this.jMenuItemNuevoSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemNuevoSubPreguntaEvaluacion")); this.jMenuItemDuplicarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemDuplicarSubPreguntaEvaluacion")); this.jButtonNuevoRelacionesSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"NuevoRelacionesSubPreguntaEvaluacion")); this.jButtonNuevoRelacionesToolBarSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"NuevoRelacionesToolBarSubPreguntaEvaluacion")); this.jMenuItemNuevoRelacionesSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"MenuItemNuevoRelacionesSubPreguntaEvaluacion")); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonModificarSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"ModificarSubPreguntaEvaluacion")); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonModificarToolBarSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"ModificarToolBarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemModificarSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"MenuItemModificarSubPreguntaEvaluacion")); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonActualizarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"ActualizarSubPreguntaEvaluacion")); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonActualizarToolBarSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"ActualizarToolBarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemActualizarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemActualizarSubPreguntaEvaluacion")); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonEliminarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"EliminarSubPreguntaEvaluacion")); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonEliminarToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"EliminarToolBarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemEliminarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemEliminarSubPreguntaEvaluacion")); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonCancelarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"CancelarSubPreguntaEvaluacion")); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonCancelarToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"CancelarToolBarSubPreguntaEvaluacion")); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemCancelarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemCancelarSubPreguntaEvaluacion")); } this.jButtonMostrarOcultarTablaToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MostrarOcultarToolBarSubPreguntaEvaluacion")); this.jButtonCerrarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"CerrarSubPreguntaEvaluacion")); this.jButtonCerrarToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"CerrarToolBarSubPreguntaEvaluacion")); this.jMenuItemCerrarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemCerrarSubPreguntaEvaluacion")); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jMenuItemDetalleCerrarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemDetalleCerrarSubPreguntaEvaluacion")); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonGuardarCambiosSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"GuardarCambiosSubPreguntaEvaluacion")); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonGuardarCambiosToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"GuardarCambiosToolBarSubPreguntaEvaluacion")); } this.jButtonCopiarToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"CopiarToolBarSubPreguntaEvaluacion")); this.jButtonVerFormToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"VerFormToolBarSubPreguntaEvaluacion")); this.jMenuItemGuardarCambiosSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemGuardarCambiosSubPreguntaEvaluacion")); this.jMenuItemCopiarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemCopiarSubPreguntaEvaluacion")); this.jMenuItemVerFormSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemVerFormSubPreguntaEvaluacion")); this.jButtonGuardarCambiosTablaSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"GuardarCambiosTablaSubPreguntaEvaluacion")); this.jButtonGuardarCambiosTablaToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"GuardarCambiosTablaToolBarSubPreguntaEvaluacion")); this.jMenuItemGuardarCambiosTablaSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"GuardarCambiosTablaSubPreguntaEvaluacion")); this.jButtonRecargarInformacionSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"RecargarInformacionSubPreguntaEvaluacion")); this.jButtonRecargarInformacionToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"RecargarInformacionToolBarSubPreguntaEvaluacion")); this.jMenuItemRecargarInformacionSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemRecargarInformacionSubPreguntaEvaluacion")); this.jButtonAnterioresSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"AnterioresSubPreguntaEvaluacion")); this.jButtonAnterioresToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"AnterioresToolBarSubPreguntaEvaluacion")); this.jMenuItemAnterioresSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemAnterioresSubPreguntaEvaluacion")); this.jButtonSiguientesSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"SiguientesSubPreguntaEvaluacion")); this.jButtonSiguientesToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"SiguientesToolBarSubPreguntaEvaluacion")); this.jMenuItemSiguientesSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemSiguientesSubPreguntaEvaluacion")); this.jMenuItemAbrirOrderBySubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemAbrirOrderBySubPreguntaEvaluacion")); this.jMenuItemMostrarOcultarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemMostrarOcultarSubPreguntaEvaluacion")); this.jMenuItemDetalleAbrirOrderBySubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemDetalleAbrirOrderBySubPreguntaEvaluacion")); this.jMenuItemDetalleMostarOcultarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemDetalleMostrarOcultarSubPreguntaEvaluacion")); this.jButtonNuevoGuardarCambiosSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"NuevoGuardarCambiosSubPreguntaEvaluacion")); this.jButtonNuevoGuardarCambiosToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"NuevoGuardarCambiosToolBarSubPreguntaEvaluacion")); this.jMenuItemNuevoGuardarCambiosSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"MenuItemNuevoGuardarCambiosSubPreguntaEvaluacion")); //SELECCIONAR TODOS this.jCheckBoxSeleccionarTodosSubPreguntaEvaluacion.addItemListener(new CheckBoxItemListener(this,"SeleccionarTodosSubPreguntaEvaluacion")); this.jCheckBoxSeleccionadosSubPreguntaEvaluacion.addItemListener(new CheckBoxItemListener(this,"SeleccionadosSubPreguntaEvaluacion")); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"TiposAccionesFormularioSubPreguntaEvaluacion")); } this.jComboBoxTiposRelacionesSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"TiposRelacionesSubPreguntaEvaluacion")); this.jComboBoxTiposAccionesSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"TiposAccionesSubPreguntaEvaluacion")); this.jComboBoxTiposSeleccionarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"TiposSeleccionarSubPreguntaEvaluacion")); this.jTextFieldValorCampoGeneralSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"ValorCampoGeneralSubPreguntaEvaluacion")); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonidSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"idSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_empresaSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_empresaSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_empresaSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_empresaSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_sucursalSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_sucursalSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_sucursalSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_sucursalSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_pregunta_evaluacionSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_pregunta_evaluacionSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_pregunta_evaluacionSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_pregunta_evaluacionSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_ejercicioSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_ejercicioSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_ejercicioSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_ejercicioSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_periodoSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_periodoSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_periodoSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_periodoSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonordenSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"ordenSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonpreguntaSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"preguntaSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonporcentaje_siSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"porcentaje_siSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtoncon_facturaSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"con_facturaSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtoncon_orden_compraSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"con_orden_compraSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtoncon_completoSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"con_completoSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtoncon_a_tiempoSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"con_a_tiempoSubPreguntaEvaluacionBusqueda")); } if(!this.conCargarMinimo) { //BYDAN_BUSQUEDAS this.jButtonFK_IdPreguntaEvaluacionSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"FK_IdPreguntaEvaluacionSubPreguntaEvaluacion")); //REPORTE DINAMICO if(this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion!=null) { this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjButtonCerrarReporteDinamico().addActionListener (new ButtonActionListener(this,"CerrarReporteDinamicoSubPreguntaEvaluacion")); this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjButtonGenerarReporteDinamico().addActionListener (new ButtonActionListener(this,"GenerarReporteDinamicoSubPreguntaEvaluacion")); this.jInternalFrameReporteDinamicoSubPreguntaEvaluacion.getjButtonGenerarExcelReporteDinamico().addActionListener (new ButtonActionListener(this,"GenerarExcelReporteDinamicoSubPreguntaEvaluacion")); } //this.jButtonCerrarReporteDinamicoSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"CerrarReporteDinamicoSubPreguntaEvaluacion")); //this.jButtonGenerarReporteDinamicoSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"GenerarReporteDinamicoSubPreguntaEvaluacion")); //this.jButtonGenerarExcelReporteDinamicoSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"GenerarExcelReporteDinamicoSubPreguntaEvaluacion")); //IMPORTACION if(this.jInternalFrameImportacionSubPreguntaEvaluacion!=null) { this.jInternalFrameImportacionSubPreguntaEvaluacion.getjButtonCerrarImportacion().addActionListener (new ButtonActionListener(this,"CerrarImportacionSubPreguntaEvaluacion")); this.jInternalFrameImportacionSubPreguntaEvaluacion.getjButtonGenerarImportacion().addActionListener (new ButtonActionListener(this,"GenerarImportacionSubPreguntaEvaluacion")); this.jInternalFrameImportacionSubPreguntaEvaluacion.getjButtonAbrirImportacion().addActionListener (new ButtonActionListener(this,"AbrirImportacionSubPreguntaEvaluacion")); } //ORDER BY this.jButtonAbrirOrderBySubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"AbrirOrderBySubPreguntaEvaluacion")); this.jButtonAbrirOrderByToolBarSubPreguntaEvaluacion.addActionListener (new ButtonActionListener(this,"AbrirOrderByToolBarSubPreguntaEvaluacion")); if(this.jInternalFrameOrderBySubPreguntaEvaluacion!=null) { this.jInternalFrameOrderBySubPreguntaEvaluacion.getjButtonCerrarOrderBy().addActionListener (new ButtonActionListener(this,"CerrarOrderBySubPreguntaEvaluacion")); } } if(!this.conCargarMinimo) { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { ; } } //TABBED PANE RELACIONES if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTabbedPaneRelacionesSubPreguntaEvaluacion.addChangeListener(new TabbedPaneChangeListener(this,"RelacionesSubPreguntaEvaluacion")); ; } //TABBED PANE RELACIONES FIN(EXTRA TAB) } /* public void initActions() { String sMapKey = ""; InputMap inputMap =null; this.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() { public void internalFrameClosing(InternalFrameEvent event) { try { closingInternalFrameSubPreguntaEvaluacion(); } catch (Exception e) { e.printStackTrace(); } } }); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() { public void internalFrameClosing(InternalFrameEvent event) { JInternalFrameBase jInternalFrameDetalleFormSubPreguntaEvaluacion = (JInternalFrameBase)event.getSource(); SubPreguntaEvaluacionBeanSwingJInternalFrame jInternalFrameParent=(SubPreguntaEvaluacionBeanSwingJInternalFrame)jInternalFrameDetalleFormSubPreguntaEvaluacion.getjInternalFrameParent(); try { jInternalFrameParent.jButtonCancelarSubPreguntaEvaluacionActionPerformed(null); //jInternalFrameParent.dispose(); //jInternalFrameParent=null; } catch (Exception e) { e.printStackTrace(); } } }); this.jTableDatosSubPreguntaEvaluacion.getSelectionModel().addListSelectionListener ( new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //BYDAN_DESHABILITADO //try {jTableDatosSubPreguntaEvaluacionListSelectionListener(e);}catch(Exception e1){e1.printStackTrace();} } } ); this.jTableDatosSubPreguntaEvaluacion.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { if (evt.getClickCount() == 2) { jButtonIdActionPerformed(null,jTableDatosSubPreguntaEvaluacion.getSelectedRow(),false,false); } } }); this.jButtonNuevoSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,false);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonNuevoToolBarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,false);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemNuevoSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,false);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "NuevoSubPreguntaEvaluacion"; inputMap = this.jButtonNuevoSubPreguntaEvaluacion.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_N , KeyEvent.CTRL_MASK), sMapKey); this.jButtonNuevoSubPreguntaEvaluacion.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,false);} catch (Exception e) {e.printStackTrace();} } }); this.jButtonNuevoRelacionesSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,true);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonNuevoRelacionesToolBarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,true);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemNuevoRelacionesSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,true);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "NuevoRelacionesSubPreguntaEvaluacion"; inputMap = this.jButtonNuevoRelacionesSubPreguntaEvaluacion.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_R , KeyEvent.CTRL_MASK), sMapKey); this.jButtonNuevoRelacionesSubPreguntaEvaluacion.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonNuevoSubPreguntaEvaluacionActionPerformed(evt,true);} catch (Exception e) {e.printStackTrace();} } }); this.jButtonModificarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonModificarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonModificarToolBarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonModificarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemModificarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonModificarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "ModificarSubPreguntaEvaluacion"; inputMap = this.jButtonModificarSubPreguntaEvaluacion.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_M , KeyEvent.CTRL_MASK), sMapKey); this.jButtonModificarSubPreguntaEvaluacion.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonModificarSubPreguntaEvaluacionActionPerformed(evt);} catch (Exception e) {e.printStackTrace();} } }); this.jButtonActualizarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonActualizarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonActualizarToolBarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonActualizarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemActualizarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonActualizarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "ActualizarSubPreguntaEvaluacion"; inputMap = this.jButtonActualizarSubPreguntaEvaluacion.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_G , KeyEvent.CTRL_MASK), sMapKey); this.jButtonActualizarSubPreguntaEvaluacion.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonActualizarSubPreguntaEvaluacionActionPerformed(evt);} catch (Exception e) {e.printStackTrace();} } }); this.jButtonEliminarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonEliminarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonEliminarToolBarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonEliminarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemEliminarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonEliminarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "EliminarSubPreguntaEvaluacion"; inputMap = this.jButtonEliminarSubPreguntaEvaluacion.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_E , KeyEvent.CTRL_MASK), sMapKey); this.jButtonEliminarSubPreguntaEvaluacion.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonEliminarSubPreguntaEvaluacionActionPerformed(evt);} catch (Exception e) {e.printStackTrace();} } }); this.jButtonCancelarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCancelarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonCancelarToolBarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCancelarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemCancelarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCancelarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "CancelarSubPreguntaEvaluacion"; inputMap = this.jButtonCancelarSubPreguntaEvaluacion.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_Q , KeyEvent.CTRL_MASK), sMapKey); this.jButtonCancelarSubPreguntaEvaluacion.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonCancelarSubPreguntaEvaluacionActionPerformed(evt);} catch (Exception e) {e.printStackTrace();} } }); this.jButtonCerrarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCerrarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonCerrarToolBarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCerrarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemCerrarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCerrarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemDetalleCerrarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { //try {jButtonCerrarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} try {jButtonCancelarSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "CerrarSubPreguntaEvaluacion"; inputMap = this.jButtonCerrarSubPreguntaEvaluacion.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C , KeyEvent.ALT_MASK), sMapKey); this.jButtonCerrarSubPreguntaEvaluacion.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonCerrarSubPreguntaEvaluacionActionPerformed(evt);} catch (Exception e) {e.printStackTrace();} } }); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonGuardarCambiosSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonGuardarCambiosToolBarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemGuardarCambiosSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonGuardarCambiosTablaSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonGuardarCambiosTablaToolBarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemGuardarCambiosTablaSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "GuardarCambiosSubPreguntaEvaluacion"; inputMap = this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonGuardarCambiosSubPreguntaEvaluacion.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_G , KeyEvent.CTRL_MASK), sMapKey); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonGuardarCambiosSubPreguntaEvaluacion.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt);} catch (Exception e) {e.printStackTrace();} } }); this.jButtonRecargarInformacionSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonRecargarInformacionSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonRecargarInformacionToolBarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonRecargarInformacionSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemRecargarInformacionSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonRecargarInformacionSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonAnterioresSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonAnterioresSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonAnterioresToolBarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonAnterioresSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemAnterioresSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonAnterioresSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonSiguientesSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonSiguientesSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonSiguientesToolBarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonSiguientesSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemSiguientesSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonSiguientesSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonNuevoGuardarCambiosSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonNuevoGuardarCambiosToolBarSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemNuevoGuardarCambiosSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoGuardarCambiosSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); //SELECCIONAR TODOS this.jCheckBoxSeleccionarTodosSubPreguntaEvaluacion.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent evt) { try {jCheckBoxSeleccionarTodosSubPreguntaEvaluacionItemListener(evt);}catch(Exception e){e.printStackTrace();} } }); this.jComboBoxTiposAccionesSubPreguntaEvaluacion.addActionListener (new ActionListener () { public void actionPerformed(ActionEvent e) { try {jComboBoxTiposAccionesSubPreguntaEvaluacionActionListener(e);} catch (Exception e1) { e1.printStackTrace();} }; }); this.jComboBoxTiposSeleccionarSubPreguntaEvaluacion.addActionListener (new ActionListener () { public void actionPerformed(ActionEvent e) { try {jComboBoxTiposSeleccionarSubPreguntaEvaluacionActionListener(e);} catch (Exception e1) { e1.printStackTrace();} }; }); this.jTextFieldValorCampoGeneralSubPreguntaEvaluacion.addActionListener (new ActionListener () { public void actionPerformed(ActionEvent e) { try {jTextFieldValorCampoGeneralSubPreguntaEvaluacionActionListener(e);} catch (Exception e1) { e1.printStackTrace();} }; }); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonidSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"idSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_empresaSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_empresaSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_empresaSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_empresaSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_sucursalSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_sucursalSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_sucursalSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_sucursalSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_pregunta_evaluacionSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_pregunta_evaluacionSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_pregunta_evaluacionSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_pregunta_evaluacionSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_ejercicioSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_ejercicioSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_ejercicioSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_ejercicioSubPreguntaEvaluacionBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_periodoSubPreguntaEvaluacionUpdate.addActionListener(new ButtonActionListener(this,"id_periodoSubPreguntaEvaluacionUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonid_periodoSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"id_periodoSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonordenSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"ordenSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonpreguntaSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"preguntaSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtonporcentaje_siSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"porcentaje_siSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtoncon_facturaSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"con_facturaSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtoncon_orden_compraSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"con_orden_compraSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtoncon_completoSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"con_completoSubPreguntaEvaluacionBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jButtoncon_a_tiempoSubPreguntaEvaluacionBusqueda.addActionListener(new ButtonActionListener(this,"con_a_tiempoSubPreguntaEvaluacionBusqueda")); this.jButtonFK_IdPreguntaEvaluacionSubPreguntaEvaluacion.addActionListener(new ButtonActionListener(this,"FK_IdPreguntaEvaluacionSubPreguntaEvaluacion")); //REPORTE DINAMICO this.jButtonCerrarReporteDinamicoSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCerrarReporteDinamicoSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonGenerarReporteDinamicoSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGenerarReporteDinamicoSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonGenerarExcelReporteDinamicoSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGenerarExcelReporteDinamicoSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); //IMPORTACION this.jButtonCerrarImportacionSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCerrarImportacionSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonGenerarImportacionSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGenerarImportacionSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonAbrirImportacionSubPreguntaEvaluacion.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonAbrirImportacionSubPreguntaEvaluacionActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); } */ public void jComboBoxTiposSeleccionarSubPreguntaEvaluacionActionListener(ActionEvent evt) throws Exception { try { Reporte reporte=(Reporte)this.jComboBoxTiposSeleccionarSubPreguntaEvaluacion.getSelectedItem(); //if(reporte.getsCodigo().equals("SELECCIONAR")) { //} } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void seleccionarTodosSubPreguntaEvaluacion(Boolean conSeleccionarTodos) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()) { subpreguntaevaluacionAux.setIsSelected(conSeleccionarTodos); } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:subpreguntaevaluacions) { subpreguntaevaluacionAux.setIsSelected(conSeleccionarTodos); } } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jCheckBoxSeleccionarTodosSubPreguntaEvaluacionItemListener(ItemEvent evt) throws Exception { try { this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); //JCheckBox jCheckBox=(JCheckBox)evt.getSource(); //System.out.println("ok"); Boolean existe=false; if(sTipoSeleccionar.equals("COLUMNAS")) { existe=true; if(Constantes.ISUSAEJBLOGICLAYER) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()) { subpreguntaevaluacionAux.setIsSelected(this.isSeleccionarTodos); } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:subpreguntaevaluacions) { subpreguntaevaluacionAux.setIsSelected(this.isSeleccionarTodos); } } } else { if(Constantes.ISUSAEJBLOGICLAYER) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()) { if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA)) { existe=true; subpreguntaevaluacionAux.setcon_factura(this.isSeleccionarTodos); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA)) { existe=true; subpreguntaevaluacionAux.setcon_orden_compra(this.isSeleccionarTodos); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO)) { existe=true; subpreguntaevaluacionAux.setcon_completo(this.isSeleccionarTodos); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO)) { existe=true; subpreguntaevaluacionAux.setcon_a_tiempo(this.isSeleccionarTodos); } } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:subpreguntaevaluacions) { if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA)) { existe=true; subpreguntaevaluacionAux.setcon_factura(this.isSeleccionarTodos); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA)) { existe=true; subpreguntaevaluacionAux.setcon_orden_compra(this.isSeleccionarTodos); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO)) { existe=true; subpreguntaevaluacionAux.setcon_completo(this.isSeleccionarTodos); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO)) { existe=true; subpreguntaevaluacionAux.setcon_a_tiempo(this.isSeleccionarTodos); } } } } if(existe) { this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); } else { JOptionPane.showMessageDialog(this,"NO SE HA SELECCIONADO ALGUNA COLUMNA VALIDA","SELECCIONAR",JOptionPane.ERROR_MESSAGE); } //TableCellRenderer tableCellRenderer=null; //TableCellEditor tableCellEditor=null; //FUNCIONA CON MODEL PERO SE DANA MANTENIMIENTO /* for(int i = 0; i < this.jTableDatosSubPreguntaEvaluacion.getRowCount(); i++) { tableCellRenderer=this.jTableDatosSistema.getCellRenderer(i, 2); tableCellEditor=this.jTableDatosSistema.getCellEditor(i, 2); idSeleccionarTableCell=(IdSeleccionarTableCell)tableCellRenderer; idSeleccionarTableCell.jCheckBoxId.setSelected(jCheckBox.isSelected()); idSeleccionarTableCell=(IdSeleccionarTableCell)tableCellEditor; if(idSeleccionarTableCell.jCheckBoxId!=null) { idSeleccionarTableCell.jCheckBoxId.setSelected(jCheckBox.isSelected()); } //System.out.println(idSeleccionarTableCell.valor); //this.jTableDatosSubPreguntaEvaluacion.getModel().setValueAt(jCheckBox.isSelected(), i, Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,Constantes2.S_SELECCIONAR)); } */ } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jCheckBoxSeleccionadosSubPreguntaEvaluacionItemListener(ItemEvent evt) throws Exception { try { this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); //JCheckBox jCheckBox=(JCheckBox)evt.getSource(); //System.out.println("ok"); Boolean existe=false; int[] arrNumRowsSeleccionados=null; arrNumRowsSeleccionados=this.jTableDatosSubPreguntaEvaluacion.getSelectedRows(); SubPreguntaEvaluacion subpreguntaevaluacionLocal=new SubPreguntaEvaluacion(); //this.seleccionarTodosSubPreguntaEvaluacion(false); for(Integer iNumRowSeleccionado:arrNumRowsSeleccionados) { existe=true; if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionLocal =(SubPreguntaEvaluacion) this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions().toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(iNumRowSeleccionado)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { subpreguntaevaluacionLocal =(SubPreguntaEvaluacion) this.subpreguntaevaluacions.toArray()[this.jTableDatosSubPreguntaEvaluacion.convertRowIndexToModel(iNumRowSeleccionado)]; } subpreguntaevaluacionLocal.setIsSelected(this.isSeleccionados); } /* if(sTipoSeleccionar.equals("SELECCIONAR")) { existe=true; if(Constantes.ISUSAEJBLOGICLAYER) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()) { subpreguntaevaluacionAux.setIsSelected(this.isSeleccionados); } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:subpreguntaevaluacions) { subpreguntaevaluacionAux.setIsSelected(this.isSeleccionados); } } } */ //if(existe) { this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); /* } else { JOptionPane.showMessageDialog(this,"NO SE HA SELECCIONADO ALGUNA COLUMNA VALIDA","SELECCIONAR",JOptionPane.ERROR_MESSAGE); } */ //TableCellRenderer tableCellRenderer=null; //TableCellEditor tableCellEditor=null; //FUNCIONA CON MODEL PERO SE DANA MANTENIMIENTO /* for(int i = 0; i < this.jTableDatosSubPreguntaEvaluacion.getRowCount(); i++) { tableCellRenderer=this.jTableDatosSistema.getCellRenderer(i, 2); tableCellEditor=this.jTableDatosSistema.getCellEditor(i, 2); idSeleccionarTableCell=(IdSeleccionarTableCell)tableCellRenderer; idSeleccionarTableCell.jCheckBoxId.setSelected(jCheckBox.isSelected()); idSeleccionarTableCell=(IdSeleccionarTableCell)tableCellEditor; if(idSeleccionarTableCell.jCheckBoxId!=null) { idSeleccionarTableCell.jCheckBoxId.setSelected(jCheckBox.isSelected()); } //System.out.println(idSeleccionarTableCell.valor); //this.jTableDatosSubPreguntaEvaluacion.getModel().setValueAt(jCheckBox.isSelected(), i, Funciones2.getColumnIndexByName(this.jTableDatosSubPreguntaEvaluacion,Constantes2.S_SELECCIONAR)); } */ } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jCheckBoxSeleccionarActualSubPreguntaEvaluacionItemListener(ItemEvent evt,Long idActual) throws Exception { try { } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void ejecutarAuxiliarSubPreguntaEvaluacionParaAjaxPostBack() throws Exception { try { } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jTextFieldValorCampoGeneralSubPreguntaEvaluacionActionListener(ActionEvent evt) throws Exception { try { this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); //System.out.println(this.jTextFieldValorCampoGeneralSubPreguntaEvaluacion.getText()); Boolean existe=false; if(Constantes.ISUSAEJBLOGICLAYER) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()) { if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN)) { existe=true; subpreguntaevaluacionAux.setorden(Integer.parseInt(this.sValorCampoGeneral)); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA)) { existe=true; subpreguntaevaluacionAux.setpregunta(this.sValorCampoGeneral); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI)) { existe=true; subpreguntaevaluacionAux.setporcentaje_si(Double.parseDouble(this.sValorCampoGeneral)); } } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:subpreguntaevaluacions) { if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN)) { existe=true; subpreguntaevaluacionAux.setorden(Integer.parseInt(this.sValorCampoGeneral)); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA)) { existe=true; subpreguntaevaluacionAux.setpregunta(this.sValorCampoGeneral); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI)) { existe=true; subpreguntaevaluacionAux.setporcentaje_si(Double.parseDouble(this.sValorCampoGeneral)); } } } if(existe) { this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); } else { JOptionPane.showMessageDialog(this,"NO SE HA SELECCIONADO ALGUNA COLUMNA VALIDA","SELECCIONAR",JOptionPane.ERROR_MESSAGE); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void jComboBoxTiposAccionesSubPreguntaEvaluacionActionListener(ActionEvent evt,Boolean esParaAccionDesdeFormulario) throws Exception { Boolean conSplash=true; try { this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); Reporte reporte=new Reporte(); this.esParaAccionDesdeFormularioSubPreguntaEvaluacion=esParaAccionDesdeFormulario; if(!esParaAccionDesdeFormulario) { reporte=(Reporte)this.jComboBoxTiposAccionesSubPreguntaEvaluacion.getSelectedItem(); } else { reporte=(Reporte)this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.getSelectedItem(); } String sTipoAccionLocal=this.sTipoAccion; if(!esParaAccionDesdeFormulario) { sTipoAccionLocal=this.sTipoAccion; } else { sTipoAccionLocal=this.sTipoAccionFormulario; } if(sTipoAccionLocal.equals("GENERAR REPORTE")) {//reporte.getsCodigo().equals("GENERAR REPORTE")) { if(this.isPermisoReporteSubPreguntaEvaluacion) { conSplash=true;//false; //this.startProcessSubPreguntaEvaluacion(conSplash); this.generarReporteSubPreguntaEvaluacionsSeleccionados(); } else { JOptionPane.showMessageDialog(this,"NO TIENE PERMISO PARA GENERAR REPORTES","REPORTE",JOptionPane.ERROR_MESSAGE); } if(!esParaAccionDesdeFormulario) { this.jComboBoxTiposAccionesSubPreguntaEvaluacion.setSelectedIndex(0); } else { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.setSelectedIndex(0); } } else if(sTipoAccionLocal.equals("GENERAR REPORTE DINAMICO")) {//reporte.getsCodigo().equals("GENERAR_REPORTE_GROUP_GENERICO")) { //SE GENERA REPORTE SEGUN TIPO REPORTE SELECCIONADO //this.mostrarReporteDinamicoSubPreguntaEvaluacionsSeleccionados(); //this.jComboBoxTiposAccionesSubPreguntaEvaluacion.setSelectedIndex(0); } else if(sTipoAccionLocal.equals("GENERAR_REPORTE_GROUP_GENERICO")) {//reporte.getsCodigo().equals("GENERAR_REPORTE_GROUP_GENERICO")) { //SE GENERA REPORTE SEGUN TIPO REPORTE SELECCIONADO //this.generarReporteGroupGenericoSubPreguntaEvaluacionsSeleccionados(false); //this.jComboBoxTiposAccionesSubPreguntaEvaluacion.setSelectedIndex(0); } else if(sTipoAccionLocal.equals("GENERAR_REPORTE_TOTALES_GROUP_GENERICO")) {//reporte.getsCodigo().equals("GENERAR_REPORTE_GROUP_GENERICO")) { //SE GENERA REPORTE SEGUN TIPO REPORTE SELECCIONADO //this.generarReporteGroupGenericoSubPreguntaEvaluacionsSeleccionados(true); //this.jComboBoxTiposAccionesSubPreguntaEvaluacion.setSelectedIndex(0); } else if(sTipoAccionLocal.equals("EXPORTAR_DATOS")) {//reporte.getsCodigo().equals("GENERAR_REPORTE_GROUP_GENERICO")) { //this.startProcessSubPreguntaEvaluacion(); this.exportarSubPreguntaEvaluacionsSeleccionados(); if(!esParaAccionDesdeFormulario) { this.jComboBoxTiposAccionesSubPreguntaEvaluacion.setSelectedIndex(0); } else { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.setSelectedIndex(0); } } else if(sTipoAccionLocal.equals("IMPORTAR_DATOS")) {//reporte.getsCodigo().equals("GENERAR_REPORTE_GROUP_GENERICO")) { this.mostrarImportacionSubPreguntaEvaluacions(); //this.importarSubPreguntaEvaluacions(); if(!esParaAccionDesdeFormulario) { this.jComboBoxTiposAccionesSubPreguntaEvaluacion.setSelectedIndex(0); } else { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.setSelectedIndex(0); } } else if(sTipoAccionLocal.equals("EXPORTAR_DATOS_EXCEL")) {//reporte.getsCodigo().equals("GENERAR_REPORTE_GROUP_GENERICO")) { //this.startProcessSubPreguntaEvaluacion(); //SE EXPORTA SEGUN TIPO ARCHIVO SELECCIONADO //this.exportarExcelSubPreguntaEvaluacionsSeleccionados(); //this.jComboBoxTiposAccionesSubPreguntaEvaluacion.setSelectedIndex(0); } else if(sTipoAccionLocal.equals("RECARGAR_FK")) {//reporte.getsCodigo().equals("GENERAR_REPORTE_GROUP_GENERICO")) { if(JOptionPane.showConfirmDialog(this, "ESTA SEGURO DE RECARGAR REFERENCIAS ?", "MANTENIMIENTO DE Sub Pregunta Evaluacion", JOptionPane.OK_CANCEL_OPTION) == 0) { //this.startProcessSubPreguntaEvaluacion(); if(!esParaAccionDesdeFormulario || (esParaAccionDesdeFormulario && this.isEsNuevoSubPreguntaEvaluacion)) { this.esRecargarFks=true; this.cargarCombosForeignKeySubPreguntaEvaluacion(false,false,false); this.esRecargarFks=false; JOptionPane.showMessageDialog(this,"PROCESO EJECUTADO CORRECTAMENTE","MANTENIMIENTO DE Sub Pregunta Evaluacion",JOptionPane.INFORMATION_MESSAGE); } else { JOptionPane.showMessageDialog(this,"ESTE PROCESO SOLO FUNCIONA AL INGRESAR UN NUEVO ELEMENTO","MANTENIMIENTO",JOptionPane.ERROR_MESSAGE); } } if(!esParaAccionDesdeFormulario) { this.jComboBoxTiposAccionesSubPreguntaEvaluacion.setSelectedIndex(0); } else { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.setSelectedIndex(0); } } else if(SubPreguntaEvaluacionBeanSwingJInternalFrame.EsProcesoReporte(reporte.getsCodigo())){ if(this.isPermisoReporteSubPreguntaEvaluacion) { if(this.tieneElementosSeleccionados()) { this.quitarFilaTotales(); conSplash=false; //this.startProcessSubPreguntaEvaluacion(conSplash); //this.actualizarParametrosGeneralSubPreguntaEvaluacion(); this.generarReporteProcesoAccionSubPreguntaEvaluacionsSeleccionados(reporte.getsCodigo()); if(!esParaAccionDesdeFormulario) { this.jComboBoxTiposAccionesSubPreguntaEvaluacion.setSelectedIndex(0); } else { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.setSelectedIndex(0); } } else { JOptionPane.showMessageDialog(this,"NO SE HA SELECCIONADO ALGUN ELEMENTO","SELECCIONAR",JOptionPane.ERROR_MESSAGE); } } else { JOptionPane.showMessageDialog(this,"NO TIENE PERMISO PARA GENERAR REPORTES","REPORTE",JOptionPane.ERROR_MESSAGE); } } else if(SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.EsProcesoAccionNormal(reporte.getsCodigo())){ if(this.tieneElementosSeleccionados()) { this.quitarFilaTotales(); if(JOptionPane.showConfirmDialog(this, "ESTA SEGURO DE PROCESAR "+reporte.getsDescripcion()+" EN PROCESO Sub Pregunta EvaluacionES SELECCIONADOS?", "MANTENIMIENTO DE Sub Pregunta Evaluacion", JOptionPane.OK_CANCEL_OPTION) == 0) { //this.startProcessSubPreguntaEvaluacion(); this.actualizarParametrosGeneralSubPreguntaEvaluacion(); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionReturnGeneral=subpreguntaevaluacionLogic.procesarAccionSubPreguntaEvaluacionsWithConnection(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,sTipoAccionLocal,this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions(),this.subpreguntaevaluacionParameterGeneral); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE this.procesarSubPreguntaEvaluacionReturnGeneral(); if(!esParaAccionDesdeFormulario) { this.jComboBoxTiposAccionesSubPreguntaEvaluacion.setSelectedIndex(0); } else { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.setSelectedIndex(0); } } } else { JOptionPane.showMessageDialog(this,"NO SE HA SELECCIONADO ALGUN ELEMENTO","SELECCIONAR",JOptionPane.ERROR_MESSAGE); } } else { if(this.tieneElementosSeleccionados()) { this.quitarFilaTotales(); this.actualizarParametrosGeneralSubPreguntaEvaluacion(); SubPreguntaEvaluacionBeanSwingJInternalFrameAdditional.ProcesarAccion(reporte.getsCodigo(),reporte.getsDescripcion(),this); this.procesarSubPreguntaEvaluacionReturnGeneral(); if(!esParaAccionDesdeFormulario) { this.jComboBoxTiposAccionesSubPreguntaEvaluacion.setSelectedIndex(0); } else { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxTiposAccionesFormularioSubPreguntaEvaluacion.setSelectedIndex(0); } } else { JOptionPane.showMessageDialog(this,"NO SE HA SELECCIONADO ALGUN ELEMENTO","SELECCIONAR",JOptionPane.ERROR_MESSAGE); } } } catch(Exception e) { this.esRecargarFks=false; FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { //this.finishProcessSubPreguntaEvaluacion(conSplash); } } public void jComboBoxTiposRelacionesSubPreguntaEvaluacionActionListener(ActionEvent evt) throws Exception { Boolean conSplash=true; try { this.startProcessSubPreguntaEvaluacion(); if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados=new ArrayList<SubPreguntaEvaluacion>(); SubPreguntaEvaluacion subpreguntaevaluacion=new SubPreguntaEvaluacion(); int rowIndex=-1;//CON ESTO SE DESHABILITA SELECCION POR INDICE this.inicializarActualizarBindingSubPreguntaEvaluacion(false,false); Reporte reporte=new Reporte(); reporte=(Reporte)this.jComboBoxTiposRelacionesSubPreguntaEvaluacion.getSelectedItem(); subpreguntaevaluacionsSeleccionados=this.getSubPreguntaEvaluacionsSeleccionados(true); //this.sTipoAccion; if(subpreguntaevaluacionsSeleccionados.size()==1) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:subpreguntaevaluacionsSeleccionados) { subpreguntaevaluacion=subpreguntaevaluacionAux; } if(this.sTipoAccion.equals("NONE")) { } else if(this.sTipoRelacion.equals("Detalle Evaluacion Proveedor")) { jButtonDetalleEvaluacionProveedorActionPerformed(null,rowIndex,true,false,subpreguntaevaluacion); } } else { JOptionPane.showMessageDialog(this,"SELECCIONE SOLO UN REGISTRO","RELACIONES",JOptionPane.ERROR_MESSAGE); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } finally { this.finishProcessSubPreguntaEvaluacion(); //this.finishProcessSubPreguntaEvaluacion(conSplash); } } public static Boolean EsProcesoReporte(String sTipoProceso) throws Exception { Boolean esProcesoAccionRepoorte=false; if(sTipoProceso.contains("REPORTE_")) { esProcesoAccionRepoorte=true; } return esProcesoAccionRepoorte; } public void procesarSubPreguntaEvaluacionReturnGeneral() throws Exception { if(this.subpreguntaevaluacionReturnGeneral.getConRetornoEstaProcesado()) { JOptionPane.showMessageDialog(this,this.subpreguntaevaluacionReturnGeneral.getsMensajeProceso(),"PROCESO",JOptionPane.INFORMATION_MESSAGE); } if(this.subpreguntaevaluacionReturnGeneral.getConMostrarMensaje()) { JOptionPane.showMessageDialog(this,this.subpreguntaevaluacionReturnGeneral.getsMensajeProceso(),"PROCESO",FuncionesSwing.getColorSelectedBackground(this.subpreguntaevaluacionReturnGeneral.getsTipoMensaje())); } if(this.subpreguntaevaluacionReturnGeneral.getConRecargarInformacion()) { this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } if(this.subpreguntaevaluacionReturnGeneral.getConRetornoLista() || this.subpreguntaevaluacionReturnGeneral.getConRetornoObjeto()) { if(this.subpreguntaevaluacionReturnGeneral.getConRetornoLista()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.setSubPreguntaEvaluacions(this.subpreguntaevaluacionReturnGeneral.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } if(this.subpreguntaevaluacionReturnGeneral.getConRetornoObjeto()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.subpreguntaevaluacionLogic.setSubPreguntaEvaluacion(this.subpreguntaevaluacionReturnGeneral.getSubPreguntaEvaluacion()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } this.inicializarActualizarBindingSubPreguntaEvaluacion(false); } } public void actualizarParametrosGeneralSubPreguntaEvaluacion() throws Exception { } public ArrayList<SubPreguntaEvaluacion> getSubPreguntaEvaluacionsSeleccionados(Boolean conSeleccionarTodosAutomatico) throws Exception { ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados=new ArrayList<SubPreguntaEvaluacion>(); Boolean existe=false; if(!this.esParaAccionDesdeFormularioSubPreguntaEvaluacion) { if(Constantes.ISUSAEJBLOGICLAYER) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()) { if(subpreguntaevaluacionAux.getIsSelected()) { subpreguntaevaluacionsSeleccionados.add(subpreguntaevaluacionAux); } } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { for(SubPreguntaEvaluacion subpreguntaevaluacionAux:this.subpreguntaevaluacions) { if(subpreguntaevaluacionAux.getIsSelected()) { subpreguntaevaluacionsSeleccionados.add(subpreguntaevaluacionAux); } } } if(subpreguntaevaluacionsSeleccionados.size()>0) { existe=true; } //SI NO ESTA NINGUNO SELECCIONADO SE SELECCIONA TODOS if(!existe) { if(conSeleccionarTodosAutomatico) { if(Constantes.ISUSAEJBLOGICLAYER) { subpreguntaevaluacionsSeleccionados.addAll(this.subpreguntaevaluacionLogic.getSubPreguntaEvaluacions()); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { subpreguntaevaluacionsSeleccionados.addAll(this.subpreguntaevaluacions); } } } } else { subpreguntaevaluacionsSeleccionados.add(this.subpreguntaevaluacion); } return subpreguntaevaluacionsSeleccionados; } public void actualizarVariablesTipoReporte(Boolean esReporteNormal,Boolean esReporteDinamico,Boolean esReporteAccionProceso,String sPath) { if(esReporteNormal) { this.sTipoReporteExtra=""; this.esReporteDinamico=false; this.sPathReporteDinamico=""; this.esReporteAccionProceso=false; } else if(esReporteAccionProceso) { this.sTipoReporteExtra=""; this.esReporteDinamico=false; this.sPathReporteDinamico=""; this.esReporteAccionProceso=true; } else if(esReporteDinamico) { this.sTipoReporteExtra=""; this.esReporteDinamico=true; this.esReporteAccionProceso=false; this.sPathReporteDinamico=sPath.replace(".jrxml",".jasper"); } } public void generarReporteSubPreguntaEvaluacionsSeleccionados() throws Exception { Boolean existe=false; if(this.sTipoReporte.equals("NORMAL") || this.sTipoReporte.equals("FORMULARIO")) { existe=true; this.generarReporteNormalSubPreguntaEvaluacionsSeleccionados(); } else if(this.sTipoReporte.equals("DINAMICO")) { existe=true; this.mostrarReporteDinamicoSubPreguntaEvaluacionsSeleccionados(); } else if(this.sTipoReporte.equals("GRUPO_GENERICO")) { existe=true; this.generarReporteGroupGenericoSubPreguntaEvaluacionsSeleccionados(false); } else if(this.sTipoReporte.equals("TOTALES_GRUPO_GENERICO")) { existe=true; this.generarReporteGroupGenericoSubPreguntaEvaluacionsSeleccionados(true); } else if(this.sTipoReporte.equals("RELACIONES")) { //SI SE GENERA REPORTE RELACIONES existe=true; this.generarReporteRelacionesSubPreguntaEvaluacionsSeleccionados(); } if(!existe) { JOptionPane.showMessageDialog(this,"SELECCIONE UN TIPO DE REPORTE VALIDO","REPORTE DE Sub Pregunta Evaluacion",JOptionPane.ERROR_MESSAGE); } } public void generarReporteRelacionesSubPreguntaEvaluacionsSeleccionados() throws Exception { ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsSeleccionados=this.getSubPreguntaEvaluacionsSeleccionados(true); this.actualizarVariablesTipoReporte(true,false,false,""); //this.sTipoReporteExtra="MasterRelaciones"; /* this.sTipoReporteExtra=""; this.esReporteDinamico=false; this.sPathReporteDinamico=""; */ this.generarReporteSubPreguntaEvaluacions("Todos",subpreguntaevaluacionsSeleccionados); } public void generarReporteNormalSubPreguntaEvaluacionsSeleccionados() throws Exception { ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsSeleccionados=this.getSubPreguntaEvaluacionsSeleccionados(true); this.actualizarVariablesTipoReporte(true,false,false,""); if(this.sTipoReporte.equals("FORMULARIO")) { this.sTipoReporteExtra="Vertical"; } /* this.sTipoReporteExtra=""; this.esReporteDinamico=false; this.sPathReporteDinamico=""; */ this.generarReporteSubPreguntaEvaluacions("Todos",subpreguntaevaluacionsSeleccionados); } public void generarReporteProcesoAccionSubPreguntaEvaluacionsSeleccionados(String sProcesoReporte) throws Exception { ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsSeleccionados=this.getSubPreguntaEvaluacionsSeleccionados(true); this.actualizarVariablesTipoReporte(false,false,true,""); /* this.esReporteDinamico=false; this.sPathReporteDinamico=""; */ this.sTipoReporteExtra=sProcesoReporte.toLowerCase(); this.esReporteAccionProceso=true; this.generarReporteSubPreguntaEvaluacions("Todos",subpreguntaevaluacionsSeleccionados); this.esReporteAccionProceso=false; } public void mostrarReporteDinamicoSubPreguntaEvaluacionsSeleccionados() throws Exception { ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados=new ArrayList<SubPreguntaEvaluacion>(); this.abrirInicializarFrameReporteDinamicoSubPreguntaEvaluacion(); subpreguntaevaluacionsSeleccionados=this.getSubPreguntaEvaluacionsSeleccionados(true); this.sTipoReporteExtra=""; //this.actualizarVariablesTipoReporte(true,false,false,""); this.abrirFrameReporteDinamicoSubPreguntaEvaluacion(); //this.generarReporteSubPreguntaEvaluacions("Todos",subpreguntaevaluacionsSeleccionados ,subpreguntaevaluacionImplementable,subpreguntaevaluacionImplementableHome); } public void mostrarImportacionSubPreguntaEvaluacions() throws Exception { //this.sTipoReporteExtra=""; //this.actualizarVariablesTipoReporte(true,false,false,""); this.abrirInicializarFrameImportacionSubPreguntaEvaluacion(); this.abrirFrameImportacionSubPreguntaEvaluacion(); //this.generarReporteSubPreguntaEvaluacions("Todos",subpreguntaevaluacionsSeleccionados ,subpreguntaevaluacionImplementable,subpreguntaevaluacionImplementableHome); } public void importarSubPreguntaEvaluacions() throws Exception { } public void exportarSubPreguntaEvaluacionsSeleccionados() throws Exception { Boolean existe=false; if(this.sTipoArchivoReporte.equals("EXCEL")) { existe=true; this.exportarExcelSubPreguntaEvaluacionsSeleccionados(); } else if(this.sTipoArchivoReporte.equals("TEXTO")) { existe=true; this.exportarTextoSubPreguntaEvaluacionsSeleccionados(); } else if(this.sTipoArchivoReporte.equals("XML")) { existe=true; this.exportarXmlSubPreguntaEvaluacionsSeleccionados(); } if(!existe) { JOptionPane.showMessageDialog(this,"SELECCIONE UN TIPO DE ARCHIVO VALIDO","EXPORTACION DE Sub Pregunta Evaluacion",JOptionPane.ERROR_MESSAGE); } } public void exportarTextoSubPreguntaEvaluacionsSeleccionados() throws Exception { ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsSeleccionados=this.getSubPreguntaEvaluacionsSeleccionados(true); String sTipo=Funciones2.getTipoExportar(this.parametroGeneralUsuario); Boolean conCabecera=this.parametroGeneralUsuario.getcon_exportar_cabecera(); String sDelimiter=Funciones2.getTipoDelimiter(this.parametroGeneralUsuario); String sPath=this.parametroGeneralUsuario.getpath_exportar()+"subpreguntaevaluacion."+"txt";//Funciones2.getTipoExtensionArchivoExportar(this.parametroGeneralUsuario); String sFilaCabecera=""; String sFilaDatos=""; BufferedWriter bufferedWriter = null; FileWriter fileWriter=null; fileWriter=new FileWriter(sPath); bufferedWriter = new BufferedWriter(fileWriter); try { if(conCabecera) { sFilaCabecera=this.getFilaCabeceraExportarSubPreguntaEvaluacion(sDelimiter); bufferedWriter.write(sFilaCabecera); } for(SubPreguntaEvaluacion subpreguntaevaluacionAux:subpreguntaevaluacionsSeleccionados) { sFilaDatos=this.getFilaDatosExportarSubPreguntaEvaluacion(subpreguntaevaluacionAux,sDelimiter); bufferedWriter.write(sFilaDatos); //subpreguntaevaluacionAux.setsDetalleGeneralEntityReporte(subpreguntaevaluacionAux.toString()); } bufferedWriter.close(); Constantes2.S_PATH_ULTIMO_ARCHIVO=sPath; if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && JOptionPane.showMessageDialog(this,"EXPORTADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Sub Pregunta Evaluacion",JOptionPane.INFORMATION_MESSAGE); } } catch (Exception e) { throw e; } finally { if (bufferedWriter != null) { bufferedWriter.close(); } } } public String getFilaCabeceraExportarSubPreguntaEvaluacion(String sDelimiter) { String sFilaCabecera=""; sFilaCabecera+=SubPreguntaEvaluacionConstantesFunciones.LABEL_ID; if(parametroGeneralUsuario.getcon_exportar_campo_version()){ sFilaCabecera+=sDelimiter; sFilaCabecera+=SubPreguntaEvaluacionConstantesFunciones.LABEL_VERSIONROW; } sFilaCabecera+=sDelimiter; sFilaCabecera+=SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEMPRESA; sFilaCabecera+=sDelimiter; sFilaCabecera+=SubPreguntaEvaluacionConstantesFunciones.LABEL_IDSUCURSAL; sFilaCabecera+=sDelimiter; sFilaCabecera+=SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPREGUNTAEVALUACION; sFilaCabecera+=sDelimiter; sFilaCabecera+=SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEJERCICIO; sFilaCabecera+=sDelimiter; sFilaCabecera+=SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPERIODO; sFilaCabecera+=sDelimiter; sFilaCabecera+=SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN; sFilaCabecera+=sDelimiter; sFilaCabecera+=SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA; sFilaCabecera+=sDelimiter; sFilaCabecera+=SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI; sFilaCabecera+=sDelimiter; sFilaCabecera+=SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA; sFilaCabecera+=sDelimiter; sFilaCabecera+=SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA; sFilaCabecera+=sDelimiter; sFilaCabecera+=SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO; sFilaCabecera+=sDelimiter; sFilaCabecera+=SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO; return sFilaCabecera; } public String getFilaDatosExportarSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion,String sDelimiter) { String sFilaDatos=""; sFilaDatos+="\r\n"; sFilaDatos+=subpreguntaevaluacion.getId().toString(); if(parametroGeneralUsuario.getcon_exportar_campo_version()){ sFilaDatos+=sDelimiter; sFilaDatos+=subpreguntaevaluacion.getVersionRow().toString(); } sFilaDatos+=sDelimiter; sFilaDatos+=subpreguntaevaluacion.getempresa_descripcion(); sFilaDatos+=sDelimiter; sFilaDatos+=subpreguntaevaluacion.getsucursal_descripcion(); sFilaDatos+=sDelimiter; sFilaDatos+=subpreguntaevaluacion.getpreguntaevaluacion_descripcion(); sFilaDatos+=sDelimiter; sFilaDatos+=subpreguntaevaluacion.getejercicio_descripcion(); sFilaDatos+=sDelimiter; sFilaDatos+=subpreguntaevaluacion.getperiodo_descripcion(); sFilaDatos+=sDelimiter; sFilaDatos+=subpreguntaevaluacion.getorden().toString(); sFilaDatos+=sDelimiter; sFilaDatos+=subpreguntaevaluacion.getpregunta(); sFilaDatos+=sDelimiter; sFilaDatos+=subpreguntaevaluacion.getporcentaje_si().toString(); sFilaDatos+=sDelimiter; sFilaDatos+=subpreguntaevaluacion.getcon_factura().toString(); sFilaDatos+=sDelimiter; sFilaDatos+=subpreguntaevaluacion.getcon_orden_compra().toString(); sFilaDatos+=sDelimiter; sFilaDatos+=subpreguntaevaluacion.getcon_completo().toString(); sFilaDatos+=sDelimiter; sFilaDatos+=subpreguntaevaluacion.getcon_a_tiempo().toString(); return sFilaDatos; } //@SuppressWarnings("deprecation") public void exportarExcelSubPreguntaEvaluacionsSeleccionados() throws Exception { ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsSeleccionados=this.getSubPreguntaEvaluacionsSeleccionados(true); String sTipo=Funciones2.getTipoExportar(this.parametroGeneralUsuario); Boolean conCabecera=this.parametroGeneralUsuario.getcon_exportar_cabecera(); String sDelimiter=Funciones2.getTipoDelimiter(this.parametroGeneralUsuario); String sPath=this.parametroGeneralUsuario.getpath_exportar()+"subpreguntaevaluacion.xls"; String sFilaCabecera=""; String sFilaDatos=""; FileOutputStream fileOutputStream=null; try { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet("SubPreguntaEvaluacions"); Integer iRow=0; Integer iCell=0; HSSFRow row = sheet.createRow(iRow); HSSFCell cell = row.createCell(iCell); //cell.setCellValue("Blahblah"); if(conCabecera) { this.getFilaCabeceraExportarExcelSubPreguntaEvaluacion(row); iRow++; } for(SubPreguntaEvaluacion subpreguntaevaluacionAux:subpreguntaevaluacionsSeleccionados) { row = sheet.createRow(iRow); this.getFilaDatosExportarExcelSubPreguntaEvaluacion(subpreguntaevaluacionAux,row); iRow++; } fileOutputStream = new FileOutputStream(new File(sPath)); workbook.write(fileOutputStream); //fileOutputStream.close(); Constantes2.S_PATH_ULTIMO_ARCHIVO=sPath; if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && JOptionPane.showMessageDialog(this,"EXPORTADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Sub Pregunta Evaluacion",JOptionPane.INFORMATION_MESSAGE); } } catch (Exception e) { throw e; } finally { if (fileOutputStream != null) { fileOutputStream.close(); } } } public void exportarXmlSubPreguntaEvaluacionsSeleccionados() throws Exception { ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsSeleccionados=this.getSubPreguntaEvaluacionsSeleccionados(true); //String sTipo=Funciones2.getTipoExportar(this.parametroGeneralUsuario); //Boolean conCabecera=this.parametroGeneralUsuario.getcon_exportar_cabecera(); //String sDelimiter=Funciones2.getTipoDelimiter(this.parametroGeneralUsuario); String sPath=this.parametroGeneralUsuario.getpath_exportar()+"subpreguntaevaluacion.xml"; String sFilaCabecera=""; String sFilaDatos=""; DocumentBuilderFactory documentBuilderFactory=null; DocumentBuilder documentBuilder =null; try { documentBuilderFactory = DocumentBuilderFactory.newInstance(); documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document document = documentBuilder.newDocument(); Element elementRoot = document.createElement("subpreguntaevaluacions"); document.appendChild(elementRoot); Element element = null;//document.createElement("subpreguntaevaluacion"); //elementRoot.appendChild(element); for(SubPreguntaEvaluacion subpreguntaevaluacionAux:subpreguntaevaluacionsSeleccionados) { element = document.createElement("subpreguntaevaluacion"); elementRoot.appendChild(element); this.setFilaDatosExportarXmlSubPreguntaEvaluacion(subpreguntaevaluacionAux,document,element); } TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); DOMSource domSource = new DOMSource(document); StreamResult streamResult = new StreamResult(new File(sPath)); transformer.transform(domSource, streamResult); Constantes2.S_PATH_ULTIMO_ARCHIVO=sPath; if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && JOptionPane.showMessageDialog(this,"EXPORTADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Sub Pregunta Evaluacion",JOptionPane.INFORMATION_MESSAGE); } } catch (Exception e) { throw e; } finally { } } //@SuppressWarnings("deprecation") public void getFilaCabeceraExportarExcelSubPreguntaEvaluacion(HSSFRow row) { Integer iColumn=0; HSSFCell cell =null; cell = row.createCell(iColumn++);cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_ID); if(parametroGeneralUsuario.getcon_exportar_campo_version()){ cell = row.createCell(iColumn++);cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_VERSIONROW); } cell = row.createCell(iColumn++);cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEMPRESA); cell = row.createCell(iColumn++);cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDSUCURSAL); cell = row.createCell(iColumn++);cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPREGUNTAEVALUACION); cell = row.createCell(iColumn++);cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEJERCICIO); cell = row.createCell(iColumn++);cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPERIODO); cell = row.createCell(iColumn++);cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN); cell = row.createCell(iColumn++);cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA); cell = row.createCell(iColumn++);cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_PORCENTAJESI); cell = row.createCell(iColumn++);cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA); cell = row.createCell(iColumn++);cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA); cell = row.createCell(iColumn++);cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO); cell = row.createCell(iColumn++);cell.setCellValue(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO); } //@SuppressWarnings("deprecation") public void getFilaDatosExportarExcelSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion,HSSFRow row) { Integer iColumn=0; HSSFCell cell =null; cell = row.createCell(iColumn++);cell.setCellValue(subpreguntaevaluacion.getId()); cell = row.createCell(iColumn++);cell.setCellValue(subpreguntaevaluacion.getempresa_descripcion()); cell = row.createCell(iColumn++);cell.setCellValue(subpreguntaevaluacion.getsucursal_descripcion()); cell = row.createCell(iColumn++);cell.setCellValue(subpreguntaevaluacion.getpreguntaevaluacion_descripcion()); cell = row.createCell(iColumn++);cell.setCellValue(subpreguntaevaluacion.getejercicio_descripcion()); cell = row.createCell(iColumn++);cell.setCellValue(subpreguntaevaluacion.getperiodo_descripcion()); cell = row.createCell(iColumn++);cell.setCellValue(subpreguntaevaluacion.getorden()); cell = row.createCell(iColumn++);cell.setCellValue(subpreguntaevaluacion.getpregunta()); cell = row.createCell(iColumn++);cell.setCellValue(subpreguntaevaluacion.getporcentaje_si()); cell = row.createCell(iColumn++);cell.setCellValue(subpreguntaevaluacion.getcon_factura()); cell = row.createCell(iColumn++);cell.setCellValue(subpreguntaevaluacion.getcon_orden_compra()); cell = row.createCell(iColumn++);cell.setCellValue(subpreguntaevaluacion.getcon_completo()); cell = row.createCell(iColumn++);cell.setCellValue(subpreguntaevaluacion.getcon_a_tiempo()); } public void setFilaDatosExportarXmlSubPreguntaEvaluacion(SubPreguntaEvaluacion subpreguntaevaluacion,Document document,Element element) { /* Element lastname = document.createElement("lastname"); lastname.appendChild(document.createTextNode("<NAME>")); element.appendChild(lastname); */ Element elementId = document.createElement(SubPreguntaEvaluacionConstantesFunciones.ID); elementId.appendChild(document.createTextNode(subpreguntaevaluacion.getId().toString().trim())); element.appendChild(elementId); if(parametroGeneralUsuario.getcon_exportar_campo_version()){ Element elementVersionRow = document.createElement(SubPreguntaEvaluacionConstantesFunciones.VERSIONROW); elementVersionRow.appendChild(document.createTextNode(subpreguntaevaluacion.getVersionRow().toString().trim())); element.appendChild(elementVersionRow); } Element elementempresa_descripcion = document.createElement(SubPreguntaEvaluacionConstantesFunciones.IDEMPRESA); elementempresa_descripcion.appendChild(document.createTextNode(subpreguntaevaluacion.getempresa_descripcion())); element.appendChild(elementempresa_descripcion); Element elementsucursal_descripcion = document.createElement(SubPreguntaEvaluacionConstantesFunciones.IDSUCURSAL); elementsucursal_descripcion.appendChild(document.createTextNode(subpreguntaevaluacion.getsucursal_descripcion())); element.appendChild(elementsucursal_descripcion); Element elementpreguntaevaluacion_descripcion = document.createElement(SubPreguntaEvaluacionConstantesFunciones.IDPREGUNTAEVALUACION); elementpreguntaevaluacion_descripcion.appendChild(document.createTextNode(subpreguntaevaluacion.getpreguntaevaluacion_descripcion())); element.appendChild(elementpreguntaevaluacion_descripcion); Element elementejercicio_descripcion = document.createElement(SubPreguntaEvaluacionConstantesFunciones.IDEJERCICIO); elementejercicio_descripcion.appendChild(document.createTextNode(subpreguntaevaluacion.getejercicio_descripcion())); element.appendChild(elementejercicio_descripcion); Element elementperiodo_descripcion = document.createElement(SubPreguntaEvaluacionConstantesFunciones.IDPERIODO); elementperiodo_descripcion.appendChild(document.createTextNode(subpreguntaevaluacion.getperiodo_descripcion())); element.appendChild(elementperiodo_descripcion); Element elementorden = document.createElement(SubPreguntaEvaluacionConstantesFunciones.ORDEN); elementorden.appendChild(document.createTextNode(subpreguntaevaluacion.getorden().toString().trim())); element.appendChild(elementorden); Element elementpregunta = document.createElement(SubPreguntaEvaluacionConstantesFunciones.PREGUNTA); elementpregunta.appendChild(document.createTextNode(subpreguntaevaluacion.getpregunta().trim())); element.appendChild(elementpregunta); Element elementporcentaje_si = document.createElement(SubPreguntaEvaluacionConstantesFunciones.PORCENTAJESI); elementporcentaje_si.appendChild(document.createTextNode(subpreguntaevaluacion.getporcentaje_si().toString().trim())); element.appendChild(elementporcentaje_si); Element elementcon_factura = document.createElement(SubPreguntaEvaluacionConstantesFunciones.CONFACTURA); elementcon_factura.appendChild(document.createTextNode(subpreguntaevaluacion.getcon_factura().toString().trim())); element.appendChild(elementcon_factura); Element elementcon_orden_compra = document.createElement(SubPreguntaEvaluacionConstantesFunciones.CONORDENCOMPRA); elementcon_orden_compra.appendChild(document.createTextNode(subpreguntaevaluacion.getcon_orden_compra().toString().trim())); element.appendChild(elementcon_orden_compra); Element elementcon_completo = document.createElement(SubPreguntaEvaluacionConstantesFunciones.CONCOMPLETO); elementcon_completo.appendChild(document.createTextNode(subpreguntaevaluacion.getcon_completo().toString().trim())); element.appendChild(elementcon_completo); Element elementcon_a_tiempo = document.createElement(SubPreguntaEvaluacionConstantesFunciones.CONATIEMPO); elementcon_a_tiempo.appendChild(document.createTextNode(subpreguntaevaluacion.getcon_a_tiempo().toString().trim())); element.appendChild(elementcon_a_tiempo); } public void generarReporteGroupGenericoSubPreguntaEvaluacionsSeleccionados(Boolean soloTotales) throws Exception { ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados=new ArrayList<SubPreguntaEvaluacion>(); subpreguntaevaluacionsSeleccionados=this.getSubPreguntaEvaluacionsSeleccionados(true); this.actualizarVariablesTipoReporte(true,false,false,""); /* this.esReporteDinamico=false; this.sPathReporteDinamico=""; */ if(!soloTotales) { this.sTipoReporteExtra=Constantes2.S_REPORTE_EXTRA_GROUP_GENERICO; } else { this.sTipoReporteExtra=Constantes2.S_REPORTE_EXTRA_GROUP_TOTALES_GENERICO; } this.setColumnaDescripcionReporteGroupGenericoSubPreguntaEvaluacion(subpreguntaevaluacionsSeleccionados); this.generarReporteSubPreguntaEvaluacions("Todos",subpreguntaevaluacionsSeleccionados); } public void setColumnaDescripcionReporteGroupGenericoSubPreguntaEvaluacion(ArrayList<SubPreguntaEvaluacion> subpreguntaevaluacionsSeleccionados) throws Exception { try { //FUNCIONA CON MODEL PERO SE DANA MANTENIMIENTO Boolean existe=false; for(SubPreguntaEvaluacion subpreguntaevaluacionAux:subpreguntaevaluacionsSeleccionados) { subpreguntaevaluacionAux.setsDetalleGeneralEntityReporte(subpreguntaevaluacionAux.toString()); if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEMPRESA)) { existe=true; subpreguntaevaluacionAux.setsDescripcionGeneralEntityReporte1(subpreguntaevaluacionAux.getempresa_descripcion()); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDSUCURSAL)) { existe=true; subpreguntaevaluacionAux.setsDescripcionGeneralEntityReporte1(subpreguntaevaluacionAux.getsucursal_descripcion()); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPREGUNTAEVALUACION)) { existe=true; subpreguntaevaluacionAux.setsDescripcionGeneralEntityReporte1(subpreguntaevaluacionAux.getpreguntaevaluacion_descripcion()); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDEJERCICIO)) { existe=true; subpreguntaevaluacionAux.setsDescripcionGeneralEntityReporte1(subpreguntaevaluacionAux.getejercicio_descripcion()); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_IDPERIODO)) { existe=true; subpreguntaevaluacionAux.setsDescripcionGeneralEntityReporte1(subpreguntaevaluacionAux.getperiodo_descripcion()); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_ORDEN)) { existe=true; subpreguntaevaluacionAux.setsDescripcionGeneralEntityReporte1(subpreguntaevaluacionAux.getorden().toString()); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_PREGUNTA)) { existe=true; subpreguntaevaluacionAux.setsDescripcionGeneralEntityReporte1(subpreguntaevaluacionAux.getpregunta()); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONFACTURA)) { existe=true; subpreguntaevaluacionAux.setsDescripcionGeneralEntityReporte1(Funciones2.getDescripcionBoolean(subpreguntaevaluacionAux.getcon_factura())); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONORDENCOMPRA)) { existe=true; subpreguntaevaluacionAux.setsDescripcionGeneralEntityReporte1(Funciones2.getDescripcionBoolean(subpreguntaevaluacionAux.getcon_orden_compra())); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONCOMPLETO)) { existe=true; subpreguntaevaluacionAux.setsDescripcionGeneralEntityReporte1(Funciones2.getDescripcionBoolean(subpreguntaevaluacionAux.getcon_completo())); } else if(sTipoSeleccionar.equals(SubPreguntaEvaluacionConstantesFunciones.LABEL_CONATIEMPO)) { existe=true; subpreguntaevaluacionAux.setsDescripcionGeneralEntityReporte1(Funciones2.getDescripcionBoolean(subpreguntaevaluacionAux.getcon_a_tiempo())); } } if(!existe) { JOptionPane.showMessageDialog(this,"NO SE HA SELECCIONADO ALGUNA COLUMNA VALIDA","SELECCIONAR",JOptionPane.ERROR_MESSAGE); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,SubPreguntaEvaluacionConstantesFunciones.CLASSNAME); } } public void actualizarEstadoCeldasBotonesSubPreguntaEvaluacion(String sAccion,Boolean isGuardarCambiosEnLote,Boolean isEsMantenimientoRelacionado) throws Exception { if(sAccion=="n") { if(!this.esParaBusquedaForeignKey) { this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion=true; this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=true; this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=true; } this.isVisibilidadCeldaModificarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion=false; if(isEsMantenimientoRelacionado==false) { if(isGuardarCambiosEnLote==true) { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=true; } else { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=false; } } } else if(sAccion=="a") { this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion=false; this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=false; this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=false; this.isVisibilidadCeldaModificarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion=true; this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion=true; if(isEsMantenimientoRelacionado==false) { if(isGuardarCambiosEnLote==true) { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=true; } else { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=false; } } } else if(sAccion=="ae") { this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion=false; this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=false; this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=false; this.isVisibilidadCeldaModificarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion=true; this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion=true; this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion=true; if(isEsMantenimientoRelacionado==false) { if(isGuardarCambiosEnLote==true) { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=true; } else { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=false; } } } //Para Mantenimientos de tablas relacionados con mas de columnas minimas else if(sAccion=="ae2") { this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion=false; this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=false; this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=false; this.isVisibilidadCeldaModificarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion=true; this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion=true; if(isEsMantenimientoRelacionado==false) { if(isGuardarCambiosEnLote==true) { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=false; } else { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=false; } } } else if(sAccion=="c") { this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion=true; this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=true; this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=true; this.isVisibilidadCeldaModificarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion=false; if(isEsMantenimientoRelacionado==false) { if(isGuardarCambiosEnLote==true) { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=true; } else { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=false; } } } else if(sAccion=="t") { this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion=false; this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=false; this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=false; this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion=false; if(isEsMantenimientoRelacionado==false) { if(isGuardarCambiosEnLote==true) { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=false; } else { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=false; } } } else if(sAccion=="s"||sAccion=="s2") { this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion=false; this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=false; this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=false; this.isVisibilidadCeldaModificarSubPreguntaEvaluacion=true; this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaCancelarSubPreguntaEvaluacion=true; if(isEsMantenimientoRelacionado==false) { if(isGuardarCambiosEnLote==true) { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=false; } else { this.isVisibilidadCeldaGuardarSubPreguntaEvaluacion=false; } } } //ACTUALIZA VISIBILIDAD PANELES if(SubPreguntaEvaluacionJInternalFrame.CON_DATOS_FRAME && !this.esParaBusquedaForeignKey) { //SIEMPRE VISIBLE this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion=true; this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=true; this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=true; } else { this.actualizarEstadoPanelsSubPreguntaEvaluacion(sAccion); } if(this.esParaBusquedaForeignKey) { this.isVisibilidadCeldaCopiarSubPreguntaEvaluacion=false; //this.isVisibilidadCeldaVerFormSubPreguntaEvaluacion=false; this.isVisibilidadCeldaDuplicarSubPreguntaEvaluacion=false; } //SI ES MANTENIMIENTO RELACIONES if(!subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=false; } else { this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion=false; this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=false; } //SI ES MANTENIMIENTO RELACIONADO if(subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { if(!subpreguntaevaluacionSessionBean.getConGuardarRelaciones()) { this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=false; } this.jButtonCerrarSubPreguntaEvaluacion.setVisible(false); } //SI NO TIENE MAXIMO DE RELACIONES PERMITIDAS if(!this.conMaximoRelaciones) { this.isVisibilidadCeldaNuevoRelacionesSubPreguntaEvaluacion=false; } if(!this.permiteMantenimiento(this.subpreguntaevaluacion)) { this.isVisibilidadCeldaActualizarSubPreguntaEvaluacion=false; this.isVisibilidadCeldaEliminarSubPreguntaEvaluacion=false; } } public void actualizarEstadoCeldasBotonesConGuardarRelacionesSubPreguntaEvaluacion() { this.isVisibilidadCeldaNuevoSubPreguntaEvaluacion=false; this.isVisibilidadCeldaGuardarCambiosSubPreguntaEvaluacion=false; } public void actualizarEstadoPanelsSubPreguntaEvaluacion(String sAccion) { if(sAccion=="n") { if(this.jScrollPanelDatosEdicionSubPreguntaEvaluacion!=null) { this.jScrollPanelDatosEdicionSubPreguntaEvaluacion.setVisible(false); } //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasSubPreguntaEvaluacion!=null) { this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setVisible(true); } if(this.jScrollPanelDatosSubPreguntaEvaluacion!=null) { this.jScrollPanelDatosSubPreguntaEvaluacion.setVisible(true); } if(this.jPanelPaginacionSubPreguntaEvaluacion!=null) { this.jPanelPaginacionSubPreguntaEvaluacion.setVisible(true); } if(this.jPanelParametrosReportesSubPreguntaEvaluacion!=null) { this.jPanelParametrosReportesSubPreguntaEvaluacion.setVisible(true); } } else if(sAccion=="a") { if(this.jScrollPanelDatosEdicionSubPreguntaEvaluacion!=null) { this.jScrollPanelDatosEdicionSubPreguntaEvaluacion.setVisible(true); } //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasSubPreguntaEvaluacion!=null) { this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setVisible(false); } if(this.jScrollPanelDatosSubPreguntaEvaluacion!=null) { this.jScrollPanelDatosSubPreguntaEvaluacion.setVisible(false); } if(this.jPanelPaginacionSubPreguntaEvaluacion!=null) { this.jPanelPaginacionSubPreguntaEvaluacion.setVisible(false); } if(this.jPanelParametrosReportesSubPreguntaEvaluacion!=null) { this.jPanelParametrosReportesSubPreguntaEvaluacion.setVisible(false); } } else if(sAccion=="ae") { if(this.jScrollPanelDatosEdicionSubPreguntaEvaluacion!=null) { this.jScrollPanelDatosEdicionSubPreguntaEvaluacion.setVisible(true); } //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasSubPreguntaEvaluacion!=null) { this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setVisible(false); } if(this.jScrollPanelDatosSubPreguntaEvaluacion!=null) { this.jScrollPanelDatosSubPreguntaEvaluacion.setVisible(false); } if(this.jPanelPaginacionSubPreguntaEvaluacion!=null) { this.jPanelPaginacionSubPreguntaEvaluacion.setVisible(false); } if(this.jPanelParametrosReportesSubPreguntaEvaluacion!=null) { this.jPanelParametrosReportesSubPreguntaEvaluacion.setVisible(false); } } //Para Mantenimientos de tablas relacionados con mas de columnas minimas else if(sAccion=="ae2") { if(this.jScrollPanelDatosEdicionSubPreguntaEvaluacion!=null) { this.jScrollPanelDatosEdicionSubPreguntaEvaluacion.setVisible(true); } //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasSubPreguntaEvaluacion!=null) { this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setVisible(false); } if(this.jScrollPanelDatosSubPreguntaEvaluacion!=null) { this.jScrollPanelDatosSubPreguntaEvaluacion.setVisible(false); } if(this.jPanelPaginacionSubPreguntaEvaluacion!=null) { this.jPanelPaginacionSubPreguntaEvaluacion.setVisible(false); } if(this.jPanelParametrosReportesSubPreguntaEvaluacion!=null) { this.jPanelParametrosReportesSubPreguntaEvaluacion.setVisible(false); } } else if(sAccion=="c") { if(this.jScrollPanelDatosEdicionSubPreguntaEvaluacion!=null) { this.jScrollPanelDatosEdicionSubPreguntaEvaluacion.setVisible(false); } //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasSubPreguntaEvaluacion!=null) { this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setVisible(true); } if(this.jScrollPanelDatosSubPreguntaEvaluacion!=null) { this.jScrollPanelDatosSubPreguntaEvaluacion.setVisible(true); } if(this.jPanelPaginacionSubPreguntaEvaluacion!=null) { this.jPanelPaginacionSubPreguntaEvaluacion.setVisible(true); } if(this.jPanelParametrosReportesSubPreguntaEvaluacion!=null) { this.jPanelParametrosReportesSubPreguntaEvaluacion.setVisible(true); } } else if(sAccion=="t") { if(this.jScrollPanelDatosEdicionSubPreguntaEvaluacion!=null) { this.jScrollPanelDatosEdicionSubPreguntaEvaluacion.setVisible(false); } //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasSubPreguntaEvaluacion!=null) { this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setVisible(true); } if(this.jScrollPanelDatosSubPreguntaEvaluacion!=null) { this.jScrollPanelDatosSubPreguntaEvaluacion.setVisible(true); } if(this.jPanelPaginacionSubPreguntaEvaluacion!=null) { this.jPanelPaginacionSubPreguntaEvaluacion.setVisible(true); } if(this.jPanelParametrosReportesSubPreguntaEvaluacion!=null) { this.jPanelParametrosReportesSubPreguntaEvaluacion.setVisible(true); } } else if(sAccion=="s"||sAccion=="s2") { if(this.jScrollPanelDatosEdicionSubPreguntaEvaluacion!=null) { this.jScrollPanelDatosEdicionSubPreguntaEvaluacion.setVisible(false); } //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasSubPreguntaEvaluacion!=null) { this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setVisible(true); } if(this.jScrollPanelDatosSubPreguntaEvaluacion!=null) { this.jScrollPanelDatosSubPreguntaEvaluacion.setVisible(true); } if(this.jPanelPaginacionSubPreguntaEvaluacion!=null) { this.jPanelPaginacionSubPreguntaEvaluacion.setVisible(true); } if(this.jPanelParametrosReportesSubPreguntaEvaluacion!=null) { this.jPanelParametrosReportesSubPreguntaEvaluacion.setVisible(true); } } if(sAccion.equals("relacionado") || this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { if(!this.conCargarMinimo) { //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasSubPreguntaEvaluacion!=null) { this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setVisible(false); } } if(this.jPanelParametrosReportesSubPreguntaEvaluacion!=null) { this.jPanelParametrosReportesSubPreguntaEvaluacion.setVisible(false); } } else if(sAccion.equals("no_relacionado") && !this.subpreguntaevaluacionSessionBean.getEsGuardarRelacionado()) { //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasSubPreguntaEvaluacion!=null) { this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setVisible(true); } if(this.jPanelParametrosReportesSubPreguntaEvaluacion!=null) { this.jPanelParametrosReportesSubPreguntaEvaluacion.setVisible(true); } } } public void setVisibilidadBusquedasParaEmpresa(Boolean isParaEmpresa){ //BYDAN_BUSQUEDAS if(!this.conCargarMinimo) { Boolean isParaEmpresaNegation=!isParaEmpresa; this.isVisibilidadFK_IdPreguntaEvaluacion=isParaEmpresaNegation; if(!this.isVisibilidadFK_IdPreguntaEvaluacion) {this.jTabbedPaneBusquedasSubPreguntaEvaluacion.remove(jPanelFK_IdPreguntaEvaluacionSubPreguntaEvaluacion);} } } public void setVisibilidadBusquedasParaSucursal(Boolean isParaSucursal){ //BYDAN_BUSQUEDAS if(!this.conCargarMinimo) { Boolean isParaSucursalNegation=!isParaSucursal; this.isVisibilidadFK_IdPreguntaEvaluacion=isParaSucursalNegation; if(!this.isVisibilidadFK_IdPreguntaEvaluacion) {this.jTabbedPaneBusquedasSubPreguntaEvaluacion.remove(jPanelFK_IdPreguntaEvaluacionSubPreguntaEvaluacion);} } } public void setVisibilidadBusquedasParaPreguntaEvaluacion(Boolean isParaPreguntaEvaluacion){ //BYDAN_BUSQUEDAS if(!this.conCargarMinimo) { Boolean isParaPreguntaEvaluacionNegation=!isParaPreguntaEvaluacion; this.isVisibilidadFK_IdPreguntaEvaluacion=isParaPreguntaEvaluacion; if(!this.isVisibilidadFK_IdPreguntaEvaluacion) {this.jTabbedPaneBusquedasSubPreguntaEvaluacion.remove(jPanelFK_IdPreguntaEvaluacionSubPreguntaEvaluacion);} } } public void setVisibilidadBusquedasParaEjercicio(Boolean isParaEjercicio){ //BYDAN_BUSQUEDAS if(!this.conCargarMinimo) { Boolean isParaEjercicioNegation=!isParaEjercicio; this.isVisibilidadFK_IdPreguntaEvaluacion=isParaEjercicioNegation; if(!this.isVisibilidadFK_IdPreguntaEvaluacion) {this.jTabbedPaneBusquedasSubPreguntaEvaluacion.remove(jPanelFK_IdPreguntaEvaluacionSubPreguntaEvaluacion);} } } public void setVisibilidadBusquedasParaPeriodo(Boolean isParaPeriodo){ //BYDAN_BUSQUEDAS if(!this.conCargarMinimo) { Boolean isParaPeriodoNegation=!isParaPeriodo; this.isVisibilidadFK_IdPreguntaEvaluacion=isParaPeriodoNegation; if(!this.isVisibilidadFK_IdPreguntaEvaluacion) {this.jTabbedPaneBusquedasSubPreguntaEvaluacion.remove(jPanelFK_IdPreguntaEvaluacionSubPreguntaEvaluacion);} } } public String registrarSesionSubPreguntaEvaluacionParaDetalleEvaluacionProveedores() throws Exception { Boolean isPaginaPopupDetalleEvaluacionProveedor=false; try { if(this.subpreguntaevaluacionSessionBean==null) { this.subpreguntaevaluacionSessionBean=new SubPreguntaEvaluacionSessionBean(); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorSessionBean==null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorSessionBean=new DetalleEvaluacionProveedorSessionBean(); } this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorSessionBean.setsPathNavegacionActual(subpreguntaevaluacionSessionBean.getsPathNavegacionActual()+Constantes.SHTMLFLECHA+DetalleEvaluacionProveedorConstantesFunciones.SCLASSWEBTITULO); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorSessionBean.setisPermiteRecargarInformacion(false); isPaginaPopupDetalleEvaluacionProveedor=this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorSessionBean.getisPaginaPopup(); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorSessionBean.setisPermiteNavegacionHaciaForeignKeyDesdeDetalleEvaluacionProveedor(true); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorSessionBean.setsNombrePaginaNavegacionHaciaForeignKeyDesdeDetalleEvaluacionProveedor(SubPreguntaEvaluacionConstantesFunciones.SNOMBREOPCION); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorSessionBean.setisBusquedaDesdeForeignKeySesionSubPreguntaEvaluacion(true); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.detalleevaluacionproveedorSessionBean.setlidSubPreguntaEvaluacionActual(this.idSubPreguntaEvaluacionActual); subpreguntaevaluacionSessionBean.setisBusquedaDesdeForeignKeySesionForeignKeySubPreguntaEvaluacion(true); subpreguntaevaluacionSessionBean.setlIdSubPreguntaEvaluacionActualForeignKey(this.idSubPreguntaEvaluacionActual); String strPagina=Constantes.SNONE; SistemaLogicAdditional sistemaLogicAdditional=new SistemaLogicAdditional(); guardarDatosBusquedaSession(); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } return ""; } public void guardarDatosBusquedaSession() throws Exception { //SubPreguntaEvaluacionSessionBean subpreguntaevaluacionSessionBean=new SubPreguntaEvaluacionSessionBean(); if(this.subpreguntaevaluacionSessionBean==null) { this.subpreguntaevaluacionSessionBean=new SubPreguntaEvaluacionSessionBean(); } this.subpreguntaevaluacionSessionBean.setsUltimaBusquedaSubPreguntaEvaluacion(this.getsAccionBusqueda()); this.subpreguntaevaluacionSessionBean.setiNumeroPaginacion(this.getiNumeroPaginacion()); this.subpreguntaevaluacionSessionBean.setiNumeroPaginacionPagina(this.getiNumeroPaginacionPagina()); if(this.getsAccionBusqueda().equals("Todos")) { ; } else if(this.getsAccionBusqueda().equals("FK_IdEjercicio")) { subpreguntaevaluacionSessionBean.setid_ejercicio(this.getid_ejercicioFK_IdEjercicio()); } else if(this.getsAccionBusqueda().equals("FK_IdEmpresa")) { subpreguntaevaluacionSessionBean.setid_empresa(this.getid_empresaFK_IdEmpresa()); } else if(this.getsAccionBusqueda().equals("FK_IdPeriodo")) { subpreguntaevaluacionSessionBean.setid_periodo(this.getid_periodoFK_IdPeriodo()); } else if(this.getsAccionBusqueda().equals("FK_IdPreguntaEvaluacion")) { subpreguntaevaluacionSessionBean.setid_pregunta_evaluacion(this.getid_pregunta_evaluacionFK_IdPreguntaEvaluacion()); } else if(this.getsAccionBusqueda().equals("FK_IdSucursal")) { subpreguntaevaluacionSessionBean.setid_sucursal(this.getid_sucursalFK_IdSucursal()); } } public void traerDatosBusquedaDesdeSession() throws Exception { //SubPreguntaEvaluacionSessionBean subpreguntaevaluacionSessionBean=new SubPreguntaEvaluacionSessionBean(); if(this.subpreguntaevaluacionSessionBean==null) { this.subpreguntaevaluacionSessionBean=new SubPreguntaEvaluacionSessionBean(); } if(this.subpreguntaevaluacionSessionBean.getsUltimaBusquedaSubPreguntaEvaluacion()!=null&&!this.subpreguntaevaluacionSessionBean.getsUltimaBusquedaSubPreguntaEvaluacion().equals("")) { this.setsAccionBusqueda(subpreguntaevaluacionSessionBean.getsUltimaBusquedaSubPreguntaEvaluacion()); this.setiNumeroPaginacion(subpreguntaevaluacionSessionBean.getiNumeroPaginacion()); this.setiNumeroPaginacionPagina(subpreguntaevaluacionSessionBean.getiNumeroPaginacionPagina()); if(this.getsAccionBusqueda().equals("Todos")) { ; } else if(this.getsAccionBusqueda().equals("FK_IdEjercicio")) { this.setid_ejercicioFK_IdEjercicio(subpreguntaevaluacionSessionBean.getid_ejercicio()); subpreguntaevaluacionSessionBean.setid_ejercicio(-1L); } else if(this.getsAccionBusqueda().equals("FK_IdEmpresa")) { this.setid_empresaFK_IdEmpresa(subpreguntaevaluacionSessionBean.getid_empresa()); subpreguntaevaluacionSessionBean.setid_empresa(-1L); } else if(this.getsAccionBusqueda().equals("FK_IdPeriodo")) { this.setid_periodoFK_IdPeriodo(subpreguntaevaluacionSessionBean.getid_periodo()); subpreguntaevaluacionSessionBean.setid_periodo(-1L); } else if(this.getsAccionBusqueda().equals("FK_IdPreguntaEvaluacion")) { this.setid_pregunta_evaluacionFK_IdPreguntaEvaluacion(subpreguntaevaluacionSessionBean.getid_pregunta_evaluacion()); subpreguntaevaluacionSessionBean.setid_pregunta_evaluacion(-1L); } else if(this.getsAccionBusqueda().equals("FK_IdSucursal")) { this.setid_sucursalFK_IdSucursal(subpreguntaevaluacionSessionBean.getid_sucursal()); subpreguntaevaluacionSessionBean.setid_sucursal(-1L); } } this.subpreguntaevaluacionSessionBean.setsUltimaBusquedaSubPreguntaEvaluacion(""); this.subpreguntaevaluacionSessionBean.setiNumeroPaginacion(SubPreguntaEvaluacionConstantesFunciones.INUMEROPAGINACION); this.subpreguntaevaluacionSessionBean.setiNumeroPaginacionPagina(0); } public void procesoActualizarFilaTotales(Boolean esCampoValor,String sTipo) { try { this.actualizarFilaTotales(); this.traerValoresTablaTotales(); this.inicializarActualizarBindingTablaSubPreguntaEvaluacion(false); } catch (Exception e) { e.printStackTrace(); } } public void updateBusquedasFormularioSubPreguntaEvaluacion() { this.updateBorderResaltarBusquedasFormularioSubPreguntaEvaluacion(); this.updateVisibilidadBusquedasFormularioSubPreguntaEvaluacion(); this.updateHabilitarBusquedasFormularioSubPreguntaEvaluacion(); } public void updateBorderResaltarBusquedasFormularioSubPreguntaEvaluacion() { //BYDAN_BUSQUEDAS int index=0; if(this.jTabbedPaneBusquedasSubPreguntaEvaluacion.getComponents().length>0) { if(this.subpreguntaevaluacionConstantesFunciones.resaltarFK_IdPreguntaEvaluacionSubPreguntaEvaluacion!=null) { index= this.jTabbedPaneBusquedasSubPreguntaEvaluacion.indexOfComponent(this.jPanelFK_IdPreguntaEvaluacionSubPreguntaEvaluacion); if(index>-1) { JPanel jPanel=(JPanel)this.jTabbedPaneBusquedasSubPreguntaEvaluacion.getComponent(index); jPanel.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltarFK_IdPreguntaEvaluacionSubPreguntaEvaluacion); } } } } public void updateVisibilidadBusquedasFormularioSubPreguntaEvaluacion() { //BYDAN_BUSQUEDAS int index=0; JPanel jPanel=null; if(this.jTabbedPaneBusquedasSubPreguntaEvaluacion.getComponents().length>0) { index= this.jTabbedPaneBusquedasSubPreguntaEvaluacion.indexOfComponent(this.jPanelFK_IdPreguntaEvaluacionSubPreguntaEvaluacion); jPanel=(JPanel)this.jTabbedPaneBusquedasSubPreguntaEvaluacion.getComponent(index); //NO VALE SOLO PONIENDO VISIBLE=FALSE, HAY QUE USAR REMOVE jPanel.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarFK_IdPreguntaEvaluacionSubPreguntaEvaluacion); if(!this.subpreguntaevaluacionConstantesFunciones.mostrarFK_IdPreguntaEvaluacionSubPreguntaEvaluacion && index>-1) { this.jTabbedPaneBusquedasSubPreguntaEvaluacion.remove(index); } } } public void updateHabilitarBusquedasFormularioSubPreguntaEvaluacion() { //BYDAN_BUSQUEDAS int index=0; JPanel jPanel=null; if(this.jTabbedPaneBusquedasSubPreguntaEvaluacion.getComponents().length>0) { index= this.jTabbedPaneBusquedasSubPreguntaEvaluacion.indexOfComponent(this.jPanelFK_IdPreguntaEvaluacionSubPreguntaEvaluacion); if(index>-1) { jPanel=(JPanel)this.jTabbedPaneBusquedasSubPreguntaEvaluacion.getComponent(index); //ENABLE PANE=FALSE NO FUNCIONA, ENABLEAT SI jPanel.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activarFK_IdPreguntaEvaluacionSubPreguntaEvaluacion); this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setEnabledAt(index,this.subpreguntaevaluacionConstantesFunciones.activarFK_IdPreguntaEvaluacionSubPreguntaEvaluacion); } } } public void resaltarPanelBusquedaSubPreguntaEvaluacion(String sTipoBusqueda) { Boolean existe=false; //BYDAN_BUSQUEDAS int index=0; Border resaltar = Funciones2.getBorderResaltar(this.parametroGeneralUsuario,"TAB"); if(sTipoBusqueda.equals("FK_IdPreguntaEvaluacion")) { index= this.jTabbedPaneBusquedasSubPreguntaEvaluacion.indexOfComponent(this.jPanelFK_IdPreguntaEvaluacionSubPreguntaEvaluacion); this.jTabbedPaneBusquedasSubPreguntaEvaluacion.setSelectedIndex(index); JPanel jPanel=(JPanel)this.jTabbedPaneBusquedasSubPreguntaEvaluacion.getComponent(index); this.subpreguntaevaluacionConstantesFunciones.setResaltarFK_IdPreguntaEvaluacionSubPreguntaEvaluacion(resaltar); jPanel.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltarFK_IdPreguntaEvaluacionSubPreguntaEvaluacion); existe=true; } if(existe) { this.jTtoolBarSubPreguntaEvaluacion.setBorder(resaltar); } } //NO FUNCIONA public void windowClosed(WindowEvent e) { } public void windowClosing(WindowEvent e) { } public void windowOpened(WindowEvent e) { } public void windowIconified(WindowEvent e) { } public void windowDeiconified(WindowEvent e) { } public void windowActivated(WindowEvent e) { } public void windowDeactivated(WindowEvent e) { } public void windowGainedFocus(WindowEvent e) { } public void windowLostFocus(WindowEvent e) { } public void updateControlesFormularioSubPreguntaEvaluacion() throws Exception { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } this.updateBorderResaltarControlesFormularioSubPreguntaEvaluacion(); this.updateVisibilidadResaltarControlesFormularioSubPreguntaEvaluacion(); this.updateHabilitarResaltarControlesFormularioSubPreguntaEvaluacion(); } public void updateBorderResaltarControlesFormularioSubPreguntaEvaluacion() throws Exception { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } if(this.subpreguntaevaluacionConstantesFunciones.resaltaridSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelidSubPreguntaEvaluacion.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltaridSubPreguntaEvaluacion);} if(this.subpreguntaevaluacionConstantesFunciones.resaltarid_empresaSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltarid_empresaSubPreguntaEvaluacion);} if(this.subpreguntaevaluacionConstantesFunciones.resaltarid_sucursalSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltarid_sucursalSubPreguntaEvaluacion);} if(this.subpreguntaevaluacionConstantesFunciones.resaltarid_pregunta_evaluacionSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltarid_pregunta_evaluacionSubPreguntaEvaluacion);} if(this.subpreguntaevaluacionConstantesFunciones.resaltarid_ejercicioSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltarid_ejercicioSubPreguntaEvaluacion);} if(this.subpreguntaevaluacionConstantesFunciones.resaltarid_periodoSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltarid_periodoSubPreguntaEvaluacion);} if(this.subpreguntaevaluacionConstantesFunciones.resaltarordenSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldordenSubPreguntaEvaluacion.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltarordenSubPreguntaEvaluacion);} if(this.subpreguntaevaluacionConstantesFunciones.resaltarpreguntaSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextAreapreguntaSubPreguntaEvaluacion.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltarpreguntaSubPreguntaEvaluacion);} if(this.subpreguntaevaluacionConstantesFunciones.resaltarporcentaje_siSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldporcentaje_siSubPreguntaEvaluacion.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltarporcentaje_siSubPreguntaEvaluacion);} if(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_facturaSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_facturaSubPreguntaEvaluacion.setBorderPainted(true);this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_facturaSubPreguntaEvaluacion.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_facturaSubPreguntaEvaluacion);} if(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_orden_compraSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_orden_compraSubPreguntaEvaluacion.setBorderPainted(true);this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_orden_compraSubPreguntaEvaluacion.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_orden_compraSubPreguntaEvaluacion);} if(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_completoSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_completoSubPreguntaEvaluacion.setBorderPainted(true);this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_completoSubPreguntaEvaluacion.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_completoSubPreguntaEvaluacion);} if(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_a_tiempoSubPreguntaEvaluacion!=null && this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) {this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_a_tiempoSubPreguntaEvaluacion.setBorderPainted(true);this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_a_tiempoSubPreguntaEvaluacion.setBorder(this.subpreguntaevaluacionConstantesFunciones.resaltarcon_a_tiempoSubPreguntaEvaluacion);} } public void updateVisibilidadResaltarControlesFormularioSubPreguntaEvaluacion() throws Exception { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelidSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostraridSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelidSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostraridSubPreguntaEvaluacion); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarid_empresaSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelid_empresaSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarid_empresaSubPreguntaEvaluacion); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarid_sucursalSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelid_sucursalSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarid_sucursalSubPreguntaEvaluacion); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarid_pregunta_evaluacionSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelid_pregunta_evaluacionSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarid_pregunta_evaluacionSubPreguntaEvaluacion); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarid_ejercicioSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelid_ejercicioSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarid_ejercicioSubPreguntaEvaluacion); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarid_periodoSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelid_periodoSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarid_periodoSubPreguntaEvaluacion); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldordenSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarordenSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelordenSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarordenSubPreguntaEvaluacion); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextAreapreguntaSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarpreguntaSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelpreguntaSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarpreguntaSubPreguntaEvaluacion); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldporcentaje_siSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarporcentaje_siSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelporcentaje_siSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarporcentaje_siSubPreguntaEvaluacion); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_facturaSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarcon_facturaSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelcon_facturaSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarcon_facturaSubPreguntaEvaluacion); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_orden_compraSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarcon_orden_compraSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelcon_orden_compraSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarcon_orden_compraSubPreguntaEvaluacion); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_completoSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarcon_completoSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelcon_completoSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarcon_completoSubPreguntaEvaluacion); //this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_a_tiempoSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarcon_a_tiempoSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jPanelcon_a_tiempoSubPreguntaEvaluacion.setVisible(this.subpreguntaevaluacionConstantesFunciones.mostrarcon_a_tiempoSubPreguntaEvaluacion); } } public void updateHabilitarResaltarControlesFormularioSubPreguntaEvaluacion() throws Exception { if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } if(this.jInternalFrameDetalleFormSubPreguntaEvaluacion!=null) { this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jLabelidSubPreguntaEvaluacion.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activaridSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_empresaSubPreguntaEvaluacion.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activarid_empresaSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_sucursalSubPreguntaEvaluacion.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activarid_sucursalSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_pregunta_evaluacionSubPreguntaEvaluacion.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activarid_pregunta_evaluacionSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_ejercicioSubPreguntaEvaluacion.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activarid_ejercicioSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jComboBoxid_periodoSubPreguntaEvaluacion.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activarid_periodoSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldordenSubPreguntaEvaluacion.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activarordenSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextAreapreguntaSubPreguntaEvaluacion.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activarpreguntaSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jTextFieldporcentaje_siSubPreguntaEvaluacion.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activarporcentaje_siSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_facturaSubPreguntaEvaluacion.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activarcon_facturaSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_orden_compraSubPreguntaEvaluacion.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activarcon_orden_compraSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_completoSubPreguntaEvaluacion.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activarcon_completoSubPreguntaEvaluacion); this.jInternalFrameDetalleFormSubPreguntaEvaluacion.jCheckBoxcon_a_tiempoSubPreguntaEvaluacion.setEnabled(this.subpreguntaevaluacionConstantesFunciones.activarcon_a_tiempoSubPreguntaEvaluacion); } } }
bhoopal10/opengse
engines/minigse/java/com/google/opengse/io/FileCollection.java
// Copyright 2007 Google Inc. 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 com.google.opengse.io; import java.io.IOException; import java.net.URL; import java.net.MalformedURLException; import java.util.List; /** * A collection of files, such as a directory, jar file, tarball, etc. */ public interface FileCollection { /** * The name of this collection. */ public String getCollectionName(); /** * Return this collection as a representation of one or more URLs (usually 1). * * @return * @throws MalformedURLException */ public URL[] getUrls() throws MalformedURLException; /** * Release any resources held by this collection. */ public void releaseResources(); /** * Determine if a given file is contained by this collection. * The file specified uses forward slashes. * eg. C:/path/to/file.ext */ public boolean containsFile(String file); /** * Get the names of all of the files in this collection. */ public List<String> getFileNames(); /** * Get the bytes of a given file. */ public byte[] getBytes(String file) throws IOException; /** * Get the given file as a URL. */ public URL getResource(String file) throws IOException; /** * Get the given file as an array of URLs (useful when a container * may contain more than one instance of a file). */ public URL[] getResources(String file) throws IOException; }
Plan9-Archive/plan9-2e
sys/src/9/pc/ether8003.c
<reponame>Plan9-Archive/plan9-2e #include "u.h" #include "../port/lib.h" #include "mem.h" #include "dat.h" #include "fns.h" #include "../port/error.h" #include "io.h" #include "devtab.h" #include "ether.h" /* * Western Digital/Standard Microsystems Corporation cards (WD80[01]3). * Configuration code based on that provided by SMC. */ enum { /* 83C584 Bus Interface Controller */ Msr = 0x00, /* Memory Select Register */ Icr = 0x01, /* Interface Configuration Register */ Iar = 0x02, /* I/O Address Register */ Bio = 0x03, /* BIOS ROM Address Register */ Ear = 0x03, /* EEROM Address Register (shared with Bio) */ Irr = 0x04, /* Interrupt Request Register */ Laar = 0x05, /* LA Address Register */ Ijr = 0x06, /* Initialisation Jumpers */ Gp2 = 0x07, /* General Purpose Data Register */ Lar = 0x08, /* LAN Address Registers */ Id = 0x0E, /* Card ID byte */ Cksum = 0x0F, /* Checksum */ }; enum { /* Msr */ Rst = 0x80, /* software reset */ Menb = 0x40, /* memory enable */ }; enum { /* Icr */ Bit16 = 0x01, /* 16-bit bus */ Other = 0x02, /* other register access */ Ir2 = 0x04, /* IR2 */ Msz = 0x08, /* SRAM size */ Rla = 0x10, /* recall LAN address */ Rx7 = 0x20, /* recall all but I/O and LAN address */ Rio = 0x40, /* recall I/O address from EEROM */ Sto = 0x80, /* non-volatile EEROM store */ }; enum { /* Laar */ ZeroWS16 = (1<<5), /* zero wait states for 16-bit ops */ L16en = (1<<6), /* enable 16-bit LAN operation */ M16en = (1<<7), /* enable 16-bit memory access */ }; /* * Mapping from configuration bits to interrupt level. */ static int intrmap[] = { 9, 3, 5, 7, 10, 11, 15, 4, }; static void* read(Ctlr *ctlr, void *to, ulong from, ulong len) { /* * In this case, 'from' is an index into the shared memory. */ memmove(to, (void*)(ctlr->card.mem+from), len); return to; } static void* write(Ctlr *ctlr, ulong to, void *from, ulong len) { /* * In this case, 'to' is an index into the shared memory. */ memmove((void*)(ctlr->card.mem+to), from, len); return (void*)to; } static void watch(Ctlr *ctlr) { uchar msr; int s; s = splhi(); msr = inb(ctlr->card.port+Msr); /* * If the card has reset itself, * start again. */ if((msr & Menb) == 0){ delay(100); dp8390reset(ctlr); etherinit(); wakeup(&ctlr->tr); wakeup(&ctlr->rr); } splx(s); } /* * Get configuration parameters, enable memory. * There are opportunities here for buckets of code. * We'll try to resist. */ int wd8003reset(Ctlr *ctlr) { int i; uchar ea[Eaddrlen], ic[8], sum; ulong wd8003; /* * Set up the software configuration. * Use defaults for port, irq, mem and size if not specified. * Defaults are set for the dumb 8003E which can't be * autoconfigured. */ if(ctlr->card.port == 0) ctlr->card.port = 0x280; if(ctlr->card.irq == 0) ctlr->card.irq = 3; if(ctlr->card.mem == 0) ctlr->card.mem = 0xD0000; if(ctlr->card.size == 0) ctlr->card.size = 8*1024; ctlr->card.reset = wd8003reset; ctlr->card.attach = dp8390attach; ctlr->card.mode = dp8390mode; ctlr->card.read = read; ctlr->card.write = write; ctlr->card.receive = dp8390receive; ctlr->card.transmit = dp8390transmit; ctlr->card.intr = dp8390intr; ctlr->card.watch = watch; ctlr->card.ram = 1; wd8003 = ctlr->card.port; /* * Look for the interface. We read the LAN address ROM * and validate the checksum - the sum of all 8 bytes * should be 0xFF. * While we're at it, get the (possible) interface chip * registers, we'll use them to check for aliasing later. */ sum = 0; for(i = 0; i < sizeof(ctlr->ea); i++){ ea[i] = inb(wd8003+Lar+i); sum += ea[i]; ic[i] = inb(wd8003+i); } sum += inb(wd8003+Id); sum += inb(wd8003+Cksum); if(sum != 0xFF) return -1; /* * Check for old, dumb 8003E, which doesn't have an interface * chip. Only the msr exists out of the 1st eight registers, reads * of the others just alias the 2nd eight registers, the LAN * address ROM. We can check icr, irr and laar against the ethernet * address read above and if they match it's an 8003E (or an * 8003EBT, 8003S, 8003SH or 8003WT, we don't care), in which * case the default irq gets used. */ if(memcmp(&ctlr->ea[1], &ic[1], 5) == 0){ memset(ic, 0, sizeof(ic)); ic[Msr] = (((ulong)ctlr->card.mem)>>13) & 0x3F; ctlr->card.watch = 0; } else{ /* * As a final sanity check for the 8013EBT, which doesn't have * the 83C584 interface chip, but has 2 real registers, write Gp2 and if * it reads back the same, it's not an 8013EBT. */ outb(wd8003+Gp2, 0xAA); inb(wd8003+Msr); /* wiggle bus */ if(inb(wd8003+Gp2) != 0xAA){ memset(ic, 0, sizeof(ic)); ic[Msr] = (((ulong)ctlr->card.mem)>>13) & 0x3F; ctlr->card.watch = 0; } else ctlr->card.irq = intrmap[((ic[Irr]>>5) & 0x3)|(ic[Icr] & Ir2)]; /* * Check if 16-bit card. * If Bit16 is read/write, then we have an 8-bit card. * If Bit16 is set, we're in a 16-bit slot. */ outb(wd8003+Icr, ic[Icr]^Bit16); inb(wd8003+Msr); /* wiggle bus */ if((inb(wd8003+Icr) & Bit16) == (ic[Icr] & Bit16)){ ctlr->card.bit16 = 1; ic[Icr] &= ~Bit16; } outb(wd8003+Icr, ic[Icr]); if(ctlr->card.bit16 && (inb(wd8003+Icr) & Bit16) == 0) ctlr->card.bit16 = 0; /* * Force the memory size. */ if(ctlr->card.bit16) ctlr->card.size = 16*1024; else ctlr->card.size = 8*1024; } ctlr->card.mem = KZERO|((ic[Msr] & 0x3F)<<13); if(ctlr->card.bit16) ctlr->card.mem |= (ic[Laar] & 0x1F)<<19; else ctlr->card.mem |= 0x80000; if(ic[Icr] & Msz) ctlr->card.size <<= 2; /* * Set the DP8390 ring addresses. */ ctlr->card.dp8390 = wd8003+0x10; ctlr->card.tstart = 0; ctlr->card.pstart = HOWMANY(sizeof(Etherpkt), Dp8390BufSz); ctlr->card.pstop = HOWMANY(ctlr->card.size, Dp8390BufSz); /* * Enable interface RAM, set interface width. */ outb(wd8003+Msr, ic[Msr]|Menb); if(ctlr->card.bit16) outb(wd8003+Laar, ic[Laar]|L16en|M16en|ZeroWS16); /* * Finally, init the 8390 and set the * ethernet address. */ dp8390reset(ctlr); if((ctlr->ea[0]|ctlr->ea[1]|ctlr->ea[2]|ctlr->ea[3]|ctlr->ea[4]|ctlr->ea[5]) == 0) memmove(ctlr->ea, ea, Eaddrlen); dp8390setea(ctlr); if(getisa(ctlr->card.mem, ctlr->card.size, 0) == 0) panic("ether8003: 0x%lux reused", ctlr->card.mem); return 0; } void ether8003link(void) { addethercard("WD8003", wd8003reset); }
philipjameson/buckit
infra_macros/fbcode_macros/build_defs/lib/thrift/python.bzl
<gh_stars>0 """ """ load("@bazel_skylib//lib:collections.bzl", "collections") load("@bazel_skylib//lib:paths.bzl", "paths") load("@fbcode_macros//build_defs/lib/thrift:thrift_interface.bzl", "thrift_interface") load( "@fbcode_macros//build_defs/lib:python_typing.bzl", "gen_typing_config", "get_typing_config_target", ) load("@fbcode_macros//build_defs/lib:target_utils.bzl", "target_utils") load("@fbcode_macros//build_defs/lib:thrift_common.bzl", "thrift_common") load("@fbsource//tools/build_defs:fb_native_wrapper.bzl", "fb_native") _NORMAL = "normal" _TWISTED = "twisted" _ASYNCIO = "asyncio" _PYI = "pyi" _PYI_ASYNCIO = "pyi-asyncio" _NORMAL_EXT = ".py" _TWISTED_EXT = ".py" _ASYNCIO_EXT = ".py" _PYI_EXT = ".pyi" _PYI_ASYNCIO_EXT = ".pyi" _THRIFT_PY_LIB_RULE_NAME = target_utils.RootRuleTarget("thrift/lib/py", "py") _THRIFT_PY_TWISTED_LIB_RULE_NAME = target_utils.RootRuleTarget("thrift/lib/py", "twisted") _THRIFT_PY_ASYNCIO_LIB_RULE_NAME = target_utils.RootRuleTarget("thrift/lib/py", "asyncio") _POSTPROCESS_MSG_NO_BASE_MODULE = """ Compiling {src} did not generate source in {ttypes_path} Does the "\\"namespace {py_flavor}\\"" directive in the thrift file match the base_module specified in the TARGETS file? base_module not specified, assumed to be "\\"{base_module}\\"" thrift file should contain "\\"namespace {py_flavor} {expected_ns}\\"" """.strip() _POSTPROCESS_MSG_WITH_BASE_MODULE = """ Compiling {src} did not generate source in {ttypes_path} Does the "\\"namespace {py_flavor}\\"" directive in the thrift file match the base_module specified in the TARGETS file? base_module is "\\"{base_module}\\"" thrift file should contain "\\"namespace {py_flavor} {expected_ns}\\"" """.strip() def _get_name(flavor, prefix, sep, base_module = False): if flavor in (_PYI, _PYI_ASYNCIO): if not base_module: return flavor elif flavor == _PYI_ASYNCIO: flavor = _ASYNCIO else: flavor = _NORMAL if flavor in (_TWISTED, _ASYNCIO): prefix += sep + flavor return prefix def _get_thrift_base(thrift_src): return paths.split_extension(paths.basename(thrift_src))[0] def _get_base_module(flavor, **kwargs): """ Get the user-specified base-module set in via the parameter in the `thrift_library()`. """ base_module = kwargs.get( _get_name(flavor, "py", "_", base_module = True) + "_base_module", ) # If no asyncio/twisted specific base module parameter is present, # fallback to using the general `py_base_module` parameter. if base_module == None: base_module = kwargs.get("py_base_module") # If nothing is set, just return `None`. if base_module == None: return None # Otherwise, since we accept pathy base modules, normalize it to look # like a proper module. return "/".join(base_module.split(".")) def _get_thrift_dir(base_path, thrift_src, flavor, **kwargs): thrift_base = _get_thrift_base(thrift_src) base_module = _get_base_module(flavor, **kwargs) if base_module == None: base_module = base_path return paths.join(base_module, thrift_base) def _add_ext(path, ext): if not path.endswith(ext): path += ext return path def _get_pyi_dependency(name, flavor): if name.endswith("-asyncio"): name = name[:-len("-asyncio")] if name.endswith("-py"): name = name[:-len("-py")] if flavor == _ASYNCIO: return name + "-pyi-asyncio" else: return name + "-pyi" def _get_names(flavor): return collections.uniq([ _get_name(flavor, "py", "-"), _get_name(flavor, "python", "-"), ]) def _normal_get_names(): return _get_names(_NORMAL) def _twisted_get_names(): return _get_names(_TWISTED) def _asyncio_get_names(): return _get_names(_ASYNCIO) def _pyi_get_names(): return _get_names(_PYI) def _pyi_asyncio_get_names(): return _get_names(_PYI_ASYNCIO) def _normal_get_lang(): return _get_name(_NORMAL, "py", "-") def _twisted_get_lang(): return _get_name(_TWISTED, "py", "-") def _asyncio_get_lang(): return _get_name(_ASYNCIO, "py", "-") def _pyi_get_lang(): return _get_name(_PYI, "py", "-") def _pyi_asyncio_get_lang(): return _get_name(_PYI_ASYNCIO, "py", "-") def _normal_get_compiler_lang(): return "py" def _twisted_get_compiler_lang(): return "py" def _asyncio_get_compiler_lang(): return "py" def _pyi_get_compiler_lang(): return "mstch_pyi" def _pyi_asyncio_get_compiler_lang(): return "mstch_pyi" def _get_postprocess_command( base_path, thrift_src, out_dir, flavor, ext, **kwargs): # The location of the generated thrift files depends on the value of # the "namespace py" directive in the .thrift file, and we # unfortunately don't know what this value is. After compilation, make # sure the ttypes.py file exists in the location we expect. If not, # there is probably a mismatch between the base_module parameter in the # TARGETS file and the "namespace py" directive in the .thrift file. thrift_base = _get_thrift_base(thrift_src) thrift_dir = _get_thrift_dir(base_path, thrift_src, flavor, **kwargs) output_dir = paths.join(out_dir, "gen-py", thrift_dir) ttypes_path = paths.join(output_dir, "ttypes" + ext) if flavor == _ASYNCIO or flavor == _PYI_ASYNCIO: py_flavor = "py.asyncio" elif flavor == _TWISTED: py_flavor = "py.twisted" else: py_flavor = "py" base_module = _get_base_module(flavor = flavor, **kwargs) if base_module == None: base_module = base_path msg_template = _POSTPROCESS_MSG_NO_BASE_MODULE else: msg_template = _POSTPROCESS_MSG_WITH_BASE_MODULE expected_ns = [p for p in base_module.split("/") if p] expected_ns.append(thrift_base) expected_ns = ".".join(expected_ns) msg = msg_template.format( src = paths.join(base_path, thrift_src), ttypes_path = ttypes_path, py_flavor = py_flavor, base_module = base_module, expected_ns = expected_ns, ) cmd = "if [ ! -f %s ]; then " % (ttypes_path,) for line in msg.splitlines(): cmd += ' echo "%s" >&2;' % (line,) cmd += " false; fi" return cmd def _normal_get_postprocess_command( base_path, thrift_src, out_dir, **kwargs): return _get_postprocess_command( base_path, thrift_src, out_dir, _NORMAL, _NORMAL_EXT, **kwargs ) def _twisted_get_postprocess_command( base_path, thrift_src, out_dir, **kwargs): return _get_postprocess_command( base_path, thrift_src, out_dir, _TWISTED, _TWISTED_EXT, **kwargs ) def _asyncio_get_postprocess_command( base_path, thrift_src, out_dir, **kwargs): return _get_postprocess_command( base_path, thrift_src, out_dir, _ASYNCIO, _ASYNCIO_EXT, **kwargs ) def _pyi_get_postprocess_command( base_path, thrift_src, out_dir, **kwargs): return _get_postprocess_command( base_path, thrift_src, out_dir, _PYI, _PYI_EXT, **kwargs ) def _pyi_asyncio_get_postprocess_command( base_path, thrift_src, out_dir, **kwargs): return _get_postprocess_command( base_path, thrift_src, out_dir, _PYI_ASYNCIO, _PYI_ASYNCIO_EXT, **kwargs ) def _get_options(parsed_options, flavor): options = {} # We always use new style for non-python3. if "new_style" in parsed_options: fail('the "new_style" thrift python option is redundant') # Add flavor-specific option. if flavor == _TWISTED: options["twisted"] = None elif flavor in (_ASYNCIO, _PYI_ASYNCIO): options["asyncio"] = None # Always use "new_style" classes. options["new_style"] = None options.update(parsed_options) return options def _normal_get_options(base_path, parsed_options): _ignore = base_path return _get_options(parsed_options, _NORMAL) def _twisted_get_options(base_path, parsed_options): _ignore = base_path return _get_options(parsed_options, _TWISTED) def _asyncio_get_options(base_path, parsed_options): _ignore = base_path return _get_options(parsed_options, _ASYNCIO) def _pyi_get_options(base_path, parsed_options): _ignore = base_path return _get_options(parsed_options, _PYI) def _pyi_asyncio_get_options(base_path, parsed_options): _ignore = base_path return _get_options(parsed_options, _PYI_ASYNCIO) def _get_generated_sources( base_path, thrift_src, services, flavor, ext, **kwargs): thrift_base = _get_thrift_base(thrift_src) thrift_dir = _get_thrift_dir(base_path, thrift_src, flavor, **kwargs) genfiles = [] genfiles.append("constants" + ext) genfiles.append("ttypes" + ext) for service in services: # "<service>.py" and "<service>-remote" are generated for each # service genfiles.append(service + ext) if flavor == _NORMAL: genfiles.append(service + "-remote") return { _add_ext(paths.join(thrift_base, path), ext): paths.join("gen-py", thrift_dir, path) for path in genfiles } def _normal_get_generated_sources( base_path, name, thrift_src, services, options, **kwargs): _ignore = name _ignore = options return _get_generated_sources( base_path, thrift_src, services, _NORMAL, _NORMAL_EXT, **kwargs ) def _twisted_get_generated_sources( base_path, name, thrift_src, services, options, **kwargs): _ignore = name _ignore = options return _get_generated_sources( base_path, thrift_src, services, _TWISTED, _TWISTED_EXT, **kwargs ) def _asyncio_get_generated_sources( base_path, name, thrift_src, services, options, **kwargs): _ignore = name _ignore = options return _get_generated_sources( base_path, thrift_src, services, _ASYNCIO, _ASYNCIO_EXT, **kwargs ) def _pyi_get_generated_sources( base_path, name, thrift_src, services, options, **kwargs): _ignore = name _ignore = options return _get_generated_sources( base_path, thrift_src, services, _PYI, _PYI_EXT, **kwargs ) def _pyi_asyncio_get_generated_sources( base_path, name, thrift_src, services, options, **kwargs): _ignore = name _ignore = options return _get_generated_sources( base_path, thrift_src, services, _PYI_ASYNCIO, _PYI_ASYNCIO_EXT, **kwargs ) def _get_language_rule( base_path, name, options, sources_map, deps, visibility, flavor, **kwargs): srcs = thrift_common.merge_sources_map(sources_map) base_module = _get_base_module(flavor, **kwargs) out_deps = [] out_deps.extend(deps) # If this rule builds thrift files, automatically add a dependency # on the python thrift library. out_deps.append(target_utils.target_to_label(_THRIFT_PY_LIB_RULE_NAME)) # If thrift files are build with twisted support, add also # dependency on the thrift's twisted transport library. if flavor == _TWISTED or "twisted" in options: out_deps.append( target_utils.target_to_label(_THRIFT_PY_TWISTED_LIB_RULE_NAME), ) # If thrift files are build with asyncio support, add also # dependency on the thrift's asyncio transport library. if flavor == _ASYNCIO or "asyncio" in options: out_deps.append( target_utils.target_to_label(_THRIFT_PY_ASYNCIO_LIB_RULE_NAME), ) if flavor in (_NORMAL, _ASYNCIO): out_deps.append(":" + _get_pyi_dependency(name, flavor)) has_types = True else: has_types = False if get_typing_config_target(): if has_types: gen_typing_config( name, base_module if base_module != None else base_path, srcs.keys(), out_deps, typing = True, visibility = visibility, ) else: gen_typing_config(name) fb_native.python_library( name = name, visibility = visibility, srcs = srcs, base_module = base_module, deps = out_deps, ) def _normal_get_language_rule( base_path, name, thrift_srcs, options, sources_map, deps, visibility, **kwargs): _ignore = thrift_srcs return _get_language_rule( base_path, name, options, sources_map, deps, visibility, _NORMAL, **kwargs ) def _twisted_get_language_rule( base_path, name, thrift_srcs, options, sources_map, deps, visibility, **kwargs): _ignore = thrift_srcs return _get_language_rule( base_path, name, options, sources_map, deps, visibility, _TWISTED, **kwargs ) def _asyncio_get_language_rule( base_path, name, thrift_srcs, options, sources_map, deps, visibility, **kwargs): _ignore = thrift_srcs return _get_language_rule( base_path, name, options, sources_map, deps, visibility, _ASYNCIO, **kwargs ) def _pyi_get_language_rule( base_path, name, thrift_srcs, options, sources_map, deps, visibility, **kwargs): _ignore = thrift_srcs return _get_language_rule( base_path, name, options, sources_map, deps, visibility, _PYI, **kwargs ) def _pyi_asyncio_get_language_rule( base_path, name, thrift_srcs, options, sources_map, deps, visibility, **kwargs): _ignore = thrift_srcs return _get_language_rule( base_path, name, options, sources_map, deps, visibility, _PYI_ASYNCIO, **kwargs ) python_normal_thrift_converter = thrift_interface.make( get_lang = _normal_get_lang, get_names = _normal_get_names, get_compiler_lang = _normal_get_compiler_lang, get_generated_sources = _normal_get_generated_sources, get_language_rule = _normal_get_language_rule, get_options = _normal_get_options, get_postprocess_command = _normal_get_postprocess_command, ) python_twisted_thrift_converter = thrift_interface.make( get_lang = _twisted_get_lang, get_names = _twisted_get_names, get_compiler_lang = _twisted_get_compiler_lang, get_generated_sources = _twisted_get_generated_sources, get_language_rule = _twisted_get_language_rule, get_options = _twisted_get_options, get_postprocess_command = _twisted_get_postprocess_command, ) python_asyncio_thrift_converter = thrift_interface.make( get_lang = _asyncio_get_lang, get_names = _asyncio_get_names, get_compiler_lang = _asyncio_get_compiler_lang, get_generated_sources = _asyncio_get_generated_sources, get_language_rule = _asyncio_get_language_rule, get_options = _asyncio_get_options, get_postprocess_command = _asyncio_get_postprocess_command, ) python_pyi_thrift_converter = thrift_interface.make( get_lang = _pyi_get_lang, get_names = _pyi_get_names, get_compiler_lang = _pyi_get_compiler_lang, get_generated_sources = _pyi_get_generated_sources, get_language_rule = _pyi_get_language_rule, get_options = _pyi_get_options, get_postprocess_command = _pyi_get_postprocess_command, ) python_pyi_asyncio_thrift_converter = thrift_interface.make( get_lang = _pyi_asyncio_get_lang, get_names = _pyi_asyncio_get_names, get_compiler_lang = _pyi_asyncio_get_compiler_lang, get_generated_sources = _pyi_asyncio_get_generated_sources, get_language_rule = _pyi_asyncio_get_language_rule, get_options = _pyi_asyncio_get_options, get_postprocess_command = _pyi_asyncio_get_postprocess_command, )
leops/rasen-editor
app/components/Node.js
<filename>app/components/Node.js<gh_stars>1-10 // @flow import React from 'react'; // eslint-disable-next-line no-duplicate-imports import type { Element } from 'react'; import type { List } from 'immutable'; import type { Node as NodeData } from 'react-graph-editor'; import styles from './Node.css'; type NodeProps = { node: NodeData, selected: boolean, inputs: List<Element<any>>, outputs: List<Element<any>> }; export default (props: NodeProps) => ( <div className={styles.node} style={{ borderColor: props.selected && '#FF6100', boxShadow: props.selected && '0 1px 6px rgba(0, 0, 0, 0.2)', }}> <div className={styles.head}> <h3>{props.node.title}</h3> </div> <div className={styles.body}> <div className={styles.inputs}> {props.inputs} </div> <div className={styles.outputs}> {props.outputs} </div> </div> </div> );
ilastik/hytra
scripts/compare_tracking.py
# pythonpath modification to make hytra available # for import without requiring it to be installed import os import sys sys.path.insert(0, os.path.abspath('..')) # standard imports import numpy as np import cPickle import collections import multiprocessing import os import os.path as path import optparse import sys from empryonic import io from empryonic.learning import match as m from empryonic.learning import quantification as quant import h5py def match(fn_pair): assoc = m.match_files(fn_pair[0], fn_pair[1], options.threshold, options.ignore_z, options.swap_xy, verbose=False) print("-> matched: " + path.basename(fn_pair[0]) + " <-> " + path.basename(fn_pair[1])) return assoc def getIdsAndValidity(h5file): try: ids = np.sort(h5file['objects/meta/id'][()]) valid = h5file['objects/meta/valid'][()] except: print("Warning: could not load ids and validity from hdf5 file. Reconstructing from segmentation...") labelImage = h5file['segmentation/labels'][()] ids = np.unique(labelImage) ids = ids[ids > 0] valid = np.ones(ids.shape) return ids, valid def construct_associations(base_fns, cont_fns, timesteps, verbose=False): assocs = [] for t in range(timesteps): base_fn = base_fns[t] cont_fn = cont_fns[t] assert(int(os.path.splitext(os.path.basename(base_fn))[0]) == int(os.path.splitext(os.path.basename(cont_fn))[0])) with h5py.File(base_fn, 'r') as f: base_ids, base_valid = getIdsAndValidity(f) # base_detection = f['objects/meta/detection'][()] with h5py.File(cont_fn, 'r') as f: cont_ids, cont_valid = getIdsAndValidity(f) # cont_detection = f['objects/meta/detection'][()] if verbose: print("sanity checking %d" % t) assert(np.all(base_ids == cont_ids)) assert(np.all(base_valid == 1)) assert(np.all(cont_valid == 1)) base_ids = map(int, base_ids) cont_ids = map(int, cont_ids) assoc = {'lhs':dict(zip(base_ids, cont_ids)), 'rhs':dict(zip(cont_ids, base_ids))} assocs.append(assoc) return assocs def get_all_frame_files_from_folder(folder): fns = {} for fn in os.listdir(folder): name, ext = os.path.splitext(os.path.basename(fn)) try: if ext == '.h5': fns[int(name)] = path.abspath(path.join(folder, fn)) except: pass return fns def get_tracking_filenames(base_dir, cont_dir): base_fns = get_all_frame_files_from_folder(base_dir) cont_fns = get_all_frame_files_from_folder(cont_dir) base_ids = set(base_fns.keys()) cont_ids = set(cont_fns.keys()) # intersect ids shared_ids = base_ids & cont_ids assert(set(range(min(shared_ids), max(shared_ids) + 1)) == shared_ids) base_fns = [base_fns[fid] for fid in shared_ids] cont_fns = [cont_fns[fid] for fid in shared_ids] base_fns.sort() cont_fns.sort() return base_fns, cont_fns if __name__=="__main__": usage = """%prog [options] BASE_DIR CONTESTANT_DIR Compare two tracking results, based only on the association information in the tracking group. """ parser = optparse.OptionParser(usage=usage) parser.add_option('--quietly', action='store_true', dest='quiet', help='non-verbose') parser.add_option('--max-ts', dest='max_ts', type=int, default=-1, help='max. timestep (exclusive) [default=%default]') #parser.add_option('--no-detailed-stats', action='store_true', dest='no_detailed_stats', help="don't write detailed statistics into an output file") #parser.add_option('-o', type='str', dest='output_fn', default='batch_performance.txt', help='output file for detailed stats; no effect if "--no-detailed-stats" is set [default: %default]') #parser.add_option('-t', '--threshold', type='float', dest='threshold', default=25, help='distance threshold for the matching (matching only below the threshold) [default: %default]') #parser.add_option('--swap-xy', action='store_true', dest='swap_xy', help='switches x and y coordinates of the traxels in FILE1') #parser.add_option('--ignore-z', action='store_true', dest='ignore_z', help='only match in the x-y subspace') #parser.add_option('--precomputed-match', action='store_true', dest='precomputed_match', help='match files will be loaded from ./matched/ [invalidates all match related options]') options, args = parser.parse_args() verbose = not bool(options.quiet) numArgs = len(args) if numArgs == 2: base_dir = args[0] cont_dir = args[1] base_fns, cont_fns = get_tracking_filenames(base_dir, cont_dir) else: parser.print_help() sys.exit(1) if options.max_ts != -1: base_fns = base_fns[:options.max_ts] if len(base_fns) < 2: print("Abort: at least two base files needed.") sys.exit(1) if len(cont_fns) < 2: print("Abort: at least two contestant files needed.") sys.exit(1) # if len(base_fns) != len(cont_fns): # print "Warning: number of base files has to match number of contestant files." timesteps = min((len(base_fns), len(cont_fns))) first_timestep = int(os.path.splitext(os.path.basename(base_fns[0]))[0]) ## ## construct id assocs; assumed to be identically mapped in this script ## (i.e. the ids don't differ for the same object in base and contestant) ## assocs = construct_associations(base_fns, cont_fns, timesteps, verbose) ## ## generate taxonomy ## fn_pairs = zip(base_fns[0:timesteps], cont_fns[0:timesteps]) assert(timesteps == len(assocs)) ts = [] for i,v in enumerate(fn_pairs[1:]): if verbose: print(path.basename(v[0]), path.basename(v[1])) t = quant.compute_taxonomy(assocs[i], assocs[i+1], v[0], v[1], i + first_timestep + 1) ts.append(t) #sys.stdout.write('%d ' % i) sys.stdout.flush() overall = reduce( quant.Taxonomy.union, ts ) def total_elements( taxonomy ): return len(taxonomy.base_basic) + len(taxonomy.cont_basic) assert(sum((total_elements(t) for t in ts)) == total_elements(overall)) ## ## report results ## if verbose: print("Measuring performance...") print("-> Precision: %.3f" % overall.precision()) print("-> Recall: %.3f" % overall.recall()) print("-> F-measure %.3f: " % overall.f_measure()) print("Check", 2.*overall.precision() * overall.recall() / (overall.precision() + overall.recall())) print(overall) else: print(overall.to_line())
MuhammadIsmailShahzad/ckan-cloud-operator
ckan_cloud_operator/config/manager.py
<gh_stars>10-100 import base64 import os import yaml from sys import stdout from ckan_cloud_operator import kubectl from ckan_cloud_operator import logs from ckan_cloud_operator.providers.cluster import manager as cluster_manager from ckan_cloud_operator.labels import manager as labels_manager __CACHED_VALUES = {} def get(key=None, default=None, secret_name=None, configmap_name=None, namespace=None, required=False, template=None): cache_key = _get_cache_key(secret_name, configmap_name, namespace) if cache_key not in __CACHED_VALUES: __CACHED_VALUES[cache_key] = _fetch(cache_key) if key: value = __CACHED_VALUES[cache_key].get(key, default) else: value = __CACHED_VALUES[cache_key] assert value or not required, f'config value is required for {cache_key}:{key}' if template: if key: return template.format(**{key: value}) else: return template.format(**value) else: return value def set(key=None, value=None, values=None, secret_name=None, configmap_name=None, namespace=None, extra_operator_labels=None, from_file=False, dry_run=False): log_kwargs = {'func': 'config/set', 'secret': secret_name, 'configmap': configmap_name, 'namespace': namespace} cache_key = _get_cache_key(secret_name, configmap_name, namespace) if secret_name is None and configmap_name is None and namespace is None: # hack to set label-prefix to bootstrap the environment if key == 'label-prefix' and not values: label_prefix = value elif not key and 'label-prefix' in values: label_prefix = values['label-prefix'] else: label_prefix = None if label_prefix: __CACHED_VALUES.setdefault(cache_key, {})['label-prefix'] = label_prefix logs.debug('start', **log_kwargs) if from_file: assert key and value and not values with open(value) as f: value = f.read() values = {key: value} elif key or value: assert key and value and not values, 'Invalid arguments: must specify both key and value args and not specify values arg' values = {key: value} assert values, 'Invalid arguments: no values to save' return _save(cache_key, values, extra_operator_labels, dry_run=dry_run) def delete_key(key, secret_name=None, namespace=None): kubectl.apply({ 'apiVersion': 'v1', 'kind': 'Secret', 'metadata': { 'name': secret_name, 'namespace': namespace }, 'type': 'Opaque', 'data': { k: base64.b64encode(v.encode()).decode() for k, v in kubectl.decode_secret(kubectl.get('secret', secret_name, namespace=namespace)).items() if k != key and v } }) def delete(secret_name=None, configmap_name=None, namespace=None, exists_ok=False): cache_key = _get_cache_key(secret_name, configmap_name, namespace) _delete(cache_key, exists_ok) def delete_by_extra_operator_labels(extra_operator_labels): labels = labels_manager.get_resource_labels(extra_operator_labels) labels_manager.delete_by_labels(labels, kinds=['configmap', 'secret']) def list_configs(namespace=None, full=False, show_secrets=False): label_prefix = labels_manager.get_label_prefix() if not namespace: namespace = cluster_manager.get_operator_namespace_name() what = 'configmaps' if show_secrets: what += ',secrets' configs = kubectl.get(what, '-l', f'{label_prefix}/operator-config-namespace={namespace}', required=False) if configs: for config in configs.get('items', []): kind = config['kind'] name = config.get('metadata', {}).get('name') data = {'kind': config['kind'], 'name': config.get('metadata', {}).get('name')} if full: if name: data['values'] = get( secret_name=name if kind == 'Secret' else None, configmap_name=name if kind == 'ConfigMap' else None, namespace=namespace, required=False ) else: data['values'] = None yield data def get_preset_answer(namespace, configmap_name, secret_name, key, default=None): interactive_file = os.environ.get('CCO_INTERACTIVE_CI') if not interactive_file: return answers = yaml.load(open(interactive_file)) section = '?' subsection = '?' namespace = namespace or 'default' try: if configmap_name: section = 'config' subsection = configmap_name else: section = 'secrets' subsection = secret_name return answers[namespace][section][subsection][key] except: if default is not None: return default logs.error(f'Failed to find in interactive file value for {namespace}.{section}.{subsection}.{key}') raise def interactive_set(default_values, secret_name=None, configmap_name=None, namespace=None, from_file=False, extra_operator_labels=None, interactive=True): log_kwargs = {'func': 'config/interactive_set', 'secret': secret_name, 'configmap': configmap_name, 'namespace': namespace} logs.debug('start', **log_kwargs) set_values = {} for key, default_value in default_values.items(): saved_value = get(key, secret_name=secret_name, configmap_name=configmap_name, namespace=namespace) preset_value = get_preset_answer(namespace, configmap_name, secret_name, key, default=default_value) if preset_value: set_values[key] = preset_value elif interactive and stdout.isatty(): if saved_value: if from_file: msg = ', leave empty to use the saved value' else: msg = f', leave empty to use the saved value: {saved_value}' default_value = saved_value elif default_value is not None: assert not from_file msg = f', leave empty to use the default value: {default_value}' else: msg = ' (required)' if from_file: print(f'Enter the path to a file containing the value for {key}{msg}') source_path = input(f'{key} path: ') if source_path: with open(source_path) as f: set_values[key] = f.read() elif saved_value: set_values[key] = saved_value else: raise Exception('file path is required') else: if default_value in [True, False]: print(f'Enter a boolean value for {key}{msg}') entered_value = input(f'{key} [y/n]: ') bool_value = default_value if entered_value == '' else (entered_value == 'y') set_values[key] = 'y' if bool_value else 'n' else: print(f'Enter a value for {key}{msg}') entered_value = input(f'{key}: ') set_values[key] = str(entered_value or default_value) else: set_values[key] = saved_value if saved_value is not None else default_value logs.debug('set', **log_kwargs) return set(values=set_values, secret_name=secret_name, configmap_name=configmap_name, namespace=namespace, extra_operator_labels=extra_operator_labels) def _fetch(cache_key): config_type, namespace, config_name = _parse_cache_key(cache_key) fetch_func = { 'secret': lambda: _fetch_secret(config_name, namespace), 'configmap': lambda: _fetch_configmap(config_name, namespace) }.get(config_type) assert fetch_func, f'Invalid config type: {config_type}' return fetch_func() or {} def _fetch_secret(secret_name, namespace): secret = kubectl.get(f'secret {secret_name}', required=False, namespace=namespace) return kubectl.decode_secret(secret) if secret else None def _fetch_configmap(configmap_name, namespace): configmap = kubectl.get(f'configmap {configmap_name}', required=False, namespace=namespace) return configmap['data'] if configmap else None def _save(cache_key, values, extra_operator_labels, dry_run=False): config_type, namespace, config_name = _parse_cache_key(cache_key) save_func = { 'secret': lambda: _save_secret(values, config_name, namespace, extra_operator_labels, dry_run=dry_run), 'configmap': lambda: _save_configmap(values, config_name, namespace, extra_operator_labels, dry_run=dry_run), }.get(config_type) assert save_func, f'Invalid config type: {config_type}' __CACHED_VALUES[cache_key] = res = save_func() return res def _save_secret(values, secret_name, namespace, extra_operator_labels, dry_run=False): return kubectl.update_secret( secret_name, values, namespace=namespace, labels=_get_labels(secret_name=secret_name, namespace=namespace, extra_operator_labels=extra_operator_labels), dry_run=dry_run ) def _save_configmap(values, configmap_name, namespace, extra_operator_labels, dry_run=False): return kubectl.update_configmap( configmap_name, values, namespace=namespace, labels=_get_labels(configmap_name=configmap_name, namespace=namespace, extra_operator_labels=extra_operator_labels), dry_run=dry_run ) def _delete(cache_key, exists_ok=False): config_type, namespace, config_name = _parse_cache_key(cache_key) assert config_type in ['configmap', 'secret'], f'Invalid config type: {config_type}' ignore_not_found = ' --ignore-not-found' if exists_ok else '' kubectl.check_call(f'delete{ignore_not_found} {config_type} {config_name}') def _get_labels(cache_key=None, secret_name=None, configmap_name=None, namespace=None, extra_operator_labels=None): if cache_key: assert not secret_name and not configmap_name and not namespace else: cache_key = _get_cache_key(secret_name, configmap_name, namespace) config_type, namespace, config_name = _parse_cache_key(cache_key) operator_labels = { f'operator-config-{config_type}': config_name, 'operator-config-namespace': namespace } if extra_operator_labels: operator_labels.update(**extra_operator_labels) return labels_manager.get_resource_labels(operator_labels) def _get_cache_key(secret_name, configmap_name, namespace): if secret_name: assert not configmap_name, f'Invalid arguments: cannot specify both secret_name and configmap_name: {secret_name}, {configmap_name}' configmap_name, namespace = cluster_manager.get_operator_configmap_namespace_defaults(configmap_name, namespace) return f'secret:{namespace}:{secret_name}' if secret_name else f'configmap:{namespace}:{configmap_name}' def _parse_cache_key(cache_key): config_type, namespace, config_name = cache_key.split(':') return config_type, namespace, config_name
acidicMercury8/xray-1.6
src/xrGame/xrServer_svclient_validation.cpp
#include "stdafx.h" #include "xrServer_svclient_validation.h" #include "GameObject.h" #include "Level.h" bool is_object_valid_on_svclient(u16 id_entity) { CObject* tmp_obj = Level().Objects.net_Find(id_entity); if (!tmp_obj) return false; CGameObject* tmp_gobj = smart_cast<CGameObject*>(tmp_obj); if (!tmp_gobj) return false; if (tmp_obj->getDestroy()) return false; if (tmp_gobj->object_removed()) return false; return true; };
badu/http
tests/testenv_cgo.go
// +build cgo package tests /* * Copyright (c) 2018 The Go Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ func init() { haveCGO = true }
sourcepit/common-manifest
src/gen/emf/org/sourcepit/common/manifest/util/ManifestAdapterFactory.java
/* * Copyright 2014 <NAME> and others. * * 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.sourcepit.common.manifest.util; import java.util.Map.Entry; import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notifier; import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; import org.eclipse.emf.common.util.EMap; import org.eclipse.emf.ecore.EObject; import org.sourcepit.common.manifest.AbstractSection; import org.sourcepit.common.manifest.Header; import org.sourcepit.common.manifest.Manifest; import org.sourcepit.common.manifest.ManifestPackage; import org.sourcepit.common.manifest.ManifestSection; import org.sourcepit.common.manifest.Parseable; /** * <!-- begin-user-doc --> * The <b>Adapter Factory</b> for the model. * It provides an adapter <code>createXXX</code> method for each class of the model. * <!-- end-user-doc --> * * @see org.sourcepit.common.manifest.ManifestPackage * @generated */ public class ManifestAdapterFactory extends AdapterFactoryImpl { /** * The cached model package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ protected static ManifestPackage modelPackage; /** * Creates an instance of the adapter factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ public ManifestAdapterFactory() { if (modelPackage == null) { modelPackage = ManifestPackage.eINSTANCE; } } /** * Returns whether this factory is applicable for the type of the object. * <!-- begin-user-doc --> * This implementation returns <code>true</code> if the object is either the model's package or is an instance object * of the model. * <!-- end-user-doc --> * * @return whether this factory is applicable for the type of the object. * @generated */ @Override public boolean isFactoryForType(Object object) { if (object == modelPackage) { return true; } if (object instanceof EObject) { return ((EObject) object).eClass().getEPackage() == modelPackage; } return false; } /** * The switch that delegates to the <code>createXXX</code> methods. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ protected ManifestSwitch<Adapter> modelSwitch = new ManifestSwitch<Adapter>() { @Override public Adapter caseManifest(Manifest object) { return createManifestAdapter(); } @Override public Adapter caseManifestSection(ManifestSection object) { return createManifestSectionAdapter(); } @Override public Adapter caseHeader(Header object) { return createHeaderAdapter(); } @Override public Adapter caseSectionEntry(Entry<String, EMap<String, String>> object) { return createSectionEntryAdapter(); } @Override public Adapter caseHeaderEntry(Entry<String, String> object) { return createHeaderEntryAdapter(); } @Override public Adapter caseAbstractSection(AbstractSection object) { return createAbstractSectionAdapter(); } @Override public Adapter caseParseable(Parseable object) { return createParseableAdapter(); } @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); } }; /** * Creates an adapter for the <code>target</code>. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @param target the object to adapt. * @return the adapter for the <code>target</code>. * @generated */ @Override public Adapter createAdapter(Notifier target) { return modelSwitch.doSwitch((EObject) target); } /** * Creates a new adapter for an object of class '{@link org.sourcepit.common.manifest.Manifest <em>Manifest</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; * it's useful to ignore a case when inheritance will catch all the cases anyway. * <!-- end-user-doc --> * * @return the new adapter. * @see org.sourcepit.common.manifest.Manifest * @generated */ public Adapter createManifestAdapter() { return null; } /** * Creates a new adapter for an object of class '{@link org.sourcepit.common.manifest.ManifestSection * <em>Section</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; * it's useful to ignore a case when inheritance will catch all the cases anyway. * <!-- end-user-doc --> * * @return the new adapter. * @see org.sourcepit.common.manifest.ManifestSection * @generated */ public Adapter createManifestSectionAdapter() { return null; } /** * Creates a new adapter for an object of class '{@link org.sourcepit.common.manifest.Header <em>Header</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; * it's useful to ignore a case when inheritance will catch all the cases anyway. * <!-- end-user-doc --> * * @return the new adapter. * @see org.sourcepit.common.manifest.Header * @generated */ public Adapter createHeaderAdapter() { return null; } /** * Creates a new adapter for an object of class '{@link java.util.Map.Entry <em>Section Entry</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; * it's useful to ignore a case when inheritance will catch all the cases anyway. * <!-- end-user-doc --> * * @return the new adapter. * @see java.util.Map.Entry * @generated */ public Adapter createSectionEntryAdapter() { return null; } /** * Creates a new adapter for an object of class '{@link java.util.Map.Entry <em>Header Entry</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; * it's useful to ignore a case when inheritance will catch all the cases anyway. * <!-- end-user-doc --> * * @return the new adapter. * @see java.util.Map.Entry * @generated */ public Adapter createHeaderEntryAdapter() { return null; } /** * Creates a new adapter for an object of class '{@link org.sourcepit.common.manifest.AbstractSection * <em>Abstract Section</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; * it's useful to ignore a case when inheritance will catch all the cases anyway. * <!-- end-user-doc --> * * @return the new adapter. * @see org.sourcepit.common.manifest.AbstractSection * @generated */ public Adapter createAbstractSectionAdapter() { return null; } /** * Creates a new adapter for an object of class '{@link org.sourcepit.common.manifest.Parseable <em>Parseable</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; * it's useful to ignore a case when inheritance will catch all the cases anyway. * <!-- end-user-doc --> * * @return the new adapter. * @see org.sourcepit.common.manifest.Parseable * @generated */ public Adapter createParseableAdapter() { return null; } /** * Creates a new adapter for the default case. * <!-- begin-user-doc --> * This default implementation returns null. * <!-- end-user-doc --> * * @return the new adapter. * @generated */ public Adapter createEObjectAdapter() { return null; } } // ManifestAdapterFactory
zhaohui90-lee/springMVCdemo
src/test/java/myscope/ThreadScopeTest.java
package myscope; import com.melody.pojo.myscope.ThreadScope; import org.junit.Test; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.beans.factory.config.Scope; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import static org.junit.Assert.*; public class ThreadScopeTest { @Test public void scopeBean(){ Scope threadScope = new ThreadScope(); ConfigurableBeanFactory beanFactory = new DefaultListableBeanFactory(); beanFactory.registerScope("thread",threadScope); } }