chcandido / brModelo

brModelo 3.2
http://www.sis4.com
GNU General Public License v3.0
337 stars 56 forks source link

Erro ao executar com Java 11 do OpenJDK #17

Open tacianosilva opened 3 years ago

tacianosilva commented 3 years ago

Estou tentando executar o brModelo no Ubuntu 20.04 com Java 11 do OpenJDK, e tenho um erro relacionado com cores. Segue a exception, alguém tem alguma dica de como resolver?

Gtk-Message: 22:17:52.730: Failed to load module "canberra-gtk-module"
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Color parameter outside of expected range: Blue
    at java.desktop/java.awt.Color.testColorValueRange(Color.java:310)
    at java.desktop/java.awt.Color.<init>(Color.java:395)
    at java.desktop/java.awt.Color.<init>(Color.java:369)
    at controlador.inspector.InspectorItemSeparador.<init>(InspectorItemSeparador.java:23)
    at controlador.inspector.InspectorItemBase.SuperFactory(InspectorItemBase.java:350)
    at controlador.inspector.Inspector.Add(Inspector.java:211)
    at controlador.inspector.Inspector.lambda$Carrege$0(Inspector.java:496)
    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
    at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
    at controlador.inspector.Inspector.Carrege(Inspector.java:495)
    at controlador.Editor.PerformInspectorFor(Editor.java:1240)
    at controlador.Diagrama.PerformInspector(Diagrama.java:1574)
    at controlador.Editor.setInspectorEditor(Editor.java:1327)
    at principal.FramePrincipal.DoInit(FramePrincipal.java:116)
    at principal.FramePrincipal.<init>(FramePrincipal.java:75)
    at principal.Aplicacao$1.run(Aplicacao.java:62)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
chcandido commented 3 years ago

Há um bug neste trecho:

public InspectorItemSeparador(Inspector criador) {
    super(criador);
    Color c = getBackground();
    c = new Color(c.getRed(), c.getGreen(),  c.getBlue() - 15);
    //:BUG CORRIGIDO: Vinicius Oliveira Queiroz.
    setBackground(c);
}

A depender do retorno da função getBackground() tem-se um erro no trecho [c.getBlue() - 15]. Será corrigido, obrigado.


De: Taciano Morais Silva @.> Enviado: segunda-feira, 22 de março de 2021 21:19 Para: chcandido/brModelo @.> Cc: Subscribed @.***> Assunto: [chcandido/brModelo] Erro ao executar com Java 11 do OpenJDK (#17)

Estou tentando executar o brModelo no Ubuntu 20.04 com Java 11 do OpenJDK, e tenho um erro relacionado com cores. Segue a exception, alguém tem alguma dica de como resolver?

Gtk-Message: 22:17:52.730: Failed to load module "canberra-gtk-module"

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Color parameter outside of expected range: Blue

    at java.desktop/java.awt.Color.testColorValueRange(Color.java:310)

    at java.desktop/java.awt.Color.<init>(Color.java:395)

    at java.desktop/java.awt.Color.<init>(Color.java:369)

    at controlador.inspector.InspectorItemSeparador.<init>(InspectorItemSeparador.java:23)

    at controlador.inspector.InspectorItemBase.SuperFactory(InspectorItemBase.java:350)

    at controlador.inspector.Inspector.Add(Inspector.java:211)

    at controlador.inspector.Inspector.lambda$Carrege$0(Inspector.java:496)

    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)

    at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)

    at controlador.inspector.Inspector.Carrege(Inspector.java:495)

    at controlador.Editor.PerformInspectorFor(Editor.java:1240)

    at controlador.Diagrama.PerformInspector(Diagrama.java:1574)

    at controlador.Editor.setInspectorEditor(Editor.java:1327)

    at principal.FramePrincipal.DoInit(FramePrincipal.java:116)

    at principal.FramePrincipal.<init>(FramePrincipal.java:75)

    at principal.Aplicacao$1.run(Aplicacao.java:62)

    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)

    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)

    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)

    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)

    at java.base/java.security.AccessController.doPrivileged(Native Method)

    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)

    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)

    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)

    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)

    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)

    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)

    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)

    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fchcandido%2FbrModelo%2Fissues%2F17&data=04%7C01%7C%7C1c653598ab5f4b10350d08d8ed99ad8d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637520591578086155%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=68s6D87TC4OIRJLKZ4dJAGKMarY6KfrLIZEIvW60jHc%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGZTGOLPX5DHLEUALNHA2C3TE7UBJANCNFSM4ZUGJBUQ&data=04%7C01%7C%7C1c653598ab5f4b10350d08d8ed99ad8d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637520591578086155%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=DnLxCG4uHUpoCef69e6sLHLeA8vFqK33LafjuW1cD9c%3D&reserved=0.

tacianosilva commented 3 years ago

Depois de pesquisar fiz a mudança do meu tema do Ubuntu (estava com um tema Dark) para um tema padrão. Depois da mudança do tema o brModelo abriu normalmente.

Valeu!

ormesino commented 2 years ago

Também estava tendo esse mesmo problema, após modificar o tema do Ubuntu, o brModelo funcionou novamente